aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib
diff options
context:
space:
mode:
authorJie Zhang <jie@codesourcery.com>2010-10-15 06:53:42 +0000
committerJie Zhang <jiez@gcc.gnu.org>2010-10-15 06:53:42 +0000
commitaf41386e7c41d4c76b75ea87acd4b3c0479143fe (patch)
tree47842fecf27aa964d7b79c1dc3d7ba644e371182 /gcc/testsuite/lib
parent56f01f0b417d3291b5915d449dc327be23911638 (diff)
downloadgcc-af41386e7c41d4c76b75ea87acd4b3c0479143fe.zip
gcc-af41386e7c41d4c76b75ea87acd4b3c0479143fe.tar.gz
gcc-af41386e7c41d4c76b75ea87acd4b3c0479143fe.tar.bz2
lto.exp (lto-link-and-maybe-run): Use the default linker script when relocatable linking.
* lib/lto.exp (lto-link-and-maybe-run): Use the default linker script when relocatable linking. From-SVN: r165494
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r--gcc/testsuite/lib/lto.exp20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp
index 30b6f06..57c7a2e 100644
--- a/gcc/testsuite/lib/lto.exp
+++ b/gcc/testsuite/lib/lto.exp
@@ -163,6 +163,7 @@ proc lto-link-and-maybe-run { testname objlist dest optall optfile optstr } {
global testcase
global tool
global compile_type
+ global board_info
# Check that all of the objects were built successfully.
foreach obj [split $objlist] {
@@ -177,10 +178,29 @@ proc lto-link-and-maybe-run { testname objlist dest optall optfile optstr } {
set options ""
lappend options "additional_flags=$optall $optfile"
+ set target_board [target_info name]
+ set relocatable 0
+
+ # Some LTO tests do relocatable linking. Some target boards set
+ # a linker script which can't be used for relocatable linking.
+ # Use the default linker script instead.
+ if { [lsearch -exact [split "$optall $optfile"] "-r"] >= 0 } {
+ set relocatable 1
+ }
+
+ if { $relocatable } {
+ set saved_ldscript [board_info $target_board ldscript]
+ set board_info($target_board,ldscript) ""
+ }
+
# Link the objects into an executable.
set comp_output [${tool}_target_compile "$objlist" $dest executable \
"$options"]
+ if { $relocatable } {
+ set board_info($target_board,ldscript) $saved_ldscript
+ }
+
# Prune unimportant visibility warnings before checking output.
set comp_output [lto_prune_warns $comp_output]