diff options
Diffstat (limited to 'ld/testsuite/ld-gc/gc.exp')
-rw-r--r-- | ld/testsuite/ld-gc/gc.exp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp index cd5c6f7..298f2d4 100644 --- a/ld/testsuite/ld-gc/gc.exp +++ b/ld/testsuite/ld-gc/gc.exp @@ -54,6 +54,9 @@ proc test_gc { testname filename linker ldflags} { set outfile "tmpdir/$filename" set options "-L$srcdir/$subdir" + if [is_pecoff_format] { + append ldflags " --image-base 0" + } append options " " $ldflags " " [ld_link_defsyms] " " $objfile if ![ld_link $linker $outfile $options] { @@ -86,9 +89,13 @@ test_gc "Check --gc-section/-q" "gcrexe" $ld "--gc-sections -q -e main" test_gc "Check --gc-section/-r/-e" "gcrel" $ld "-r --gc-sections -e main" test_gc "Check --gc-section/-r/-u" "gcrel" $ld "-r --gc-sections -u used_func" +set old_ldflags $LDFLAGS +if [is_pecoff_format] { + append LDFLAGS " --image-base 0" +} set old_asflags $ASFLAGS if [is_underscore_target] { - set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1" + append ASFLAGS " --defsym UNDERSCORE=1" } run_dump_test "noent" @@ -111,7 +118,7 @@ if { [is_elf_format] && [check_shared_lib_support] } then { set gasopt "-mpic -mpid=near" } # These targets do not default to linking with shared libraries. - set old_ldflags $LDFLAGS + set save_ldflags $LDFLAGS if { [istarget "mips*vr4100*-*-elf*"] \ || [istarget "mips*vr4300*-*-elf*"] \ || [istarget "mips*vr5000*-*-elf*"] } { @@ -130,7 +137,7 @@ if { [is_elf_format] && [check_shared_lib_support] } then { } else { run_dump_test "pr20022" } - set LDFLAGS $old_ldflags + set LDFLAGS $save_ldflags } if { [check_compiler_available] } { @@ -144,25 +151,28 @@ if { [check_compiler_available] } { } } +set symdefs "" +if [is_pecoff_format] { + set symdefs {{ld {--defsym __main=main --defsym ___main=main}}} +} + if { [check_compiler_available] } { - ld_compile "$CC $CFLAGS $cflags" $srcdir/$subdir/pr13683.c tmpdir/pr13683.o - run_dump_test "pr13683" + ld_compile "$CC $CFLAGS $cflags" $srcdir/$subdir/pr13683.c tmpdir/pr13683.o + run_dump_test "pr13683" $symdefs } if { [check_compiler_available] } { ld_compile "$CC $CFLAGS $cflags $NOPIE_CFLAGS" $srcdir/$subdir/pr14265.c tmpdir/pr14265.o - run_dump_test "pr14265" + run_dump_test "pr14265" $symdefs } if { [check_compiler_available] } { ld_compile "$CC $CFLAGS $cflags -O0" $srcdir/$subdir/pr19161-1.c tmpdir/pr19161-1.o ld_compile "$CC $CFLAGS $cflags -O0" $srcdir/$subdir/pr19161-2.c tmpdir/pr19161-2.o - set saved_LDFLAGS "$LDFLAGS" if [istarget hppa*-*-linux*] { - set LDFLAGS "$LDFLAGS --defsym '\$\$dyncall=0'" + set symdefs {{ld {--defsym '\$\$dyncall=0'}}} } - run_dump_test "pr19161" - set LDFLAGS "$saved_LDFLAGS" + run_dump_test "pr19161" $symdefs } if { [is_elf_format] && [check_shared_lib_support] \ @@ -185,3 +195,4 @@ if { [is_elf_format] } then { } set ASFLAGS $old_asflags +set LDFLAGS $old_ldflags |