diff options
author | Alan Modra <amodra@gmail.com> | 2014-07-05 12:05:01 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-07-08 10:01:47 +0930 |
commit | 37a6ac445daf5075d9058d7f01505f96a43f592a (patch) | |
tree | 4819c6e916a40f21a2f267eaedc8b3c998424435 /ld | |
parent | e29c73ebde63ce95bfbb4be28eb797b55c8e3842 (diff) | |
download | gdb-37a6ac445daf5075d9058d7f01505f96a43f592a.zip gdb-37a6ac445daf5075d9058d7f01505f96a43f592a.tar.gz gdb-37a6ac445daf5075d9058d7f01505f96a43f592a.tar.bz2 |
Run ar with --plugin for LTO 11 test
Objects built with -fno-fat-lto-objects (the default for gcc-4.9) have
no normal symbols, except things like __gnu_lto_slim. These useless
symbols are the ones put into the archive index, and of course nothing
references them so no objects are extracted by the linker. Running
ar with --plugin changes ar behaviour to put the lto symbols into the
archive index.
PR 17112
* ld-plugin/lto.exp: When building liblti-11.a, pass
--plugin path_to_gcc/liblto_plugin.so to ar.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 1925fed..50a1b8a 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-07-08 Alan Modra <amodra@gmail.com> + + PR 17112 + * ld-plugin/lto.exp: When building liblti-11.a, pass + --plugin path_to_gcc/liblto_plugin.so to ar. + 2014-07-07 Alan Modra <amodra@gmail.com> * lib/ld-lib.exp (check_lto_shared_available): Reinstate compiler diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index b14f13c..765d85f8 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -324,7 +324,20 @@ if { [is_elf_format] && [check_lto_shared_available] } { set testname "Build liblto-11.a" remote_file host delete "tmpdir/liblto-11.a" -set catch_output [run_host_cmd "$ar" "rc tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] +set plugin_names { + liblto_plugin.so + liblto_plugin-0.dll + cyglto_plugin-0.dll +} +set plug_opt "" +foreach plug $plugin_names { + set plug_so [run_host_cmd $CC "--print-prog-name $plug"] + if { $plug_so ne $plug } then { + set plug_opt "--plugin $plug_so" + break + } +} +set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] if {![string match "" $catch_output]} { unresolved $testname restore_notify |