aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-06-02 17:31:42 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-06-02 17:31:42 +0000
commit7afd84dc1f020ccc7e867f41ef49656314ec4338 (patch)
treebcfc25d5b6299556b0a4f486dcf7afee8e60d3b3 /ld
parent06c582ac9d955767b5225ddac463af30b057510d (diff)
downloadgdb-7afd84dc1f020ccc7e867f41ef49656314ec4338.zip
gdb-7afd84dc1f020ccc7e867f41ef49656314ec4338.tar.gz
gdb-7afd84dc1f020ccc7e867f41ef49656314ec4338.tar.bz2
bfd/
2009-06-02 H.J. Lu <hongjiu.lu@intel.com> * elf32-i386.c (elf_i386_check_relocs): Increment got.refcount for R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC symbol. (elf_i386_allocate_dynrelocs): Set got.refcount to 0 if local STT_GNU_IFUNC definition is used. (elf_i386_relocate_section): Handle got.offset != -1 for R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC symbol. * elf64-x86-64.c (elf64_x86_64_check_relocs): Increment got.refcount for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against STT_GNU_IFUNC symbol. (elf64_x86_64_allocate_dynrelocs): Set got.refcount to 0 if local STT_GNU_IFUNC definition is used. (elf64_x86_64_relocate_section): Handle got.offset != -1 for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against STT_GNU_IFUNC symbol. ld/testsuite/ 2009-06-02 H.J. Lu <hongjiu.lu@intel.com> * ld-ifunc/ifunc-5-i386.d: Renamed to ... * ld-ifunc/ifunc-5a-i386.d: This. * ld-ifunc/ifunc-5-x86-64.d: Renamed to ... * ld-ifunc/ifunc-5a-x86-64.d: This. * ld-ifunc/ifunc-5b-i386.d: New. * ld-ifunc/ifunc-5b-x86-64.d: Likewise. * ld-ifunc/ifunc-6a-i386.d: Likewise. * ld-ifunc/ifunc-6a-x86-64.d: Likewise. * ld-ifunc/ifunc-6b-i386.d: Likewise. * ld-ifunc/ifunc-6b-x86-64.d: Likewise. * ld-ifunc/ifunc-6-i386.s: Likewise. * ld-ifunc/ifunc-6-x86-64.s: Likewise. * ld-ifunc/ifunc-7a-i386.d: Likewise. * ld-ifunc/ifunc-7a-x86-64.d: Likewise. * ld-ifunc/ifunc-7b-i386.d: Likewise. * ld-ifunc/ifunc-7b-x86-64.d: Likewise. * ld-ifunc/ifunc-7-i386.s: Likewise. * ld-ifunc/ifunc-7-x86-64.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog23
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-5a-i386.d (renamed from ld/testsuite/ld-ifunc/ifunc-5-i386.d)5
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-5a-x86-64.d (renamed from ld/testsuite/ld-ifunc/ifunc-5-x86-64.d)5
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-5b-i386.d13
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-5b-x86-64.d12
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-6-i386.s24
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-6-x86-64.s20
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-6a-i386.d9
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-6a-x86-64.d8
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-6b-i386.d13
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-6b-x86-64.d12
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-7-i386.s24
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-7-x86-64.s20
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-7a-i386.d9
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-7a-x86-64.d8
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-7b-i386.d9
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-7b-x86-64.d8
17 files changed, 218 insertions, 4 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 03fb645..6c73acf 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,26 @@
+2009-06-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-ifunc/ifunc-5-i386.d: Renamed to ...
+ * ld-ifunc/ifunc-5a-i386.d: This.
+
+ * ld-ifunc/ifunc-5-x86-64.d: Renamed to ...
+ * ld-ifunc/ifunc-5a-x86-64.d: This.
+
+ * ld-ifunc/ifunc-5b-i386.d: New.
+ * ld-ifunc/ifunc-5b-x86-64.d: Likewise.
+ * ld-ifunc/ifunc-6a-i386.d: Likewise.
+ * ld-ifunc/ifunc-6a-x86-64.d: Likewise.
+ * ld-ifunc/ifunc-6b-i386.d: Likewise.
+ * ld-ifunc/ifunc-6b-x86-64.d: Likewise.
+ * ld-ifunc/ifunc-6-i386.s: Likewise.
+ * ld-ifunc/ifunc-6-x86-64.s: Likewise.
+ * ld-ifunc/ifunc-7a-i386.d: Likewise.
+ * ld-ifunc/ifunc-7a-x86-64.d: Likewise.
+ * ld-ifunc/ifunc-7b-i386.d: Likewise.
+ * ld-ifunc/ifunc-7b-x86-64.d: Likewise.
+ * ld-ifunc/ifunc-7-i386.s: Likewise.
+ * ld-ifunc/ifunc-7-x86-64.s: Likewise.
+
2009-06-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/10205
diff --git a/ld/testsuite/ld-ifunc/ifunc-5-i386.d b/ld/testsuite/ld-ifunc/ifunc-5a-i386.d
index eb3fc01..8fba080 100644
--- a/ld/testsuite/ld-ifunc/ifunc-5-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-5a-i386.d
@@ -1,8 +1,9 @@
+#source: ifunc-5-i386.s
#ld: -m elf_i386
#as: --32
#readelf: -r --wide
#target: x86_64-*-* i?86-*-*
-#...
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]*
-#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-5-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-5a-x86-64.d
index 84347cc..b635099 100644
--- a/ld/testsuite/ld-ifunc/ifunc-5-x86-64.d
+++ b/ld/testsuite/ld-ifunc/ifunc-5a-x86-64.d
@@ -1,7 +1,8 @@
+#source: ifunc-5-x86-64.s
#ld:
#readelf: -r --wide
#target: x86_64-*-*
-#...
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*
-#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-5b-i386.d b/ld/testsuite/ld-ifunc/ifunc-5b-i386.d
new file mode 100644
index 0000000..e00401b
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-5b-i386.d
@@ -0,0 +1,13 @@
+#source: ifunc-5-i386.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_GLOB_DAT[ ]+foo\(\)[ ]+foo
+#...
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_JUMP_SLOT[ ]+foo\(\)[ ]+foo
diff --git a/ld/testsuite/ld-ifunc/ifunc-5b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-5b-x86-64.d
new file mode 100644
index 0000000..d8b2e91
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-5b-x86-64.d
@@ -0,0 +1,12 @@
+#source: ifunc-5-x86-64.s
+#ld: -shared -z nocombreloc
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_GLOB_DAT[ ]+foo\(\)[ ]+foo \+ 0
+#...
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_JUMP_SLOT[ ]+foo\(\)[ ]+foo \+ 0
diff --git a/ld/testsuite/ld-ifunc/ifunc-6-i386.s b/ld/testsuite/ld-ifunc/ifunc-6-i386.s
new file mode 100644
index 0000000..bc632c9
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-6-i386.s
@@ -0,0 +1,24 @@
+ .text
+ .type foo, %gnu_indirect_function
+.globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .protected foo
+ .type start,"function"
+ .global start
+start:
+ .type _start,"function"
+ .global _start
+_start:
+ .type __start,"function"
+ .global __start
+__start:
+ .type __start,"function"
+ call .L6
+.L6:
+ popl %ebx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-.L6], %ebx
+ call foo@PLT
+ leal foo@GOT(%ebx), %eax
diff --git a/ld/testsuite/ld-ifunc/ifunc-6-x86-64.s b/ld/testsuite/ld-ifunc/ifunc-6-x86-64.s
new file mode 100644
index 0000000..954d67d
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-6-x86-64.s
@@ -0,0 +1,20 @@
+ .text
+ .type foo, %gnu_indirect_function
+.globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .protected foo
+ .type start,"function"
+ .global start
+start:
+ .type _start,"function"
+ .global _start
+_start:
+ .type __start,"function"
+ .global __start
+__start:
+ .type __start,"function"
+ call foo@PLT
+ movq foo@GOTPCREL(%rip), %rax
diff --git a/ld/testsuite/ld-ifunc/ifunc-6a-i386.d b/ld/testsuite/ld-ifunc/ifunc-6a-i386.d
new file mode 100644
index 0000000..a83e62b
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-6a-i386.d
@@ -0,0 +1,9 @@
+#source: ifunc-6-i386.s
+#ld: -m elf_i386
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+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-6a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-6a-x86-64.d
new file mode 100644
index 0000000..169cf1c
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-6a-x86-64.d
@@ -0,0 +1,8 @@
+#source: ifunc-6-x86-64.s
+#ld:
+#readelf: -r --wide
+#target: x86_64-*-*
+
+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-6b-i386.d b/ld/testsuite/ld-ifunc/ifunc-6b-i386.d
new file mode 100644
index 0000000..e53fc72
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-6b-i386.d
@@ -0,0 +1,13 @@
+#source: ifunc-6-i386.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_GLOB_DAT[ ]+foo\(\)[ ]+foo
+#...
+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-6b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-6b-x86-64.d
new file mode 100644
index 0000000..5a948e9
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-6b-x86-64.d
@@ -0,0 +1,12 @@
+#source: ifunc-6-x86-64.s
+#ld: -shared -z nocombreloc
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_GLOB_DAT[ ]+foo\(\)[ ]+foo \+ 0
+#...
+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-7-i386.s b/ld/testsuite/ld-ifunc/ifunc-7-i386.s
new file mode 100644
index 0000000..8616c4e
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-7-i386.s
@@ -0,0 +1,24 @@
+ .text
+ .type foo, %gnu_indirect_function
+.globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .hidden foo
+ .type start,"function"
+ .global start
+start:
+ .type _start,"function"
+ .global _start
+_start:
+ .type __start,"function"
+ .global __start
+__start:
+ .type __start,"function"
+ call .L6
+.L6:
+ popl %ebx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-.L6], %ebx
+ call foo@PLT
+ leal foo@GOT(%ebx), %eax
diff --git a/ld/testsuite/ld-ifunc/ifunc-7-x86-64.s b/ld/testsuite/ld-ifunc/ifunc-7-x86-64.s
new file mode 100644
index 0000000..24fce11
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-7-x86-64.s
@@ -0,0 +1,20 @@
+ .text
+ .type foo, %gnu_indirect_function
+.globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .hidden foo
+ .type start,"function"
+ .global start
+start:
+ .type _start,"function"
+ .global _start
+_start:
+ .type __start,"function"
+ .global __start
+__start:
+ .type __start,"function"
+ call foo@PLT
+ movq foo@GOTPCREL(%rip), %rax
diff --git a/ld/testsuite/ld-ifunc/ifunc-7a-i386.d b/ld/testsuite/ld-ifunc/ifunc-7a-i386.d
new file mode 100644
index 0000000..6b4afe1
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-7a-i386.d
@@ -0,0 +1,9 @@
+#source: ifunc-7-i386.s
+#ld: -m elf_i386
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+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-7a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-7a-x86-64.d
new file mode 100644
index 0000000..350614a
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-7a-x86-64.d
@@ -0,0 +1,8 @@
+#source: ifunc-7-x86-64.s
+#ld:
+#readelf: -r --wide
+#target: x86_64-*-*
+
+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-7b-i386.d b/ld/testsuite/ld-ifunc/ifunc-7b-i386.d
new file mode 100644
index 0000000..31cdd97
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-7b-i386.d
@@ -0,0 +1,9 @@
+#source: ifunc-7-i386.s
+#ld: -shared -m elf_i386
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+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-7b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-7b-x86-64.d
new file mode 100644
index 0000000..cd66d58
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-7b-x86-64.d
@@ -0,0 +1,8 @@
+#source: ifunc-7-x86-64.s
+#ld: -shared
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]*