aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386/pr20244-3d.S
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-06-13 11:06:10 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-06-13 11:11:23 -0700
commit712ec27916b5604d29d928dec060fd1ba0fd9edb (patch)
tree221a14aa497e282aad40ccacf3bd8abbe30a9de8 /ld/testsuite/ld-i386/pr20244-3d.S
parentca8c86efe7765262e25ebb08004012ba2fdadf52 (diff)
downloadgdb-712ec27916b5604d29d928dec060fd1ba0fd9edb.zip
gdb-712ec27916b5604d29d928dec060fd1ba0fd9edb.tar.gz
gdb-712ec27916b5604d29d928dec060fd1ba0fd9edb.tar.bz2
Add the GOT base for GOT32 relocs against IFUNC
Add the GOT base for R_386_GOT32/R_386_GOT32X relocations against IFUNC symbols if there is no base register and disallow them for PIC. bfd/ PR ld/20244 * elf32-i386.c (elf_i386_relocate_section): Add the .got.plt section address for R_386_GOT32/R_386_GOT32X relocations against IFUNC symbols if there is no base register and return error for PIC. ld/ PR ld/20244 * testsuite/ld-i386/i386.exp: Run pr20244-2a, pr20244-2b, pr20244-2c and pr20244-2d. * testsuite/ld-i386/no-plt.exp: Run pr20244-3a and pr20244-3b. * testsuite/ld-i386/pr20244-2.s: New file. * testsuite/ld-i386/pr20244-2a.d: Likewise. * testsuite/ld-i386/pr20244-2b.d: Likewise. * testsuite/ld-i386/pr20244-2c.d: Likewise. * testsuite/ld-i386/pr20244-2d.d: Likewise. * testsuite/ld-i386/pr20244-3a.c: Likewise. * testsuite/ld-i386/pr20244-3b.S: Likewise. * testsuite/ld-i386/pr20244-3c.S: Likewise. * testsuite/ld-i386/pr20244-3d.S: Likewise.
Diffstat (limited to 'ld/testsuite/ld-i386/pr20244-3d.S')
-rw-r--r--ld/testsuite/ld-i386/pr20244-3d.S44
1 files changed, 44 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/pr20244-3d.S b/ld/testsuite/ld-i386/pr20244-3d.S
new file mode 100644
index 0000000..a57f3fc
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr20244-3d.S
@@ -0,0 +1,44 @@
+ .text
+ .p2align 4,,15
+ .type implementation1, @function
+implementation1:
+ movl $1, %eax
+ ret
+ .size implementation1, .-implementation1
+ .p2align 4,,15
+ .type implementation2, @function
+implementation2:
+ movl $2, %eax
+ ret
+ .size implementation2, .-implementation2
+ .p2align 4,,15
+ .type resolver2, @function
+resolver2:
+ movl implementation2@GOT, %eax
+ ret
+ .size resolver2, .-resolver2
+ .type func2, @gnu_indirect_function
+ .set func2,resolver2
+ .p2align 4,,15
+ .type resolver1, @function
+resolver1:
+ movl implementation1@GOT, %eax
+ ret
+ .size resolver1, .-resolver1
+ .globl func1
+ .type func1, @gnu_indirect_function
+ .set func1,resolver1
+ .p2align 4,,15
+ .globl get_func2
+ .type get_func2, @function
+get_func2:
+ movl func2@GOT, %eax
+ ret
+ .size get_func2, .-get_func2
+ .p2align 4,,15
+ .globl call_func2
+ .type call_func2, @function
+call_func2:
+ jmp *func2@GOT
+ .size call_func2, .-call_func2
+ .section .note.GNU-stack,"",@progbits