From 44c4ea11d335f8d5691e9ea5c38c3187ab568467 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 14 Jun 2009 22:13:30 +0000 Subject: bfd/ 2009-06-14 H.J. Lu PR ld/10270 * elf32-i386.c (elf_i386_allocate_dynrelocs): Disallow dynamic IFUNC pointer in non-shared object. Use .got.plt for IFUNC definition in PIE. (elf_i386_allocate_dynrelocs): Resolve IFUNC definition in PIE locally. * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Disallow dynamic IFUNC pointer in non-shared object. Use .got.plt for IFUNC definition in PIE. (elf64_x86_64_relocate_section): Resolve IFUNC definition in PIE locally. ld/testsuite/ 2009-06-14 H.J. Lu PR ld/10270 * ld-ifunc/ifunc-9-x86.d: New. * ld-ifunc/ifunc-9-x86.s: Likewise. --- ld/testsuite/ld-ifunc/ifunc-9-x86.d | 3 +++ ld/testsuite/ld-ifunc/ifunc-9-x86.s | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ld/testsuite/ld-ifunc/ifunc-9-x86.d create mode 100644 ld/testsuite/ld-ifunc/ifunc-9-x86.s (limited to 'ld/testsuite/ld-ifunc') diff --git a/ld/testsuite/ld-ifunc/ifunc-9-x86.d b/ld/testsuite/ld-ifunc/ifunc-9-x86.d new file mode 100644 index 0000000..207c5d4 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-9-x86.d @@ -0,0 +1,3 @@ +#ld: --export-dynamic +#error: .*dynamic STT_GNU_IFUNC symbool `foo' with pointer equality in `.*.o' can not be used when making an executable; recompile with -fPIE and relink with -pie +#target: x86_64-*-* i?86-*-* diff --git a/ld/testsuite/ld-ifunc/ifunc-9-x86.s b/ld/testsuite/ld-ifunc/ifunc-9-x86.s new file mode 100644 index 0000000..05321e4 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-9-x86.s @@ -0,0 +1,18 @@ + .text + .type foo, %gnu_indirect_function +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + movl foo, %eax -- cgit v1.1