summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-05-28 08:15:06 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-05-28 08:15:21 -0700
commitac98f9e2275ffcca560eaa0bddd282a1ff94fc28 (patch)
tree93151266d6d6817f64ef156a6dc3c523a206d4d2 /ld
parent03fce1c78c01a9b0e30e91be60e7af717a10bb2c (diff)
downloadbinutils-gdb-ac98f9e2275ffcca560eaa0bddd282a1ff94fc28.tar.gz
ld: Unify STT_GNU_IFUNC handling
Take STT_GNU_IFUNC handling scattered across targets and gather it in the generic ELF linker. bfd/ PR ld/23238 * elf-s390-common.c (elf_s390_add_symbol_hook): Removed. * elf32-arc.c (elf_arc_add_symbol_hook): Likewise. (elf_backend_add_symbol_hook): Likewise. * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise. (elf_backend_add_symbol_hook): Likewise. * elf32-s390.c (elf_backend_add_symbol_hook): Likewise. * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. (elf_backend_add_symbol_hook): Likewise. * elf64-s390.c (elf_backend_add_symbol_hook): Likewise. * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise. * elfxx-aarch64.h (_bfd_aarch64_elf_add_symbol_hook): Likewise. (elf_backend_add_symbol_hook): Likewise. * elf32-arm.c (elf32_arm_add_symbol_hook): Remove STT_GNU_IFUNC handling. * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. * elflink.c (elf_link_add_object_symbols): Set elf_gnu_symbol_ifunc for STT_GNU_IFUNC symbols. ld/ PR ld/23238 * testsuite/ld-ifunc/ifunc-26.d: New file. * testsuite/ld-ifunc/ifunc-26.s: Likewise. * testsuite/ld-ifunc/ifunc.exp: Run *.d tests without a working compiler.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-26.d7
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-26.s8
-rw-r--r--ld/testsuite/ld-ifunc/ifunc.exp14
4 files changed, 30 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 0d6bf36c0db..c49ce46dd59 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,13 @@
2018-05-28 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/23238
+ * testsuite/ld-ifunc/ifunc-26.d: New file.
+ * testsuite/ld-ifunc/ifunc-26.s: Likewise.
+ * testsuite/ld-ifunc/ifunc.exp: Run *.d tests without a
+ working compiler.
+
+2018-05-28 H.J. Lu <hongjiu.lu@intel.com>
+
* testsuite/ld-ifunc/ifunc-10-i386.d: Skip NaCl targets.
* testsuite/ld-ifunc/ifunc-10-x86-64.d: Likewise.
* testsuite/ld-ifunc/ifunc-11-i386.d: Likewise.
diff --git a/ld/testsuite/ld-ifunc/ifunc-26.d b/ld/testsuite/ld-ifunc/ifunc-26.d
new file mode 100644
index 00000000000..3b1e9f167ac
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-26.d
@@ -0,0 +1,7 @@
+#ld: -shared
+#readelf: -h
+
+ELF Header:
+#...
+ OS/ABI: UNIX - GNU
+#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-26.s b/ld/testsuite/ld-ifunc/ifunc-26.s
new file mode 100644
index 00000000000..2b18d9bc81f
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-26.s
@@ -0,0 +1,8 @@
+ .text
+ .type resolve_do_it, %function
+resolve_do_it:
+ .byte 0
+ .size resolve_do_it, .-resolve_do_it
+ .globl do_it
+ .type do_it, %gnu_indirect_function
+ .set do_it,resolve_do_it
diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
index 9f4aa73e7a7..dd3abd475ae 100644
--- a/ld/testsuite/ld-ifunc/ifunc.exp
+++ b/ld/testsuite/ld-ifunc/ifunc.exp
@@ -48,6 +48,13 @@ if ![check_shared_lib_support] {
# This test does not need a compiler...
run_dump_test "ifuncmod5"
+set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+foreach t $test_list {
+ # We need to strip the ".d", but can leave the dirname.
+ verbose [file rootname $t]
+ run_dump_test [file rootname $t]
+}
+
# We need a working compiler. (Strictly speaking this is
# not true, we could use target specific assembler files).
if { [which $CC] == 0 } {
@@ -425,13 +432,6 @@ run_ld_link_exec_tests [list \
] \
]
-set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
-foreach t $test_list {
- # We need to strip the ".d", but can leave the dirname.
- verbose [file rootname $t]
- run_dump_test [file rootname $t]
-}
-
# Run-time tests which require working IFUNC support.
if { ![check_ifunc_available] } {
return