diff options
author | Alan Modra <amodra@gmail.com> | 2005-01-11 09:32:53 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-01-11 09:32:53 +0000 |
commit | 3eb128b2a5632a80460a8c22414e3541d1531d02 (patch) | |
tree | 13ad7265d567a369e3b24fbc35cda9c7a97d8cd0 /bfd/elf32-arm.c | |
parent | 264a1fe053aad624f8072e11e501f853b1a221a5 (diff) | |
download | gdb-3eb128b2a5632a80460a8c22414e3541d1531d02.zip gdb-3eb128b2a5632a80460a8c22414e3541d1531d02.tar.gz gdb-3eb128b2a5632a80460a8c22414e3541d1531d02.tar.bz2 |
* elf64-ppc.c (ppc64_elf_gc_sweep_hook): Follow indirect and warning
symbols.
* elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
* elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
* elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
* elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
* elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
* elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
* elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
* elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
* elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
* elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.
* elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
* elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
* elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
* elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 1f113e2..6e24153 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -3843,8 +3843,6 @@ elf32_arm_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - struct elf_link_hash_entry *h; struct elf32_arm_link_hash_table * globals; globals = elf32_arm_hash_table (info); @@ -3858,8 +3856,19 @@ elf32_arm_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) { + unsigned long r_symndx; + struct elf_link_hash_entry *h = NULL; int r_type; + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } + r_type = ELF32_R_TYPE (rel->r_info); #ifndef OLD_ARM_ABI r_type = arm_real_reloc_type (globals, r_type); @@ -3870,10 +3879,8 @@ elf32_arm_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, #ifndef OLD_ARM_ABI case R_ARM_GOT_PREL: #endif - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) + if (h != NULL) { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; if (h->got.refcount > 0) h->got.refcount -= 1; } @@ -3896,14 +3903,12 @@ elf32_arm_gc_sweep_hook (bfd * abfd ATTRIBUTE_UNUSED, case R_ARM_THM_PC22: /* Should the interworking branches be here also? */ - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) + if (h != NULL) { struct elf32_arm_link_hash_entry *eh; struct elf32_arm_relocs_copied **pp; struct elf32_arm_relocs_copied *p; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; eh = (struct elf32_arm_link_hash_entry *) h; if (h->plt.refcount > 0) |