]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[AArch64] Fix function pointer variable with -Bsymbolic-functions
authorJiong Wang <jiong.wang@arm.com>
Tue, 13 Jan 2015 11:36:54 +0000 (11:36 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 24 Aug 2017 12:46:20 +0000 (09:46 -0300)
bfd/ChangeLog

2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com>

    * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
    SYMBOLIC_BIND to check if a symbol should be bound symbolically.

ld/testsuite/ChangeLog

2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com>

    * ld-aarch64/aarch64-elf.exp: Added relocs-257-symbolic-func test.
    * ld-aarch64/relocs-257-symbolic-func.d: New file.
    * ld-aarch64/relocs-257-symbolic-func.s: Likewise.

Change-Id: I892147fc9dea1dfc5d688ea90a7bbf912ab2d8ac

bfd/ChangeLog
bfd/elfnn-aarch64.c
ld/testsuite/ChangeLog
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/relocs-257-symbolic-func.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/relocs-257-symbolic-func.s [new file with mode: 0644]

index bc97edafde8494cd60247a3c17b675c1f17cc59d..3b376cb9b273d09ddd7ce0aeca405f23d674b38f 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-13  Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+       * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
+       to check if a symbol should be bound symbolically.
+
 2015-07-25  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to
index e6206c888f2d8f673022693c48969f7169beec0a..b32f44eceec1f0a2d5553869a34a53cd86e35dd1 100644 (file)
@@ -4662,7 +4662,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
            memset (&outrel, 0, sizeof outrel);
          else if (h != NULL
                   && h->dynindx != -1
-                  && (!info->shared || !info->symbolic || !h->def_regular))
+                  && (!info->shared || !SYMBOLIC_BIND (info, h) || !h->def_regular))
            outrel.r_info = ELFNN_R_INFO (h->dynindx, r_type);
          else
            {
index 294039be1e5f5f711549d6fc394607b120971a34..a957236d315c69bec82809edfdd455e1f041681a 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-13  Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+       * ld-aarch64/aarch64-elf.exp: Added relocs-257-symbolic-func test.
+       * ld-aarch64/relocs-257-symbolic-func.d: New file.
+       * ld-aarch64/relocs-257-symbolic-func.s: Likewise.
+
 2015-07-25  Alan Modra  <amodra@gmail.com>
 
        * ld-elf/symbolic-func.s,
index d0f557d655e7e6fc75cb1bab619a4f65f7ab86ec..d8557edc1085768881b9ed6db7778e878fa0a913 100644 (file)
@@ -176,6 +176,7 @@ run_dump_test "ifunc-21"
 run_dump_test "ifunc-22"
 
 run_dump_test "relasz"
+run_dump_test "relocs-257-symbolic-func"
 
 set aarch64elflinktests {
   {"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
diff --git a/ld/testsuite/ld-aarch64/relocs-257-symbolic-func.d b/ld/testsuite/ld-aarch64/relocs-257-symbolic-func.d
new file mode 100644 (file)
index 0000000..810fd43
--- /dev/null
@@ -0,0 +1,5 @@
+#source: relocs-257-symbolic-func.s
+#ld: -shared -Bsymbolic-functions
+#readelf: -r --wide
+#...
+.* +R_AARCH64_RELATIVE +.*
diff --git a/ld/testsuite/ld-aarch64/relocs-257-symbolic-func.s b/ld/testsuite/ld-aarch64/relocs-257-symbolic-func.s
new file mode 100644 (file)
index 0000000..35d5ba8
--- /dev/null
@@ -0,0 +1,11 @@
+       .text
+       .global tempy
+       .type   tempy, %function
+tempy:
+       .size   tempy, .-tempy
+       .section        .data.rel
+       .align 3
+       .type   tempy_ptr, %object
+       .size   tempy_ptr, 8
+tempy_ptr:
+       .xword  tempy