X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Ftestsuite%2Fld-elf%2Fcompress.exp;h=90b6c6e6612bc54a37a211d45a0039dcdbd652cb;hb=44ed80923ab89e141120defa8c1209b69869a7ac;hp=f9caa9c6f729a8fdc7c29b4f3daf3eb2da7181ad;hpb=84b74b498eb690e5a856c23b9abc71f9680b81a6;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/testsuite/ld-elf/compress.exp b/ld/testsuite/ld-elf/compress.exp index f9caa9c6f7..90b6c6e661 100644 --- a/ld/testsuite/ld-elf/compress.exp +++ b/ld/testsuite/ld-elf/compress.exp @@ -1,5 +1,5 @@ # Expect script for ELF compressed debug section tests. -# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# Copyright (C) 2010-2019 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -25,13 +25,14 @@ if ![is_elf_format] { return } -# The following tests require running the executable generated by ld. -if ![isnative] { +# Skip targets where -shared is not supported + +if ![check_shared_lib_support] { return } # Check if compiler works -if { [which $CC] == 0 } { +if { ![check_compiler_available] } { return } @@ -92,27 +93,27 @@ set run_tests { "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" "" {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} {"Run zlibnormal with libzlibfoo.so with zlib compressed debug sections" - "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o --compress-debug-sections=zlib" "" + "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"} {"Run zlibnormal with libfoozlib.so with zlib compressed debug sections" - "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o --compress-debug-sections=zlib" "" + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"} {"Run gnunormal with libgnufoo.so with zlib-gnu compressed debug sections" - "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o --compress-debug-sections=zlib-gnu" "" + "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"} {"Run gnunormal with libfoozlib.so with zlib-gnu compressed debug sections" - "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o --compress-debug-sections=zlib-gnu" "" + "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"} {"Run gabinormal with libgabifoo.so with zlib-gabi compressed debug sections" - "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o --compress-debug-sections=zlib-gabi" "" + "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} {"Run gabinormal with libfoozlib.so with zlib-gabi compressed debug sections" - "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o --compress-debug-sections=zlib-gabi" "" + "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} } run_cc_link_tests $build_tests -run_ld_link_exec_tests [] $run_tests +run_ld_link_exec_tests $run_tests set test_name "Link with zlib-gabi compressed debug input" send_log "cmp tmpdir/libfoo.so tmpdir/libfoozlib.so\n" @@ -167,19 +168,19 @@ if { [regexp_diff tmpdir/$test.out $srcdir/$subdir/$test.rt] } then { pass "$test_name" } -set test_name "Link with zlib compressed debug output" +set test_name "Link with zlib compressed debug output 1" set test normal send_log "$READELF -w tmpdir/$test > tmpdir/$test.out\n" -set got [remote_exec host "$READELF -w tmpdir/$test" "" "/dev/null" "tmpdir/$test.out"] +set got [remote_exec host [concat sh -c [list "$READELF -w tmpdir/$test > tmpdir/$test.out"]] "" "/dev/null"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { send_log "$got\n" unresolved "$test_name" } -set test_name "Link with zlib compressed debug output" +set test_name "Link with zlib compressed debug output 2" set test zlibnormal send_log "$READELF -w tmpdir/$test | sed -e \"s/.zdebug_/.debug_/\" > tmpdir/$test.out\n" -set got [remote_exec host "$READELF -w tmpdir/$test | sed -e \"s/.zdebug_/.debug_/\"" "" "/dev/null" "tmpdir/$test.out"] +set got [remote_exec host [concat sh -c [list "$READELF -w tmpdir/$test | sed -e \"s/.zdebug_/.debug_/\" > tmpdir/$test.out"]] "" "/dev/null"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { send_log "$got\n" unresolved "$test_name" @@ -190,6 +191,7 @@ if { [catch {exec cmp tmpdir/normal.out tmpdir/$test.out}] } then { } else { pass "$test_name" } +set test_name "Link with zlib compressed debug output 3" send_log "$READELF -S -W tmpdir/$test' > tmpdir/$test.out\n" set got [remote_exec host "$READELF -S -W tmpdir/$test" "" "/dev/null" "tmpdir/$test.out"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { @@ -202,10 +204,10 @@ if { [regexp_diff tmpdir/$test.out $srcdir/$subdir/$test.rS] } then { pass "$test_name" } -set test_name "Link with zlib-gnu compressed debug output" +set test_name "Link with zlib-gnu compressed debug output 1" set test gnunormal send_log "$READELF -w tmpdir/$test | sed -e \"s/.zdebug_/.debug_/\" > tmpdir/$test.out\n" -set got [remote_exec host "$READELF -w tmpdir/$test | sed -e \"s/.zdebug_/.debug_/\"" "" "/dev/null" "tmpdir/$test.out"] +set got [remote_exec host [concat sh -c [list "$READELF -w tmpdir/$test | sed -e \"s/.zdebug_/.debug_/\" > tmpdir/$test.out"]] "" "/dev/null"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { send_log "$got\n" unresolved "$test_name" @@ -216,6 +218,7 @@ if { [catch {exec cmp tmpdir/normal.out tmpdir/$test.out}] } then { } else { pass "$test_name" } +set test_name "Link with zlib-gnu compressed debug output 2" send_log "$READELF -S -W tmpdir/$test' > tmpdir/$test.out\n" set got [remote_exec host "$READELF -S -W tmpdir/$test" "" "/dev/null" "tmpdir/$test.out"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { @@ -229,9 +232,9 @@ if { [regexp_diff tmpdir/$test.out $srcdir/$subdir/$test.rS] } then { } set test gabinormal -set test_name "Link with zlib-gabi compressed debug output" +set test_name "Link with zlib-gabi compressed debug output 1" send_log "$READELF -w tmpdir/$test > tmpdir/$test.out\n" -set got [remote_exec host "$READELF -w tmpdir/$test" "" "/dev/null" "tmpdir/$test.out"] +set got [remote_exec host [concat sh -c [list "$READELF -w tmpdir/$test > tmpdir/$test.out"]] "" "/dev/null"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { send_log "$got\n" unresolved "$test_name" @@ -242,6 +245,7 @@ if { [catch {exec cmp tmpdir/normal.out tmpdir/$test.out}] } then { } else { pass "$test_name" } +set test_name "Link with zlib-gabi compressed debug output 2" send_log "$READELF -t -W tmpdir/$test > tmpdir/$test.out\n" set got [remote_exec host "$READELF -t -W tmpdir/$test" "" "/dev/null" "tmpdir/$test.out"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {