From aab82f4c201a2612c0fb6d5b66d8e4ce2f036f1c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 10 May 2017 09:28:00 -0700 Subject: x86-64: Use .plt.bnd for IFUNC function address When -z bndplt is used, we must use the .plt.bnd entry for IFUNC function address. bfd/ PR ld/21481 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd for IFUNC function address. ld/ PR ld/21481 * testsuite/ld-x86-64/pr21481a.c: New file. * testsuite/ld-x86-64/pr21481b.S: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run PR ld/21481 tests. --- ld/testsuite/ld-x86-64/x86-64.exp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ld/testsuite/ld-x86-64/x86-64.exp') diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 84cc7d7..61032aa 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -1316,6 +1316,24 @@ if { [isnative] && [which $CC] != 0 } { "pr20800" \ "pass.out" \ ] \ + [list \ + "Run pr21481a" \ + "$NOPIE_LDFLAGS -Wl,-z,bndplt" \ + "" \ + { pr21481a.c pr21481b.S } \ + "pr21481a" \ + "pass.out" \ + "$NOPIE_CFLAGS" \ + ] \ + [list \ + "Run pr21481b" \ + "$NOPIE_LDFLAGS -Wl,-z,bndplt,-z,now" \ + "" \ + { pr21481a.c pr21481b.S } \ + "pr21481b" \ + "pass.out" \ + "$NOPIE_CFLAGS" \ + ] \ ] } -- cgit v1.1