aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/script.exp15
1 files changed, 13 insertions, 2 deletions
diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp
index fe0a041..9b66174 100644
--- a/ld/testsuite/ld-scripts/script.exp
+++ b/ld/testsuite/ld-scripts/script.exp
@@ -49,7 +49,18 @@ proc check_script { } {
}
}
-if ![ld_simple_link $ld tmpdir/script "-T $srcdir/$subdir/script.t tmpdir/script.o"] {
+# PE targets need to set the image base to 0 to avoid complications from nm.
+set flags ""
+if {[istarget "*-*-pe*"] \
+ || [istarget "*-*-cygwin*"] \
+ || [istarget "*-*-mingw32*"] \
+ || [istarget "*-*-winnt*"] \
+ || [istarget "*-*-nt*"] \
+ || [istarget "*-*-interix*"] } then {
+ set flags "--image-base 0"
+}
+
+if ![ld_simple_link $ld tmpdir/script "$flags -T $srcdir/$subdir/script.t tmpdir/script.o"] {
fail $testname
} else {
check_script
@@ -57,7 +68,7 @@ if ![ld_simple_link $ld tmpdir/script "-T $srcdir/$subdir/script.t tmpdir/script
set testname "MRI script"
-if ![ld_simple_link $ld tmpdir/script "-c $srcdir/$subdir/scriptm.t"] {
+if ![ld_simple_link $ld tmpdir/script "$flags -c $srcdir/$subdir/scriptm.t"] {
fail $testname
} else {
check_script