diff options
author | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2007-01-09 22:30:16 +0000 |
---|---|---|
committer | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2007-01-09 22:30:16 +0000 |
commit | 9855a12e730886e224de11964f36f359387f77c3 (patch) | |
tree | 5ed5bb22ae44de1c5ffe193dc7b8d0105edbd809 /ldso | |
parent | e26ed573b62f69d9813e72fda4ee3da6eaf4d7b7 (diff) |
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.
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/dl-hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c index 4fd7ba0b7..f44d0ec89 100644 --- a/ldso/ldso/dl-hash.c +++ b/ldso/ldso/dl-hash.c @@ -57,7 +57,7 @@ struct dyn_elf *_dl_handles = NULL; /* 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 @@ char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve * 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; |