summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwillnewton <willnewton>2013-03-27 09:51:45 +0000
committerwillnewton <willnewton>2013-03-27 09:51:45 +0000
commitbd85279e053f624e366420b43eb3a118403b9d3e (patch)
tree6c3b1d3d54788bd6ce63270f515db7480550fc47
parent54bd79e416a1489e6f3c2f7365c9fd295a098baf (diff)
downloadgdb-bd85279e053f624e366420b43eb3a118403b9d3e.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.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 47f757ddf96..6d3e973fbab 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,6 +1,13 @@
2013-03-27 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.
+
+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.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index ec339169e52..9a97cbfc9a8 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9139,7 +9139,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
{
Elf_Internal_Rela outrel;
- if (!SYMBOL_REFERENCES_LOCAL (info, h))
+ if (h->dynindx != -1 && !SYMBOL_REFERENCES_LOCAL (info, h))
{
/* If the symbol doesn't resolve locally in a static
object, we have an undefined reference. If the
@@ -13274,7 +13274,7 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf)
if ((tls_type & GOT_TLS_GD) && indx != 0)
elf32_arm_allocate_dynrelocs (info, htab->root.srelgot, 1);
}
- else if (!SYMBOL_REFERENCES_LOCAL (info, h))
+ else if (indx != -1 && !SYMBOL_REFERENCES_LOCAL (info, h))
{
if (htab->root.dynamic_sections_created)
/* Reserve room for the GOT entry's R_ARM_GLOB_DAT relocation. */