/* We assume that the string table follows the symbol table, because
there is no way in ELF to know the size of the dynamic symbol table!! */
for (matchsym = NULL; (void *) symtab < (void *) strtab; ++symtab)
- if (addr >= match->l_addr + symtab->st_value && !matchsym ||
- matchsym->st_value < symtab->st_value &&
- ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL ||
- ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
+ if (addr >= match->l_addr + symtab->st_value
+ && (!matchsym
+ || (matchsym->st_value < symtab->st_value
+ && (ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
+ || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK))))
matchsym = symtab;
if (matchsym)