aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-03-01 12:39:49 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-03-01 12:45:18 -0800
commitef621b15e0b14f8fc0dc5940bc6b14a9aaa40ea3 (patch)
tree9bffb4865dd62f69581799ba8a5feb38b0426460 /ld/testsuite/ld-plugin
parent86e501afd46d7f0d31738bd62457593401d79bad (diff)
downloadgdb-ef621b15e0b14f8fc0dc5940bc6b14a9aaa40ea3.zip
gdb-ef621b15e0b14f8fc0dc5940bc6b14a9aaa40ea3.tar.gz
gdb-ef621b15e0b14f8fc0dc5940bc6b14a9aaa40ea3.tar.bz2
Update PR ld/12365 test for GCC 6
PR ld/12365 test is to verify that linker catches the reference to undefined symbol error caused by a GCC bug. Since the GCC bug has been fixed in GCC 6, update the test to verify that there is no reference to undefined symbol in executable * testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp13
1 files changed, 12 insertions, 1 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 7bf67ec..6330a17 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -408,9 +408,20 @@ if { [at_least_gcc_version 4 7] } {
|| [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"]
+ set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin -o tmpdir/pr12365 tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } {
+ # Linker should catch the reference to undefined `my_bcopy'
+ # error caused by a GCC bug.
pass $testname
+ } elseif { [ string match "" $exec_output ] } {
+ global READELF
+ set exec_output [run_host_cmd "$READELF" "-s -W tmpdir/pr12365"]
+ if { [ regexp "my_bcopy" $exec_output ] } {
+ # Verify that there is no `my_bcopy' symbol in executable.
+ fail $testname
+ } {
+ pass $testname
+ }
} {
fail $testname
}