Lines 17-22
Link Here
|
17 |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
17 |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
18 |
02111-1307 USA. */ |
18 |
02111-1307 USA. */ |
19 |
|
19 |
|
|
|
20 |
# define SUSEIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM + \ |
21 |
DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM + DT_SUSE_TAGIDX (sym)) |
22 |
|
20 |
/* Inner part of the lookup functions. We return a value > 0 if we |
23 |
/* Inner part of the lookup functions. We return a value > 0 if we |
21 |
found the symbol, the value 0 if nothing is found and < 0 if |
24 |
found the symbol, the value 0 if nothing is found and < 0 if |
22 |
something bad happened. */ |
25 |
something bad happened. */ |
Lines 35-40
Link Here
|
35 |
do |
38 |
do |
36 |
{ |
39 |
{ |
37 |
const ElfW(Sym) *symtab; |
40 |
const ElfW(Sym) *symtab; |
|
|
41 |
const Elf_Symndx *hashvals; |
38 |
const char *strtab; |
42 |
const char *strtab; |
39 |
const ElfW(Half) *verstab; |
43 |
const ElfW(Half) *verstab; |
40 |
Elf_Symndx symidx; |
44 |
Elf_Symndx symidx; |
Lines 62-70
Link Here
|
62 |
undef_name, |
66 |
undef_name, |
63 |
map->l_name[0] ? map->l_name : rtld_progname); |
67 |
map->l_name[0] ? map->l_name : rtld_progname); |
64 |
|
68 |
|
65 |
symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]); |
69 |
if (__builtin_expect (map->l_info[SUSEIDX(DT_SUSE_HASHVALS)] != NULL, 1)) |
66 |
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); |
70 |
hashvals = (const void *) D_PTR (map, l_info[SUSEIDX(DT_SUSE_HASHVALS)]); |
67 |
verstab = map->l_versyms; |
71 |
else |
|
|
72 |
hashvals = NULL; |
68 |
|
73 |
|
69 |
/* Search the appropriate hash bucket in this object's symbol table |
74 |
/* Search the appropriate hash bucket in this object's symbol table |
70 |
for a definition for the same symbol name. */ |
75 |
for a definition for the same symbol name. */ |
Lines 72-77
Link Here
|
72 |
symidx != STN_UNDEF; |
77 |
symidx != STN_UNDEF; |
73 |
symidx = map->l_chain[symidx]) |
78 |
symidx = map->l_chain[symidx]) |
74 |
{ |
79 |
{ |
|
|
80 |
if (__builtin_expect (hashvals != NULL, 1) && |
81 |
__builtin_expect ((ElfW(Addr))hashvals < map->l_map_end, 1) && |
82 |
__builtin_expect ((ElfW(Addr))hashvals > map->l_map_start, 1)) |
83 |
{ |
84 |
if (__builtin_expect (hashvals[symidx] != hash, 1)) |
85 |
continue; |
86 |
} |
87 |
/* If hashvals is present 99.9% of the loop is done: what follows |
88 |
is the very un-common / direct-hit case */ |
89 |
|
90 |
symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]); |
91 |
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); |
92 |
verstab = map->l_versyms; |
93 |
|
75 |
sym = &symtab[symidx]; |
94 |
sym = &symtab[symidx]; |
76 |
|
95 |
|
77 |
assert (ELF_RTYPE_CLASS_PLT == 1); |
96 |
assert (ELF_RTYPE_CLASS_PLT == 1); |