bfd/elf32-arm.c: Set st_value to zero for undefined symbols
authorWill Newton <will.newton@linaro.org>
Fri, 10 Jan 2014 14:38:58 +0000 (14:38 +0000)
committerWill Newton <will.newton@linaro.org>
Thu, 20 Mar 2014 11:43:33 +0000 (11:43 +0000)
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.

bfd/ChangeLog
bfd/elf32-arm.c
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/ifunc-14.rd

index 40f3beda63de20dcf815270bbb548f5c8132b88c..c60d19d6e92b9ee180f57eb325627b53736b82b5 100644 (file)
@@ -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
index 1aae31b4c908771c0e8080e71a3f01f25195ebb2..81be93f1f2a164caf995b1d6d07c430da9c3da75 100644 (file)
@@ -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)
index cc62e0e99c923096f801220c8e4b33a0e3815a5e..9e4ce823942dd87ebce5a28d5b7167c645618c9b 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-20  Will Newton  <will.newton@linaro.org>
+
+       * ld-arm/ifunc-14.rd: Update symbol values.
+
 2014-03-19  Nick Clifton  <nickc@redhat.com>
 
        * config/default.exp (ASFLAGS): For the RX target add:
index 59ea29bcb2dbf0351ff7ff10aeec267b1a533c1e..9c440928fe37ef006949124e20aa071288ab466c 100644 (file)
@@ -8,5 +8,5 @@ Relocation section '\.rel\.dyn' at offset 0x8000 contains 4 entries:
 
 Relocation section '\.rel\.plt' at offset 0x8020 contains 2 entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
-0001100c  ......16 R_ARM_JUMP_SLOT   00009014   f2t
-00011010  ......16 R_ARM_JUMP_SLOT   00009020   f2
+0001100c  ......16 R_ARM_JUMP_SLOT   00000000   f2t
+00011010  ......16 R_ARM_JUMP_SLOT   00000000   f2