* ld-scripts/script.exp: Add --image-base 0 for PE targets.
authorIan Lance Taylor <ian@airs.com>
Sun, 12 Sep 1999 15:59:48 +0000 (15:59 +0000)
committerIan Lance Taylor <ian@airs.com>
Sun, 12 Sep 1999 15:59:48 +0000 (15:59 +0000)
ld/testsuite/ChangeLog
ld/testsuite/ld-scripts/script.exp

index 0bf1f59d87f3666dfef2dd4b29d4f104e6eb5b4b..9bb2008f98c86c1632a899cff5b9705409b061da 100644 (file)
@@ -1,3 +1,7 @@
+1999-09-12  Ian Lance Taylor  <ian@zembu.com>
+
+       * ld-scripts/script.exp: Add --image-base 0 for PE targets.
+
 1999-08-17  H.J. Lu  <hjl@gnu.org>
 
        * ld-cdtest/cdtest-foo.cc (Foo::init_foo): Use "%ld" for sizeof.
index fe0a04111881f33a8e290f5cff9138b412cb9bf5..9b6617412ae821bd4d4da58977e72e1b80282574 100644 (file)
@@ -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