aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-02-06 04:25:36 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-02-06 04:29:35 -0800
commit9e2dec471006de3e0489a34fbeb922fee1e302af (patch)
tree7ab3bd6dbab46c47b980a09d16592ea6b12326ea /ld/testsuite/ld-plugin
parente584fdbc6a9b0da786c5a55855f9fd9f7e676198 (diff)
Properly mark the plugin symbol undefined
Mark the unused plugin defined symbol in elf_link_input_bfd instead of _bfd_elf_fix_symbol_flags. Limit the PR ld/12365 test to x86 targets. bfd/ PR ld/12365 PR ld/14272 * elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change. (elf_link_input_bfd): Mark the plugin symbol undefined if it is referenced from a non-IR file. ld/testsuite/ PR ld/12365 PR ld/14272 * ld-plugin/lto.exp: Run the PR ld/12365 test only for x86 targets. * ld-plugin/plugin-7.d: Updated. * ld-plugin/plugin-8.d: Likewise.
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp23
-rw-r--r--ld/testsuite/ld-plugin/plugin-7.d3
-rw-r--r--ld/testsuite/ld-plugin/plugin-8.d3
3 files changed, 21 insertions, 8 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 065e1bbcd0..6d9500bcf7 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -383,12 +383,23 @@ if {![string match "" $catch_output]} {
if { [at_least_gcc_version 4 7] } {
# Check expected LTO linker errors.
- set testname "PR ld/12365"
- set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
- if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } {
- pass $testname
- } {
- fail $testname
+ # Since the asm symbol name hack in pr12365b.c doesn't work on all
+ # targets, run PR ld/12365 tests only for known targets.
+ if { ([istarget "i?86-*-elf*"]
+ || (([istarget "i?86-*-linux*"] || [istarget "i?86-*-gnu*"])
+ && ![istarget "*-*-*aout*"]
+ && ![istarget "*-*-*oldld*"])
+ || [istarget "i?86-*-nacl*"]
+ || [istarget "x86_64-*-nacl*"]
+ || [istarget "x86_64-*-linux*"]
+ || [istarget "amd64-*-linux*"]) } {
+ set testname "PR ld/12365"
+ set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
+ if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } {
+ pass $testname
+ } {
+ fail $testname
+ }
}
set testname "PR ld/12942 (3)"
set exec_output [run_host_cmd "$CXX" "-O2 -flto -fuse-linker-plugin tmpdir/pr12942b.o tmpdir/pr12942a.o"]
diff --git a/ld/testsuite/ld-plugin/plugin-7.d b/ld/testsuite/ld-plugin/plugin-7.d
index 28a7036c72..d1c159c4f3 100644
--- a/ld/testsuite/ld-plugin/plugin-7.d
+++ b/ld/testsuite/ld-plugin/plugin-7.d
@@ -28,6 +28,7 @@ hook called: claim_file tmpdir/func.o \[@0/.* CLAIMED
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-`_?func' referenced in section `\.text.*' of tmpdir/main.o: defined in discarded section .*
+tmpdir/main.o: In function `main':
+.*main.c.*: undefined reference to `func'
hook called: cleanup.
#...
diff --git a/ld/testsuite/ld-plugin/plugin-8.d b/ld/testsuite/ld-plugin/plugin-8.d
index 8170b542c9..2c7a15b241 100644
--- a/ld/testsuite/ld-plugin/plugin-8.d
+++ b/ld/testsuite/ld-plugin/plugin-8.d
@@ -32,6 +32,7 @@ hook called: claim_file tmpdir/text.o \[@0/.* not claimed
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
-`_?func' referenced in section `\.text.*' of tmpdir/main.o: defined in discarded section .*
+tmpdir/main.o: In function `main':
+.*main.c.*: undefined reference to `func'
hook called: cleanup.
#...