aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-06-18 14:18:29 +0000
committerAlan Modra <amodra@gmail.com>2009-06-18 14:18:29 +0000
commit87d72d41b073d51b7409d2b0e7f0bbb7b840e1e6 (patch)
treeacf55c4342fb883110374281890a211aa7ae2c7d /bfd/elf64-x86-64.c
parentc098b58b165ac735c3908e5167d0c1efc37f9a41 (diff)
downloadgdb-87d72d41b073d51b7409d2b0e7f0bbb7b840e1e6.zip
gdb-87d72d41b073d51b7409d2b0e7f0bbb7b840e1e6.tar.gz
gdb-87d72d41b073d51b7409d2b0e7f0bbb7b840e1e6.tar.bz2
* 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.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 581d544..f1cf825 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -487,8 +487,8 @@ struct elf64_x86_64_link_hash_table
/* The amount of space used by the jump slots in the GOT. */
bfd_vma sgotplt_jump_table_size;
- /* Small local sym to section mapping cache. */
- struct sym_sec_cache sym_sec;
+ /* Small local sym cache. */
+ struct sym_cache sym_cache;
/* _TLS_MODULE_BASE_ symbol. */
struct bfd_link_hash_entry *tls_module_base;
@@ -629,7 +629,7 @@ elf64_x86_64_link_hash_table_create (bfd *abfd)
ret->sdynbss = NULL;
ret->srelbss = NULL;
- ret->sym_sec.abfd = NULL;
+ ret->sym_cache.abfd = NULL;
ret->tlsdesc_plt = 0;
ret->tlsdesc_got = 0;
ret->tls_ld_got.refcount = 0;
@@ -1478,16 +1478,21 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
}
else
{
- void **vpp;
/* Track dynamic relocs needed for local syms too.
We really need local syms available to do this
easily. Oh well. */
-
asection *s;
- s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
- sec, r_symndx);
+ void **vpp;
+ Elf_Internal_Sym *isym;
+
+ 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)
- goto error_return;
+ s = sec;
/* Beware of type punned pointers vs strict aliasing
rules. */