+2020-07-07 Alan Modra <amodra@gmail.com>
+
+ * testsuite/ld-scripts/align.exp: Use is_pecoff_format.
+ * testsuite/ld-scripts/defined.exp: Likewise.
+ * testsuite/ld-scripts/provide.exp: Likewise.
+ * testsuite/ld-scripts/weak.exp: Likewise.
+ * testsuite/ld-scripts/empty-address.exp: Likewise. Reset LDFLAGS
+ on exit.
+ * testsuite/ld-scripts/expr.exp: Set LDFLAGS earlier, and with
+ --image-base for PE.
+ * testsuite/ld-scripts/include.exp: Set LDFLAGS for PE.
+ * testsuite/ld-scripts/script.exp: Use is_pecoff_format, and
+ set LDFLAGS as well as flags.
+
2020-07-07 Alan Modra <amodra@gmail.com>
* testsuite/ld-checks/checks.exp: Use is_xcoff_format.
return
}
-# mingw on x86_64 targets need to set the image base to 0 to avoid auto image-basing.
+# Avoid auto image-basing.
set saved_LDFLAGS "$LDFLAGS"
-if [istarget "x86_64-*-mingw*"] then {
- set LDFLAGS "$LDFLAGS --image-base 0"
+if { [is_pecoff_format] } then {
+ set LDFLAGS "$LDFLAGS --image-base 0"
}
if ![ld_link $ld tmpdir/align "$LDFLAGS -T $srcdir/$subdir/align.t tmpdir/align.o"] {
}
set saved_LDFLAGS "$LDFLAGS"
-if [istarget "x86_64-*-mingw*"] then {
- set LDFLAGS "$LDFLAGS --image-base 0"
+if { [is_pecoff_format] } then {
+ set LDFLAGS "$LDFLAGS --image-base 0"
}
if { ![ld_link $ld tmpdir/def "$LDFLAGS -T $srcdir/$subdir/defined.t tmpdir/def.o"] } {
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
-if [istarget "x86_64-*-mingw*"] then {
- set LDFLAGS "$LDFLAGS --image-base 0"
+set old_LDFLAGS $LDFLAGS
+if { [is_pecoff_format] } then {
+ set LDFLAGS "$LDFLAGS --image-base 0"
}
run_dump_test empty-address-1
run_dump_test empty-address-3a
run_dump_test empty-address-3b
run_dump_test empty-address-3c
+
+set LDFLAGS $old_LDFLAGS
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
+set old_LDFLAGS $LDFLAGS
+if { [istarget spu*-*-*] } then {
+ set LDFLAGS "$LDFLAGS --no-overlays --local-store 0:0"
+} elseif { [is_pecoff_format] } then {
+ set LDFLAGS "$LDFLAGS --image-base 0"
+}
+
run_dump_test expr1
run_dump_test expr2
run_dump_test sane1
run_dump_test assign-loc
run_dump_test pr14962
run_dump_test pr14962-2
+run_dump_test pr18963
run_dump_test pr22267
-set old_ldflags $LDFLAGS
-if { [istarget spu*-*-*] } {
- set LDFLAGS "$LDFLAGS --no-overlays --local-store 0:0"
-}
-run_dump_test pr18963
-set LDFLAGS $old_ldflags
+set LDFLAGS $old_LDFLAGS
}
set old_ldflags $LDFLAGS
-if { [istarget spu*-*-*] } {
+if { [istarget spu*-*-*] } then {
set LDFLAGS "$LDFLAGS --local-store 0:0 --no-overlays"
+} elseif { [is_pecoff_format] } then {
+ set LDFLAGS "$LDFLAGS --image-base 0"
}
set test_list [lsort [glob -nocomplain $srcdir/$subdir/include*.d]]
}
set saved_LDFLAGS "$LDFLAGS"
-if [istarget "x86_64-*-mingw*"] then {
- set LDFLAGS "$LDFLAGS --image-base 0"
+if { [is_pecoff_format] } then {
+ set LDFLAGS "$LDFLAGS --image-base 0"
}
set test_list [lsort [glob -nocomplain $srcdir/$subdir/provide-*.d]]
# PE targets need to set the image base to 0 to avoid complications from nm.
set flags ""
-if {[istarget "*-*-pe*"] \
- || [istarget "*-*-cygwin*"] \
- || [istarget "*-*-mingw*"] \
- || [istarget "*-*-winnt*"] \
- || [istarget "*-*-nt"] \
- || [istarget "*-*-interix*"] } then {
- set flags "--image-base 0"
+set old_LDFLAGS $LDFLAGS
+if { [is_pecoff_format] } then {
+ set flags "--image-base 0"
+ set LDFLAGS "$LDFLAGS --image-base 0"
}
if ![ld_link $ld tmpdir/script "$flags -T $srcdir/$subdir/script.t tmpdir/script.o"] {
run_dump_test "segment-start" {{name (default)}}
run_dump_test "segment-start" {{name (overridden)} \
{ld -Ttext-segment=0x10000000}}
+
+set LDFLAGS $old_LDFLAGS
}
set saved_LDFLAGS "$LDFLAGS"
-if [istarget "x86_64-*-mingw*"] then {
- set LDFLAGS "$LDFLAGS --image-base 0"
+if { [is_pecoff_format] } then {
+ set LDFLAGS "$LDFLAGS --image-base 0"
}
set weak_regexp_big \