summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-ifunc
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-12-16 20:31:00 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-12-16 20:31:00 +0000
commitc3eb05c329ae3e677edcb6b671b310403365fed0 (patch)
treeb685212c94c8e52125ff0fef54f63ea601b8b388 /ld/testsuite/ld-ifunc
parent7c102198e4a1ecee9cf175bd4ad87ee435956cae (diff)
downloadbinutils-redhat-c3eb05c329ae3e677edcb6b671b310403365fed0.tar.gz
Also check local IFUNC references
bfd/ PR ld/14968 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Also check local IFUNC references. * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise. ld/testsuite/ PR ld/14968 * ld-ifunc/ifunc-18a-i386.d: New file. * ld-ifunc/ifunc-18a-x86-64.d: Likewise. * ld-ifunc/ifunc-18a.s: Likewise. * ld-ifunc/ifunc-18b-i386.d: Likewise. * ld-ifunc/ifunc-18b-x86-64.d: Likewise. * ld-ifunc/ifunc-18b.s: Likewise. * ld-ifunc/ifunc-19a-i386.d: Likewise. * ld-ifunc/ifunc-19a-x86-64.d: Likewise. * ld-ifunc/ifunc-19a.s: Likewise. * ld-ifunc/ifunc-19b-i386.d: Likewise. * ld-ifunc/ifunc-19b-x86-64.d: Likewise. * ld-ifunc/ifunc-19b.s: Likewise.
Diffstat (limited to 'ld/testsuite/ld-ifunc')
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-18a-i386.d15
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d15
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-18a.s5
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-18b-i386.d15
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d15
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-18b.s15
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-19a-i386.d14
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d14
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-19a.s5
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-19b-i386.d14
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d14
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-19b.s15
12 files changed, 156 insertions, 0 deletions
diff --git a/ld/testsuite/ld-ifunc/ifunc-18a-i386.d b/ld/testsuite/ld-ifunc/ifunc-18a-i386.d
new file mode 100644
index 0000000000..10490b112b
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-18a-i386.d
@@ -0,0 +1,15 @@
+#source: ifunc-18a.s
+#source: ifunc-18b.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
+
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d
new file mode 100644
index 0000000000..0d600eb382
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d
@@ -0,0 +1,15 @@
+#source: ifunc-18a.s
+#source: ifunc-18b.s
+#as: --64
+#ld: -shared -melf_x86_64 -z nocombreloc
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
+
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-18a.s b/ld/testsuite/ld-ifunc/ifunc-18a.s
new file mode 100644
index 0000000000..c29c121c23
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-18a.s
@@ -0,0 +1,5 @@
+ .section .data.rel,"aw",@progbits
+ .globl foo_ptrt
+ .type foo_ptr, @object
+foo_ptr:
+ .dc.a foo
diff --git a/ld/testsuite/ld-ifunc/ifunc-18b-i386.d b/ld/testsuite/ld-ifunc/ifunc-18b-i386.d
new file mode 100644
index 0000000000..a5eda9495a
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-18b-i386.d
@@ -0,0 +1,15 @@
+#source: ifunc-18b.s
+#source: ifunc-18a.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
+
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d
new file mode 100644
index 0000000000..8dfebfb8e9
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d
@@ -0,0 +1,15 @@
+#source: ifunc-18b.s
+#source: ifunc-18a.s
+#as: --64
+#ld: -shared -melf_x86_64 -z nocombreloc
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
+
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-18b.s b/ld/testsuite/ld-ifunc/ifunc-18b.s
new file mode 100644
index 0000000000..fece413189
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-18b.s
@@ -0,0 +1,15 @@
+ .text
+ .type foo, %gnu_indirect_function
+ .hidden foo
+ .globl foo
+foo:
+ ret
+ .size foo, .-foo
+ .globl bar
+bar:
+ jmp foo1@PLT
+ ret
+ .size bar, .-bar
+ .hidden foo1
+ .globl foo1
+ foo1 = foo
diff --git a/ld/testsuite/ld-ifunc/ifunc-19a-i386.d b/ld/testsuite/ld-ifunc/ifunc-19a-i386.d
new file mode 100644
index 0000000000..8319bfc74c
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-19a-i386.d
@@ -0,0 +1,14 @@
+#source: ifunc-19a.s
+#source: ifunc-19b.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
+
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d
new file mode 100644
index 0000000000..fe576d2d33
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d
@@ -0,0 +1,14 @@
+#source: ifunc-19a.s
+#source: ifunc-19b.s
+#as: --64
+#ld: -shared -melf_x86_64 -z nocombreloc
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
+
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-19a.s b/ld/testsuite/ld-ifunc/ifunc-19a.s
new file mode 100644
index 0000000000..3a3d0cd668
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-19a.s
@@ -0,0 +1,5 @@
+ .section .data.rel,"aw",@progbits
+ .globl foo_ptrt
+ .type foo_ptr, @object
+foo_ptr:
+ .dc.a foo1
diff --git a/ld/testsuite/ld-ifunc/ifunc-19b-i386.d b/ld/testsuite/ld-ifunc/ifunc-19b-i386.d
new file mode 100644
index 0000000000..5bb81706aa
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-19b-i386.d
@@ -0,0 +1,14 @@
+#source: ifunc-19b.s
+#source: ifunc-19a.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
+
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d
new file mode 100644
index 0000000000..35fa3285fd
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d
@@ -0,0 +1,14 @@
+#source: ifunc-19b.s
+#source: ifunc-19a.s
+#as: --64
+#ld: -shared -melf_x86_64 -z nocombreloc
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
+
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
diff --git a/ld/testsuite/ld-ifunc/ifunc-19b.s b/ld/testsuite/ld-ifunc/ifunc-19b.s
new file mode 100644
index 0000000000..fece413189
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-19b.s
@@ -0,0 +1,15 @@
+ .text
+ .type foo, %gnu_indirect_function
+ .hidden foo
+ .globl foo
+foo:
+ ret
+ .size foo, .-foo
+ .globl bar
+bar:
+ jmp foo1@PLT
+ ret
+ .size bar, .-bar
+ .hidden foo1
+ .globl foo1
+ foo1 = foo