tcl global directive outside proc body does nothing (ld)
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / compress.exp
index b2b6ca112460c852015ed8bae79c4d8d90474779..8b55f86ea9a0b580cd6c7940b3dd04e552bfdf73 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for ELF compressed debug section tests.
-#   Copyright (C) 2010-2017 Free Software Foundation, Inc.
+#   Copyright (C) 2010-2020 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -25,12 +25,17 @@ if ![is_elf_format] {
     return
 }
 
+# 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
 }
 
-global as
 if { ![ld_assemble $as "--compress-debug-sections $srcdir/$subdir/empty.s" tmpdir/empty.o ] } {
     fail "linker compressed debug sections"
 }
@@ -118,8 +123,6 @@ if { [catch {exec cmp tmpdir/libfoo.so tmpdir/libfoozlib.so}] } then {
     pass "$test_name"
 }
 
-global READELF
-
 set test_name "Link -r with zlib compressed debug output"
 set test zlibbegin
 send_log "$READELF -S -W tmpdir/$test.o > tmpdir/$test.out\n"
@@ -162,19 +165,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"
@@ -185,6 +188,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 {
@@ -197,10 +201,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"
@@ -211,6 +215,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 {
@@ -224,9 +229,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"
@@ -237,6 +242,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 {
This page took 0.026852 seconds and 4 git commands to generate.