svn commit: trunk/uClibc/ldso/ldso

jocke at uclibc.org jocke at uclibc.org
Tue Jan 9 14:30:17 PST 2007


Author: jocke
Date: 2007-01-09 14:30:16 -0800 (Tue, 09 Jan 2007)
New Revision: 17209

Log:
Joseph S. Myers writes:

ELF symbol names are arbitrary 0-terminated sequences of bytes, and the 
ELF hash function is defined in the ELF specification to use unsigned 
char.  Thus uClibc's _dl_elf_hash, using plain char, breaks when char is 
signed and symbol names contain bytes with the high bit set, as with GCC's 
ucnid-* tests.  This patch fixes this problem.



Modified:
   trunk/uClibc/ldso/ldso/dl-hash.c


Changeset:
Modified: trunk/uClibc/ldso/ldso/dl-hash.c
===================================================================
--- trunk/uClibc/ldso/ldso/dl-hash.c	2007-01-09 17:41:54 UTC (rev 17208)
+++ trunk/uClibc/ldso/ldso/dl-hash.c	2007-01-09 22:30:16 UTC (rev 17209)
@@ -57,7 +57,7 @@
 /* This is the hash function that is used by the ELF linker to generate the
  * hash table that each executable and library is required to have.  We need
  * it to decode the hash table.  */
-static inline Elf_Symndx _dl_elf_hash(const char *name)
+static inline Elf_Symndx _dl_elf_hash(const unsigned char *name)
 {
 	unsigned long hash=0;
 	unsigned long tmp;
@@ -138,7 +138,7 @@
 	const ElfW(Sym) *sym;
 	char *weak_result = NULL;
 
-	elf_hash_number = _dl_elf_hash(name);
+	elf_hash_number = _dl_elf_hash((const unsigned char *)name);
 
 	for (; rpnt; rpnt = rpnt->next) {
 		tpnt = rpnt->dyn;



More information about the uClibc-cvs mailing list