aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-01-10 14:38:58 +0000
committerWill Newton <will.newton@linaro.org>2014-03-20 11:43:33 +0000
commit97323ad11305610185a0265392cabcd37510f50e (patch)
tree0bbfadab17a8f34d3abf214850130357b42e7a4e /bfd
parente1f8f1b3af798e8af99bffdb695f74c6c916d150 (diff)
downloadgdb-97323ad11305610185a0265392cabcd37510f50e.zip
gdb-97323ad11305610185a0265392cabcd37510f50e.tar.gz
gdb-97323ad11305610185a0265392cabcd37510f50e.tar.bz2
bfd/elf32-arm.c: Set st_value to zero for undefined symbols
Unless pointer_equality_needed is set then set st_value to be zero for undefined symbols. bfd/ChangeLog: 2014-03-20 Will Newton <will.newton@linaro.org> PR ld/16715 * elf32-arm.c (elf32_arm_check_relocs): Set pointer_equality_needed for absolute references within executable links. (elf32_arm_finish_dynamic_symbol): Set st_value to zero unless pointer_equality_needed is set. ld/testsuite/ChangeLog: 2014-03-20 Will Newton <will.newton@linaro.org> * ld-arm/ifunc-14.rd: Update symbol values.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf32-arm.c7
2 files changed, 15 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 40f3bed..c60d19d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2014-03-20 Will Newton <will.newton@linaro.org>
+
+ PR ld/16715
+ * elf32-arm.c (elf32_arm_check_relocs): Set
+ pointer_equality_needed for absolute references within
+ executable links.
+ (elf32_arm_finish_dynamic_symbol): Set st_value to zero
+ unless pointer_equality_needed is set.
+
2014-03-19 Nick Clifton <nickc@redhat.com>
* peXXigen.c (rsrc_process_section): Add code to scan input
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 1aae31b..81be93f 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -12800,6 +12800,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* Fall through. */
case R_ARM_ABS32:
case R_ARM_ABS32_NOI:
+ if (h != NULL && info->executable)
+ {
+ h->pointer_equality_needed = 1;
+ }
+ /* Fall through. */
case R_ARM_REL32:
case R_ARM_REL32_NOI:
case R_ARM_MOVW_PREL_NC:
@@ -14165,7 +14170,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd,
Otherwise, the PLT entry would provide a definition for
the symbol even if the symbol wasn't defined anywhere,
and so the symbol would never be NULL. */
- if (!h->ref_regular_nonweak)
+ if (!h->ref_regular_nonweak || !h->pointer_equality_needed)
sym->st_value = 0;
}
else if (eh->is_iplt && eh->plt.noncall_refcount != 0)