asection *sdynbss;
asection *srelbss;
- /* Small local sym to section mapping cache. */
- struct sym_sec_cache sym_sec;
+ /* Small local sym cache. */
+ struct sym_cache sym_cache;
};
/* Traverse an m32r ELF linker hash table. */
ret->srelplt = NULL;
ret->sdynbss = NULL;
ret->srelbss = NULL;
- ret->sym_sec.abfd = NULL;
+ ret->sym_cache.abfd = NULL;
return &ret->root.root;
}
head = &((struct elf_m32r_link_hash_entry *) h)->dyn_relocs;
else
{
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
+ Elf_Internal_Sym *isym;
- /* Track dynamic relocs needed for local syms too. */
- s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
- sec, r_symndx);
- if (s == NULL)
- return FALSE;
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache,
+ abfd, r_symndx);
+ if (isym == NULL)
+ return FALSE;
+
+ s = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ if (s == NULL)
+ s = sec;
vpp = &elf_section_data (s)->local_dynrel;
head = (struct elf_m32r_dyn_relocs **) vpp;