Update year range in copyright notice of binutils files
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / compress.exp
index a5c154f37579447c94e5e3ba4befce78019d9249..6bdc92182885d4aa6a3cbccfd52cb000f2cc4914 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-2019 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -25,8 +25,9 @@ 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
 }
 
@@ -92,22 +93,22 @@ 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"}
 }
 
@@ -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 {
This page took 0.026755 seconds and 4 git commands to generate.