Xfail the compressed debug sections
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 5 Apr 2015 15:11:11 +0000 (08:11 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 5 Apr 2015 15:15:35 +0000 (08:15 -0700)
There is no need to generate compressed debug section if compressed
section size is the same as before compression.  We should xfail the
compressed debug section test if there are no compressed sections

binutils/testsuite/

* binutils-all/compress.exp (compression_used): New.
Xfail test if compression didn't make the section smaller.

gas/

2015-04-05  H.J. Lu  <hongjiu.lu@intel.com>

* write.c (compress_debug): Don't write the zlib header if
compressed section size is the same as before compression.

binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/compress.exp
gas/ChangeLog
gas/write.c

index 827e836e83e6feb0caa94818fd63c28d15417f3b..ff77d5160d28d6ac68b857b0bd8151cd64d4f288 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * binutils-all/compress.exp (compression_used): New.
+       Xfail test if compression didn't make the section smaller.
+
 2015-04-04  H.J. Lu  <hongjiu.lu@intel.com>
 
        * binutils-all/compress.exp (testfile): Remove suffix.
index 02111f1af7d214491c4f3239f3bbe01b283ceb1a..f170aea07b568f02e6fca914519dcb27de939483 100644 (file)
@@ -39,6 +39,15 @@ if { ![binutils_assemble_flags $srcdir/$subdir/dw2-1.S ${compressedfile}.o --com
     return
 }
 
+set got [remote_exec host "cmp ${testfile}.o ${compressedfile}.o" "" "/dev/null"]
+# Use it to set up xfail.
+set exec_output [lindex $got 1]
+if [string match "" $exec_output] then {
+    set compression_used ""
+} else {
+    set compression_used "yes"
+}
+
 if { ![binutils_assemble_flags $srcdir/$subdir/dw2-2.S ${compressedfile2}.o --compress-debug-sections] } then {
     unsupported "compressed debug sections"
     return
@@ -125,6 +134,8 @@ if ![string match "" $got] then {
     }
 }
 
+# Xfail this test if there are no compressed sections.
+setup_xfail "$compression_used$target_triplet"
 set testname "objcopy compress debug sections in archive"
 set got [binutils_run $OBJCOPY "--compress-debug-sections ${copyfile}.a ${compressedcopyfile}.a"]
 if ![string match "" $got] then {
@@ -138,6 +149,7 @@ if ![string match "" $got] then {
        send_log "\n"
     }
 
+    setup_xfail "$compression_used$target_triplet"
     if { [regexp_diff tmpdir/libdw2-compressed.out $srcdir/$subdir/libdw2-compressed.out] } then {
        fail "$testname"
     } else {
index a2383a91e3eabde30f7808e3c7e906aa0ba9401b..f2a1bf2258926b91e46160927910ec9074cc1cd1 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * write.c (compress_debug): Don't write the zlib header if
+       compressed section size is the same as before compression.
+
 2015-04-02  Nick Clifton  <nickc@redhat.com>
 
        PR gas/18189
index 6a781eaa9a0c372b10a8f6f87e19c960e05501ef..248255b3b66e36999a11a737faa6803fa8205d8f 100644 (file)
@@ -1519,7 +1519,7 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
 
   /* PR binutils/18087: If compression didn't make the section smaller,
      just keep it uncompressed.  */
-  if (compressed_size > uncompressed_size)
+  if (compressed_size >= uncompressed_size)
     return;
 
   memcpy (header, "ZLIB", 4);
This page took 0.028806 seconds and 4 git commands to generate.