about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/libelf.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/elf/libelf.h b/elf/libelf.h
index e95dd93eaa..b6575b9824 100644
--- a/elf/libelf.h
+++ b/elf/libelf.h
@@ -220,8 +220,12 @@ elf_hash (__const char *__name)
       __hash = (__hash << 4) + *__name++;
       __hi = __hash & 0xf0000000;
       if (__hi != 0)
-	__hash ^= __hi >> 24;
-      __hash &= ~__hi;
+	{
+	  __hash ^= __hi >> 24;
+	  /* The ELF ABI says `hash &= ~hi', but this is equivalent
+	     in this case and on some machines one insn instead of two.  */
+	  __hash ^= __hi;
+	}
     }
   return __hash;
 }