aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-08-05 16:24:12 +0000
committerDaniel Jacobowitz <drow@false.org>2003-08-05 16:24:12 +0000
commit50d6c87817d9b450dcad0ab0ef0a1c5d3a1c149c (patch)
tree2620a42295f4450fc073bc7df5d8638c500cbe7c /bfd/elf32-arm.h
parentd3ba05513b6f7316de79602889ba8dc48046a1ea (diff)
downloadgdb-50d6c87817d9b450dcad0ab0ef0a1c5d3a1c149c.zip
gdb-50d6c87817d9b450dcad0ab0ef0a1c5d3a1c149c.tar.gz
gdb-50d6c87817d9b450dcad0ab0ef0a1c5d3a1c149c.tar.bz2
* elf32-arm.h (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
(elf32_arm_final_link_relocate, elf32_arm_relocate_section): Use it.
Diffstat (limited to 'bfd/elf32-arm.h')
-rw-r--r--bfd/elf32-arm.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index f073e7a..2c62ec6 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1038,6 +1038,18 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section,
return TRUE;
}
+/* This is the condition under which elf32_arm_finish_dynamic_symbol
+ will be called from elflink.h. If elflink.h doesn't call our
+ finish_dynamic_symbol routine, we'll need to do something about
+ initializing any .plt and .got entries in elf32_arm_relocate_section
+ and elf32_arm_final_link_relocate. */
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
+ ((DYN) \
+ && ((SHARED) \
+ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
+ && ((H)->dynindx != -1 \
+ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
+
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
@@ -1605,13 +1617,16 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
if (h != NULL)
{
bfd_vma off;
+ bfd_boolean dyn = elf_hash_table (info)->dynamic_sections_created;
off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
- if (!elf_hash_table (info)->dynamic_sections_created ||
- (info->shared && (info->symbolic || h->dynindx == -1)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ || (info->shared
+ && (info->symbolic || h->dynindx == -1
+ || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a -Bsymbolic link
and the symbol is defined locally. We must initialize this
@@ -1991,12 +2006,13 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
break;
case R_ARM_GOT32:
- if (elf_hash_table(info)->dynamic_sections_created
- && (!info->shared
+ if ((WILL_CALL_FINISH_DYNAMIC_SYMBOL
+ (elf_hash_table(info)->dynamic_sections_created,
+ info->shared, h))
+ && (!info->shared
|| (!info->symbolic && h->dynindx != -1)
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- )
- )
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))
relocation_needed = 0;
break;