From: Jiong Wang Date: Tue, 13 Jan 2015 11:36:54 +0000 (+0000) Subject: [AArch64] Fix function pointer variable with -Bsymbolic-functions X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a60b3ec7586bd36918d1042de4c7611d2677a216;p=thirdparty%2Fbinutils-gdb.git [AArch64] Fix function pointer variable with -Bsymbolic-functions bfd/ChangeLog 2015-01-13 Thomas Preud'homme * 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 * 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 --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bc97edafde8..3b376cb9b27 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2015-01-13 Thomas Preud'homme + + * 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 * elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index e6206c888f2..b32f44eceec 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -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 { diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 294039be1e5..a957236d315 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-01-13 Thomas Preud'homme + + * 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 * ld-elf/symbolic-func.s, diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index d0f557d655e..d8557edc108 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -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 index 00000000000..810fd430606 --- /dev/null +++ b/ld/testsuite/ld-aarch64/relocs-257-symbolic-func.d @@ -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 index 00000000000..35d5ba8022f --- /dev/null +++ b/ld/testsuite/ld-aarch64/relocs-257-symbolic-func.s @@ -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