about summary refs log tree commit diff
path: root/elf/libelf.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-04-14 01:13:53 +0000
committerRoland McGrath <roland@gnu.org>1995-04-14 01:13:53 +0000
commit6e33fad374814f1a4bf80aa37d4ded9c9096edab (patch)
tree28ea2008d8c3669a66dd23287cd94d7e9b815b96 /elf/libelf.h
parent6432a7793f6be8d3b6840e47e752103beaca70c9 (diff)
downloadglibc-6e33fad374814f1a4bf80aa37d4ded9c9096edab.tar.gz
glibc-6e33fad374814f1a4bf80aa37d4ded9c9096edab.tar.xz
glibc-6e33fad374814f1a4bf80aa37d4ded9c9096edab.zip
Thu Apr 13 09:45:01 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* elf/libelf.h (elf_hash): Use XOR instead of ANDN when the bits
 	being cleared are already known to be set.  Thanks Ulrich.
Diffstat (limited to 'elf/libelf.h')
-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;
 }