summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-11-01 20:00:25 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-11-01 20:00:25 +0000
commit3af8ab3411a278478548bfb9c4852c89573aae85 (patch)
tree675dd5bf9a7b552ad0c293b0c90008b42099514d /bfd/elf32-arm.c
parent5054c49822b36070db4bb277cba65d45d58f9b31 (diff)
downloadgdb-3af8ab3411a278478548bfb9c4852c89573aae85.tar.gz
* elf32-arm.c (bfd_elf32_arm_process_before_allocation): Correct
check for PLT usage.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 06adaeff7d1..2faac89db55 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2934,9 +2934,19 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd,
if (h == NULL)
continue;
- /* If the call will go through a PLT entry then we do not need
- glue. */
- if (globals->splt != NULL && h->plt.offset != (bfd_vma) -1)
+ /* If the call will go through a PLT entry then we do not
+ need glue. We have to do a fairly complicated check
+ here, since we don't determine this finally (by setting
+ plt.offset) until later; this test should be kept in sync
+ with elf32_arm_adjust_dynamic_symbol. */
+ if (globals->splt != NULL
+ && h->plt.refcount > 0
+ && (h->type == STT_FUNC
+ || h->type == STT_ARM_TFUNC
+ || h->needs_plt)
+ && !SYMBOL_CALLS_LOCAL (link_info, h)
+ && !(ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak))
continue;
switch (r_type)