summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-03-07 10:51:47 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-02-10 19:06:50 -0800
commit5b664463d5f0c161ef75eb980281e202fd086b4b (patch)
treeb1b2eb5381a72ddb168b0e1b1334af02781eec27
parentcade121748779c28bb7483edf8aeb31b2fd787f4 (diff)
downloadbinutils-gdb-5b664463d5f0c161ef75eb980281e202fd086b4b.tar.gz
Add test for nm on mixed LTO/non-LTO object
-rw-r--r--ChangeLog.lto-mixed4
-rw-r--r--ld/testsuite/ld-plugin/lto.exp12
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog.lto-mixed b/ChangeLog.lto-mixed
index b3c1659dce2..246511ed022 100644
--- a/ChangeLog.lto-mixed
+++ b/ChangeLog.lto-mixed
@@ -258,6 +258,10 @@ ld/
ld/testsuite/
+2014-03-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-plugin/lto.exp: Add test for nm on mixed LTO/non-LTO object.
+
2011-01-22 H.J. Lu <hongjiu.lu@intel.com>
PR ld/12430
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index e8cd630bf42..8052131565b 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -461,6 +461,18 @@ run_dump_test "lto-5r"
remote_exec host "mv" "tmpdir/dump tmpdir/lto-5.o"
run_dump_test "lto-10r"
remote_exec host "mv" "tmpdir/dump tmpdir/lto-10.o"
+set testname "nm mixed object"
+set lto_plugin [run_host_cmd "$CC" "-print-prog-name=liblto_plugin.so tmpdir/lto-10.o"]
+if { [ regexp "liblto_plugin.so" $lto_plugin ] } {
+ set exec_output [run_host_cmd "$NM" "--plugin $lto_plugin tmpdir/lto-10.o"]
+ if { [ regexp "T main" $exec_output ] } {
+ pass $testname
+ } {
+ fail $testname
+ }
+} {
+ fail $testname
+ }
run_cc_link_tests $lto_link_symbol_tests