From 87d72d41b073d51b7409d2b0e7f0bbb7b840e1e6 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 18 Jun 2009 14:18:29 +0000 Subject: * elf-bfd.h (struct sym_sec_cache): Delete. (struct sym_cache): New. (bfd_section_from_r_symndx): Delete prototype. (bfd_sym_from_r_symndx): Define prototype. * elf.c (bfd_section_from_r_symndx): Delete, replace with.. (bfd_sym_from_r_symndx): ..new function. * elf32-arm.c: Update all uses of struct sym_sec_cache and bfd_section_from_r_symndx to new struct and function. * elf32-bfin.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68hc1x.h: Likewise. * elf32-m68k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-x86-64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-sparc.h: Likewise. --- bfd/elf32-m32r.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'bfd/elf32-m32r.c') diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index fd67e05..651e6d5 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1526,8 +1526,8 @@ struct elf_m32r_link_hash_table 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. */ @@ -1604,7 +1604,7 @@ m32r_elf_link_hash_table_create (bfd *abfd) ret->srelplt = NULL; ret->sdynbss = NULL; ret->srelbss = NULL; - ret->sym_sec.abfd = NULL; + ret->sym_cache.abfd = NULL; return &ret->root.root; } @@ -3941,14 +3941,19 @@ m32r_elf_check_relocs (bfd *abfd, 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; -- cgit v1.1