aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2004-01-13 21:09:34 +0000
committerDaniel Jacobowitz <drow@false.org>2004-01-13 21:09:34 +0000
commitc84cd8eead90f15c04d45d98d53388bc9040869f (patch)
tree64d57fa30589279a44951c838e31537e1bcbea37 /bfd
parent0885b73e8a827df0530bb2cee57affc5ecd9fa1e (diff)
downloadgdb-c84cd8eead90f15c04d45d98d53388bc9040869f.zip
gdb-c84cd8eead90f15c04d45d98d53388bc9040869f.tar.gz
gdb-c84cd8eead90f15c04d45d98d53388bc9040869f.tar.bz2
* elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
the .plt section. (elf32_arm_check_relocs): Don't increment the PLT refcount for relocs which would not use the PLT.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-arm.h16
2 files changed, 18 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2bc8d44..1fcd3f5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
+ the .plt section.
+ (elf32_arm_check_relocs): Don't increment the PLT refcount for
+ relocs which would not use the PLT.
+
2004-01-13 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index a684546..369bbe3 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1317,9 +1317,12 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
branches in this object should go to it. */
if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32)
&& h != NULL
+ && splt != NULL
&& h->plt.offset != (bfd_vma) -1)
{
- BFD_ASSERT (splt != NULL);
+ /* If we've created a .plt section, and assigned a PLT entry to
+ this function, it should not be known to bind locally. If
+ it were, we would have cleared the PLT entry. */
BFD_ASSERT (!SYMBOL_CALLS_LOCAL (info, h));
value = (splt->output_section->vma
@@ -2937,12 +2940,15 @@ elf32_arm_check_relocs (abfd, info, sec, relocs)
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
/* We may need a .plt entry if the function this reloc
- refers to is in a different object. */
+ refers to is in a different object. We can't tell for
+ sure yet, because something later might force the
+ symbol local. */
if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24
|| ELF32_R_TYPE (rel->r_info) == R_ARM_PLT32)
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
-
- h->plt.refcount += 1;
+ {
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->plt.refcount += 1;
+ }
}
/* If we are creating a shared library, and this is a reloc