blob: 2ad7e69681b4559e24b43aa24708d3a895a6ec99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
2010-10-15 Jie Zhang <jie@codesourcery.com>
Backport from mainline:
gcc/testsuite/
2010-10-15 Jie Zhang <jie@codesourcery.com>
* lib/lto.exp (lto-link-and-maybe-run): Use the default linker
script when relocatable linking.
=== modified file 'gcc/testsuite/lib/lto.exp'
Index: gcc-4.5/gcc/testsuite/lib/lto.exp
===================================================================
--- gcc-4.5.orig/gcc/testsuite/lib/lto.exp
+++ gcc-4.5/gcc/testsuite/lib/lto.exp
@@ -156,6 +156,7 @@ proc lto-link-and-maybe-run { testname o
global testcase
global tool
global compile_type
+ global board_info
# Check that all of the objects were built successfully.
foreach obj [split $objlist] {
@@ -170,10 +171,29 @@ proc lto-link-and-maybe-run { testname o
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]
|