* lib/binutils-common.exp (is_zlib_supported): New function.
* lib/utils-lib.exp (run_dump_test): If as options include
--compress-debug-sections and zlib is not available, report
the test as unsupported.
* binutils-all/compress.exp: Bail out if zlib is not available.
* binutils-all/objdump.exp (objdump compressed debug):
Mark unsupported if zlib is not available.
* binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise.
gas/testsuite/
* lib/gas-defs.exp (run_dump_test): If as options include
--compress-debug-sections and zlib is not available, report
the test as unsupported.
ld/testsuite/
* ld-elf/compress.exp: Bail out if zlib is not supported.
* lib/ld-lib.exp (run_dump_test): If as options include
--compress-debug-sections and zlib is not available, report
the test as unsupported.
+2012-11-27 Roland McGrath <mcgrathr@google.com>
+
+ * lib/binutils-common.exp (is_zlib_supported): New function.
+ * lib/utils-lib.exp (run_dump_test): If as options include
+ --compress-debug-sections and zlib is not available, report
+ the test as unsupported.
+ * binutils-all/compress.exp: Bail out if zlib is not available.
+ * binutils-all/objdump.exp (objdump compressed debug):
+ Mark unsupported if zlib is not available.
+ * binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise.
+
2012-11-06 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/14567
-# Copyright 2010
+# Copyright 2010, 2012
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# Test compressed .debug section.
-if { [is_remote host] || ![is_elf_format] } then {
+if { [is_remote host] || ![is_elf_format] || ![is_zlib_supported] } then {
return
}
# Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2007, 2008, 2009, 2011
+# 2003, 2004, 2007, 2008, 2009, 2011, 2012
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# Test objdump -s on a file that contains a compressed .debug section
-if { ![is_elf_format] } then {
+if { ![is_elf_format] || ![is_zlib_supported] } then {
unsupported "objdump compressed debug"
} elseif { ![binutils_assemble $srcdir/$subdir/dw2-compressed.S tmpdir/dw2-compressed.o] } then {
fail "objdump compressed debug"
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
global readelf_size
global srcdir
global subdir
-
+
send_log "exec $READELF $READELFFLAGS $options $binary_file > readelf.out\n"
set got [remote_exec host "$READELF $READELFFLAGS $options $binary_file" "" "/dev/null" "readelf.out"]
global READELFFLAGS
global srcdir
global subdir
-
+
# Compile the second test file.
if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } {
verbose "Unable to compile test file."
set output [remote_upload host readelf.out]
file_on_host delete $tempfile
-
+
# Strip any superflous warnings.
set got [prune_readelf_wi_warnings [lindex $got 1]]
untested "readelf -wi"
return
}
-
+
# Search for strings that should be in the output.
set sought {
".*DW_TAG_compile_unit.*"
".*DW_AT_name.*(main|indirect string).*"
".*\(DW_OP_addr: 0\).*"
}
-
- foreach looked_for $sought {
+
+ foreach looked_for $sought {
set lines [grep $output $looked_for]
if ![llength $lines] then {
fail "readelf -wi: missing: $looked_for"
}
file_on_host delete $output
-
+
# All done.
pass "readelf -wi"
}
global READELFFLAGS
global srcdir
global subdir
-
+
+ if { ![is_zlib_supported] } {
+ unsupported "readelf -wa (compressed)"
+ return
+ }
+
# Compile the compressed-debug-section test file.
if { [target_compile $srcdir/$subdir/dw2-compressed.S tmpdir/dw2-compressed.o object debug] != "" } {
verbose "Unable to compile test file."
set output [remote_upload host readelf.out]
file_on_host delete $tempfile
-
+
if { [string compare [file_contents readelf.out] [file_contents $srcdir/$subdir/readelf.wa]] != 0 } then {
fail "readelf -wa (compressed)"
verbose "output is \n[file_contents readelf.out]" 2
global READELFFLAGS
global srcdir
global subdir
-
+
# Assemble the dump test file.
if {![binutils_assemble $srcdir/$subdir/dumptest.s tmpdir/dumptest.o]} then {
unresolved "readelf -p: failed to assemble dump test file"
set sought {
".*test_string.*"
}
-
- foreach looked_for $sought {
+
+ foreach looked_for $sought {
set lines [grep $output $looked_for]
if ![llength $lines] then {
fail "readelf -p: missing: $looked_for"
}
}
- file_on_host delete $tempfile
+ file_on_host delete $tempfile
file_on_host delete $output
# All done.
return 0
}
+# True if the build supports zlib compression.
+proc is_zlib_supported {} {
+
+ # This replicates the AS selection logic of dejagnu's target_assemble.
+ global AS_FOR_TARGET
+ if [info exists AS_FOR_TARGET] {
+ set AS $AS_FOR_TARGET
+ } else {
+ if {![board_info target exists assembler]} {
+ set AS [find_gas]
+ } else {
+ set AS [board_info target assembler]
+ }
+ }
+
+ set as_output [remote_exec host "$AS --help"]
+
+ set have_zlib 0
+ if {[string first "--compress-debug-sections" $as_output] >= 0} {
+ set have_zlib 1
+ }
+
+ return $have_zlib
+}
+
# Compare two files line-by-line. FILE_1 is the actual output and FILE_2
# is the expected output. Ignore blank lines in either file.
#
# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006, 2007,
-# 2009, 2010 Free Software Foundation, Inc.
+# 2009, 2010, 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
if { $opts(not-skip) != "" } then {
set skip 1
foreach glob $opts(not-skip) {
- if {[istarget $glob]} {
+ if {[istarget $glob]} {
set skip 0
break
}
}
set skip 1
foreach glob $opts(target) {
- if {[istarget $glob]} {
+ if {[istarget $glob]} {
set skip 0
break
}
}
- if {$skip} {
+ if {$skip} {
unsupported $testname
- return
+ return
}
}
if { $opts(not-target) != "" } then {
foreach glob $opts(not-target) {
if {[istarget $glob]} {
unsupported $testname
- return
+ return
}
}
}
+ if { [string match "*--compress-debug-sections*" $opts(as)] \
+ && ![is_zlib_supported] } {
+ unsupported $testname
+ return
+ }
+
if { $opts(source) == "" } {
set srcfile ${file}.s
} else {
+2012-11-27 Roland McGrath <mcgrathr@google.com>
+
+ * lib/gas-defs.exp (run_dump_test): If as options include
+ --compress-debug-sections and zlib is not available, report
+ the test as unsupported.
+
2012-11-23 Alan Modra <amodra@gmail.com>
* gas/ppc/astest2.d: Pass -Mppc to objdump.
# Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2004, 2005, 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
set return_contents_of "gas.stderr"
} elseif [regexp ">&.*" $redir] then {
# See PR 5322 for why the following line is used.
- regsub ">&" $redir "" output_file
+ regsub ">&" $redir "" output_file
set command "$cmd 2>&1"
} elseif [regexp "2>.*" $redir] then {
set output_file "gas.out"
if { $opts(not-skip) != "" } then {
set skip 1
foreach glob $opts(not-skip) {
- if {[istarget $glob]} {
+ if {[istarget $glob]} {
set skip 0
break
}
}
set skip 1
foreach glob $opts(target) {
- if {[istarget $glob]} {
+ if {[istarget $glob]} {
set skip 0
break
}
}
- if {$skip} {
+ if {$skip} {
unsupported $testname
- return
+ return
}
}
if { $opts(not-target) != "" } then {
foreach glob $opts(not-target) {
if {[istarget $glob]} {
unsupported $testname
- return
+ return
}
}
}
+ if { [string match "*--compress-debug-sections*" $opts(as)] \
+ && ![is_zlib_supported] } {
+ unsupported $testname
+ return
+ }
+
if { $opts(source) == "" } {
set sourcefile ${file}.s
* ld-elf/flags1.d: Add *-*-nacl* to xfail list.
* ld-elf/orphan-region.d: Likewise.
+2012-11-27 Roland McGrath <mcgrathr@google.com>
+
+ * ld-elf/compress.exp: Bail out if zlib is not supported.
+ * lib/ld-lib.exp (run_dump_test): If as options include
+ --compress-debug-sections and zlib is not available, report
+ the test as unsupported.
+
2012-11-23 Alan Modra <amodra@gmail.com>
* ld-powerpc/plt1.d: Update for default "at" branch hints.
return
}
+if ![is_zlib_supported] {
+ return
+}
+
# The following tests require running the executable generated by ld.
if ![isnative] {
return
set dfile $srcdir/$subdir/$opts(dump)
}
+ if { [string match "*--compress-debug-sections*" $opts(as)] \
+ && ![is_zlib_supported] } {
+ unsupported $testname
+ return
+ }
+
# Time to setup xfailures.
foreach targ $opts(xfail) {
setup_xfail $targ