summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwillnewton <willnewton>2013-03-27 09:48:45 +0000
committerwillnewton <willnewton>2013-03-27 09:48:45 +0000
commit54bd79e416a1489e6f3c2f7365c9fd295a098baf (patch)
treeac53a0bca921240aa7ffee45057a2f41b9f136e6
parent198b669079cab819db9e36cded9069238f62c09f (diff)
downloadgdb-54bd79e416a1489e6f3c2f7365c9fd295a098baf.tar.gz
bfd/ChangeLog:
2013-03-20 Will Newton <will.newton@linaro.org> * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a dynamic reloc for symbols with dynindx == -1. (allocate_dynrelocs_for_symbol): Avoid allocating space for a dynamic reloc for symbols with dynindx == -1.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-arm.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e6e6c771d0a..47f757ddf96 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2013-03-27 Will Newton <will.newton@linaro.org>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
+ dynamic reloc for non-default visibility undefined weaks.
+ (allocate_dynrelocs_for_symbol): Avoid allocating space for a
+ dynamic reloc for non-default visibility undefined weaks.
+
2013-03-26 Alan Modra <amodra@gmail.com>
* elflink.c (_bfd_elf_add_default_symbol): Preserve section
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 78c2d1d7b7a..ec339169e52 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9158,7 +9158,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
{
if (dynreloc_st_type == STT_GNU_IFUNC)
outrel.r_info = ELF32_R_INFO (0, R_ARM_IRELATIVE);
- else if (info->shared)
+ else if (info->shared &&
+ (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
else
outrel.r_info = 0;
@@ -13284,7 +13286,8 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf)
they all resolve dynamically instead. Reserve room for the
GOT entry's R_ARM_IRELATIVE relocation. */
elf32_arm_allocate_irelocs (info, htab->root.srelgot, 1);
- else if (info->shared)
+ else if (info->shared && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
/* Reserve room for the GOT entry's R_ARM_RELATIVE relocation. */
elf32_arm_allocate_dynrelocs (info, htab->root.srelgot, 1);
}