This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][PATCH] Extend --compress-debug-sections in gold


On Wed, May 13, 2015 at 11:59 PM, Cary Coutant <ccoutant@gmail.com> wrote:
> +      memcpy(*compressed_data + compression_header_size, "ZLIB", 4);
> +      elfcpp::Swap_unaligned<64, true>::writeval(*compressed_data + 4
> +                                                + compression_header_size,
>                                                  uncompressed_size);
>
> This is wrong. If you're generating new-style compressed sections, the
> new compression header is supposed to *replace* the old "ZLIB" plus
> 8-byte big-endian size. You're writing both.
>
> -cary
>

Fixed.  Here is the updated patch.  OK for master?


-- 
H.J.
---
This patch extends --compress-debug-sections= with [zlib-gnu|zlib-gabi]
in gold.

PR gold/18322
* compressed_output.cc (zlib_compress): Add argument for
compression header size.  Set header size to compression header
size if it isn't 0.  Don't write out the zlib header here.
(Output_compressed_section::set_final_data_size): Support
zlib-gnu and zlib-gabi compressions.  Pass compression header
size to zlib_compress and write out compression header.  Set
the SHF_COMPRESSED bit for zlib-gabi compression.  Otherwise
clear the SHF_COMPRESSED bit
* options.h (compress_debug_sections): Add zlib-gnu and
zlib-gabi.
* output.h (Output_section::set_flags): New.
* testsuite/Makefile.am (check_PROGRAMS): Add
flagstest_compress_debug_sections_none,
flagstest_compress_debug_sections_gnu and
flagstest_compress_debug_sections_gabi.
(check_DATA): Add flagstest_compress_debug_sections_none.stdout.
flagstest_compress_debug_sections.stdout,
flagstest_compress_debug_sections.cmp,
flagstest_compress_debug_sections.check,
flagstest_compress_debug_sections_gnu.stdout,
flagstest_compress_debug_sections_gnu.cmp,
flagstest_compress_debug_sections_gnu.check,
flagstest_compress_debug_sections_gabi.stdout,
flagstest_compress_debug_sections_gabi.cmp and
flagstest_compress_debug_sections_gabi.check.
(flagstest_compress_debug_sections_none): New.
(flagstest_compress_debug_sections_none.stdout): Likewise.
(flagstest_compress_debug_sections.stdout): Likewise.
(flagstest_compress_debug_sections.check): Likewise.
(flagstest_compress_debug_sections.cmp): Likewise.
(flagstest_compress_debug_sections_gnu): Likewise.
(flagstest_compress_debug_sections_gnu.stdout): Likewise.
(flagstest_compress_debug_sections_gnu.check): Likewise.
(flagstest_compress_debug_sections_gnu.cmp): Likewise.
(flagstest_compress_debug_sections_gabi): Likewise.
(flagstest_compress_debug_sections_gabi.stdout): Likewise.
(flagstest_compress_debug_sections_gnu.check): Likewise.
(flagstest_compress_debug_sections_gnu.cmp): Likewise.
* testsuite/Makefile.in: Regenerated.
From 1ca58a1deeb0e07e7bf575c85be8635bec4b755d Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 22 Mar 2015 11:59:53 -0700
Subject: [PATCH 2/2] Extend --compress-debug-sections in gold

This patch extends --compress-debug-sections= with [zlib-gnu|zlib-gabi]
in gold.

	PR gold/18322
	* compressed_output.cc (zlib_compress): Add argument for
	compression header size.  Set header size to compression header
	size if it isn't 0.  Don't write out the zlib header here.
	(Output_compressed_section::set_final_data_size): Support
	zlib-gnu and zlib-gabi compressions.  Pass compression header
	size to zlib_compress and write out compression header.  Set
	the SHF_COMPRESSED bit for zlib-gabi compression.  Otherwise
	clear the SHF_COMPRESSED bit
	* options.h (compress_debug_sections): Add zlib-gnu and
	zlib-gabi.
	* output.h (Output_section::set_flags): New.
	* testsuite/Makefile.am (check_PROGRAMS): Add
	flagstest_compress_debug_sections_none,
	flagstest_compress_debug_sections_gnu and
	flagstest_compress_debug_sections_gabi.
	(check_DATA): Add flagstest_compress_debug_sections_none.stdout.
	flagstest_compress_debug_sections.stdout,
	flagstest_compress_debug_sections.cmp,
	flagstest_compress_debug_sections.check,
	flagstest_compress_debug_sections_gnu.stdout,
	flagstest_compress_debug_sections_gnu.cmp,
	flagstest_compress_debug_sections_gnu.check,
	flagstest_compress_debug_sections_gabi.stdout,
	flagstest_compress_debug_sections_gabi.cmp and
	flagstest_compress_debug_sections_gabi.check.
	(flagstest_compress_debug_sections_none): New.
	(flagstest_compress_debug_sections_none.stdout): Likewise.
	(flagstest_compress_debug_sections.stdout): Likewise.
	(flagstest_compress_debug_sections.check): Likewise.
	(flagstest_compress_debug_sections.cmp): Likewise.
	(flagstest_compress_debug_sections_gnu): Likewise.
	(flagstest_compress_debug_sections_gnu.stdout): Likewise.
	(flagstest_compress_debug_sections_gnu.check): Likewise.
	(flagstest_compress_debug_sections_gnu.cmp): Likewise.
	(flagstest_compress_debug_sections_gabi): Likewise.
	(flagstest_compress_debug_sections_gabi.stdout): Likewise.
	(flagstest_compress_debug_sections_gnu.check): Likewise.
	(flagstest_compress_debug_sections_gnu.cmp): Likewise.
	* testsuite/Makefile.in: Regenerated.
---
 gold/compressed_output.cc  |  91 +++++++++++++++++++++++++----
 gold/options.h             |   4 +-
 gold/output.h              |   5 ++
 gold/testsuite/Makefile.am |  82 +++++++++++++++++++++++++-
 gold/testsuite/Makefile.in | 143 ++++++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 310 insertions(+), 15 deletions(-)

diff --git a/gold/compressed_output.cc b/gold/compressed_output.cc
index 02d7821..4a89318 100644
--- a/gold/compressed_output.cc
+++ b/gold/compressed_output.cc
@@ -39,12 +39,12 @@ namespace gold
 // order.
 
 static bool
-zlib_compress(const unsigned char* uncompressed_data,
+zlib_compress(int header_size,
+              const unsigned char* uncompressed_data,
               unsigned long uncompressed_size,
               unsigned char** compressed_data,
               unsigned long* compressed_size)
 {
-  const int header_size = 12;
   *compressed_size = uncompressed_size + uncompressed_size / 1000 + 128;
   *compressed_data = new unsigned char[*compressed_size + header_size];
 
@@ -61,9 +61,6 @@ zlib_compress(const unsigned char* uncompressed_data,
                      compress_level);
   if (rc == Z_OK)
     {
-      memcpy(*compressed_data, "ZLIB", 4);
-      elfcpp::Swap_unaligned<64, true>::writeval(*compressed_data + 4,
-						 uncompressed_size);
       *compressed_size += header_size;
       return true;
     }
@@ -233,14 +230,88 @@ Output_compressed_section::set_final_data_size()
   this->write_to_postprocessing_buffer();
 
   bool success = false;
+  enum { none, zlib, gnu_zlib, gabi_zlib } compress;
+  int compression_header_size = 12;
+  const int size = parameters->target().get_size();
   if (strcmp(this->options_->compress_debug_sections(), "zlib") == 0)
-    success = zlib_compress(uncompressed_data, uncompressed_size,
-                            &this->data_, &compressed_size);
+    compress = zlib;
+  else if (strcmp(this->options_->compress_debug_sections(), "zlib-gnu") == 0)
+    compress = gnu_zlib;
+  else if (strcmp(this->options_->compress_debug_sections(), "zlib-gabi") == 0)
+    {
+      compress = gabi_zlib;
+      if (size == 32)
+	compression_header_size = elfcpp::Elf_sizes<32>::chdr_size;
+      else if (size == 64)
+	compression_header_size = elfcpp::Elf_sizes<64>::chdr_size;
+      else
+	gold_unreachable();
+    }
+  else
+    compress = none;
+  if (compress != none)
+    success = zlib_compress(compression_header_size, uncompressed_data,
+			    uncompressed_size, &this->data_,
+			    &compressed_size);
   if (success)
     {
-      // This converts .debug_foo to .zdebug_foo
-      this->new_section_name_ = std::string(".z") + (this->name() + 1);
-      this->set_name(this->new_section_name_.c_str());
+      elfcpp::Elf_Xword flags = this->flags();
+      if (compress == gabi_zlib)
+	{
+	  // Set the SHF_COMPRESSED bit.
+	  flags |= elfcpp::SHF_COMPRESSED;
+	  const bool is_big_endian = parameters->target().is_big_endian();
+	  uint64_t addralign = this->addralign();
+	  if (size == 32)
+	    {
+	      if (is_big_endian)
+		{
+		  elfcpp::Chdr_write<32, true> chdr(this->data_);
+		  chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
+		  chdr.put_ch_size(uncompressed_size);
+		  chdr.put_ch_addralign(addralign);
+		}
+	      else
+		{
+		  elfcpp::Chdr_write<32, false> chdr(this->data_);
+		  chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
+		  chdr.put_ch_size(uncompressed_size);
+		  chdr.put_ch_addralign(addralign);
+		}
+	    }
+	  else if (size == 64)
+	    {
+	      if (is_big_endian)
+		{
+		  elfcpp::Chdr_write<64, true> chdr(this->data_);
+		  chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
+		  chdr.put_ch_size(uncompressed_size);
+		  chdr.put_ch_addralign(addralign);
+		}
+	      else
+		{
+		  elfcpp::Chdr_write<64, false> chdr(this->data_);
+		  chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
+		  chdr.put_ch_size(uncompressed_size);
+		  chdr.put_ch_addralign(addralign);
+		}
+	    }
+	  else
+	    gold_unreachable();
+	}
+      else
+	{
+	  // Write out the zlib header.
+	  memcpy(this->data_, "ZLIB", 4);
+	  elfcpp::Swap_unaligned<64, true>::writeval(this->data_ + 4,
+						     uncompressed_size);
+	  // This converts .debug_foo to .zdebug_foo
+	  this->new_section_name_ = std::string(".z") + (this->name() + 1);
+	  this->set_name(this->new_section_name_.c_str());
+	  // Clear the SHF_COMPRESSED bit.
+	  flags &= ~elfcpp::SHF_COMPRESSED;
+	}
+      this->set_flags(flags);
       this->set_data_size(compressed_size);
     }
   else
diff --git a/gold/options.h b/gold/options.h
index 67eb1b2..d2d1b4b 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -697,8 +697,8 @@ class General_options
 
   DEFINE_enum(compress_debug_sections, options::TWO_DASHES, '\0', "none",
 	      N_("Compress .debug_* sections in the output file"),
-	      ("[none,zlib]"),
-	      {"none", "zlib"});
+	      ("[none,zlib,zlib-gnu,zlib-gabi]"),
+	      {"none", "zlib", "zlib-gnu", "zlib-gabi"});
 
   DEFINE_bool(copy_dt_needed_entries, options::TWO_DASHES, '\0', false,
 	      N_("Not supported"),
diff --git a/gold/output.h b/gold/output.h
index be72965..c7ad54e 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -3100,6 +3100,11 @@ class Output_section : public Output_data
   void
   update_flags_for_input_section(elfcpp::Elf_Xword flags);
 
+  // Set the output section flags.
+  void
+  set_flags(elfcpp::Elf_Xword flags)
+  { this->flags_ = flags; }
+
   // Return the entsize field.
   uint64_t
   entsize() const
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 0f00f2b..a5266b3 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -1319,12 +1319,92 @@ flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
 	chmod a+x $@
 	test -s $@
 
-# Test --compress-debug-sections.  FIXME: check we actually compress.
+# Test --compress-debug-sections.
+check_PROGRAMS += flagstest_compress_debug_sections_none
+check_DATA += flagstest_compress_debug_sections_none.stdout
+flagstest_compress_debug_sections_none: flagstest_debug.o gcctestdir/ld
+	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=none
+	test -s $@
+
+# Dump DWARF debug sections.
+flagstest_compress_debug_sections_none.stdout: flagstest_compress_debug_sections_none
+	$(TEST_READELF) -w $< > $@.tmp
+	mv -f $@.tmp $@
+
 check_PROGRAMS += flagstest_compress_debug_sections
+check_DATA += flagstest_compress_debug_sections.stdout \
+	      flagstest_compress_debug_sections.cmp \
+	      flagstest_compress_debug_sections.check
 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
 	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
 	test -s $@
 
+# Dump compressed DWARF debug sections.
+flagstest_compress_debug_sections.stdout: flagstest_compress_debug_sections
+	$(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
+	mv -f $@.tmp $@
+
+# Check there are compressed DWARF .zdebug_* sections.
+flagstest_compress_debug_sections.check: flagstest_compress_debug_sections
+	$(TEST_READELF) -SW $< | grep ".zdebug_" > $@.tmp
+	mv -f $@.tmp $@
+
+# Compare DWARF debug info.
+flagstest_compress_debug_sections.cmp: flagstest_compress_debug_sections.stdout \
+	flagstest_compress_debug_sections_none.stdout
+	cmp flagstest_compress_debug_sections.stdout \
+		flagstest_compress_debug_sections_none.stdout > $@.tmp
+	mv -f $@.tmp $@
+
+check_PROGRAMS += flagstest_compress_debug_sections_gnu
+check_DATA += flagstest_compress_debug_sections_gnu.stdout \
+	      flagstest_compress_debug_sections_gnu.cmp \
+	      flagstest_compress_debug_sections_gnu.check
+flagstest_compress_debug_sections_gnu: flagstest_debug.o gcctestdir/ld
+	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gnu
+	test -s $@
+
+# Dump compressed DWARF debug sections.
+flagstest_compress_debug_sections_gnu.stdout: flagstest_compress_debug_sections_gnu
+	$(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
+	mv -f $@.tmp $@
+
+# Check there are compressed DWARF .zdebug_* sections.
+flagstest_compress_debug_sections_gnu.check: flagstest_compress_debug_sections_gnu
+	$(TEST_READELF) -SW $< | grep ".zdebug_" > $@.tmp
+	mv -f $@.tmp $@
+
+# Compare DWARF debug info.
+flagstest_compress_debug_sections_gnu.cmp: flagstest_compress_debug_sections_gnu.stdout \
+	flagstest_compress_debug_sections_none.stdout
+	cmp flagstest_compress_debug_sections_gnu.stdout \
+		flagstest_compress_debug_sections_none.stdout > $@.tmp
+	mv -f $@.tmp $@
+
+check_PROGRAMS += flagstest_compress_debug_sections_gabi
+check_DATA += flagstest_compress_debug_sections_gabi.stdout \
+	      flagstest_compress_debug_sections_gabi.cmp \
+	      flagstest_compress_debug_sections_gabi.check
+flagstest_compress_debug_sections_gabi: flagstest_debug.o gcctestdir/ld
+	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gabi
+	test -s $@
+
+# Dump compressed DWARF debug sections.
+flagstest_compress_debug_sections_gabi.stdout: flagstest_compress_debug_sections_gabi
+	$(TEST_READELF) -w $< > $@.tmp
+	mv -f $@.tmp $@
+
+# Check there are compressed DWARF .debug_* sections.
+flagstest_compress_debug_sections_gabi.check: flagstest_compress_debug_sections_gabi
+	$(TEST_READELF) -tW $< | grep "COMPRESSED" > $@.tmp
+	mv -f $@.tmp $@
+
+# Compare DWARF debug info.
+flagstest_compress_debug_sections_gabi.cmp: flagstest_compress_debug_sections_gabi.stdout \
+	flagstest_compress_debug_sections_none.stdout
+	cmp flagstest_compress_debug_sections_gabi.stdout \
+		flagstest_compress_debug_sections_none.stdout > $@.tmp
+	mv -f $@.tmp $@
 
 # The specialfile output has a tricky case when we also compress debug
 # sections, because it requires output-file resizing.
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
index 85d478e..bcfa3af 100644
--- a/gold/testsuite/Makefile.in
+++ b/gold/testsuite/Makefile.in
@@ -226,7 +226,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
 
 # Test -o when emitting to a special file (such as something in /dev).
 
-# Test --compress-debug-sections.  FIXME: check we actually compress.
+# Test --compress-debug-sections.
 
 # The specialfile output has a tricky case when we also compress debug
 # sections, because it requires output-file resizing.
@@ -242,7 +242,10 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	many_sections_r_test initpri1 \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	initpri2 initpri3a \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_o_specialfile \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_none \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gnu \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gabi \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_o_specialfile_and_compress_debug_sections \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_o_ttext_1 ver_test \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	ver_test_2 ver_test_6 ver_test_8 \
@@ -346,6 +349,16 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	debug_msg_so.err \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	debug_msg_ndebug.err \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	undef_symbol.err \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_none.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections.cmp \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections.check \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gnu.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gnu.cmp \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gnu.check \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gabi.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gabi.cmp \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gabi.check \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_o_ttext_2 \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	ver_test_1.syms ver_test_2.syms \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	ver_test_4.syms ver_test_5.syms \
@@ -901,7 +914,10 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	initpri2$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	initpri3a$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_o_specialfile$(EXEEXT) \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_none$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections$(EXEEXT) \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gnu$(EXEEXT) \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_gabi$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_o_ttext_1$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	ver_test$(EXEEXT) \
@@ -1181,6 +1197,33 @@ flagstest_compress_debug_sections_DEPENDENCIES = libgoldtest.a \
 	../libgold.a ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1)
+flagstest_compress_debug_sections_gabi_SOURCES =  \
+	flagstest_compress_debug_sections_gabi.c
+flagstest_compress_debug_sections_gabi_OBJECTS =  \
+	flagstest_compress_debug_sections_gabi.$(OBJEXT)
+flagstest_compress_debug_sections_gabi_LDADD = $(LDADD)
+flagstest_compress_debug_sections_gabi_DEPENDENCIES = libgoldtest.a \
+	../libgold.a ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+flagstest_compress_debug_sections_gnu_SOURCES =  \
+	flagstest_compress_debug_sections_gnu.c
+flagstest_compress_debug_sections_gnu_OBJECTS =  \
+	flagstest_compress_debug_sections_gnu.$(OBJEXT)
+flagstest_compress_debug_sections_gnu_LDADD = $(LDADD)
+flagstest_compress_debug_sections_gnu_DEPENDENCIES = libgoldtest.a \
+	../libgold.a ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+flagstest_compress_debug_sections_none_SOURCES =  \
+	flagstest_compress_debug_sections_none.c
+flagstest_compress_debug_sections_none_OBJECTS =  \
+	flagstest_compress_debug_sections_none.$(OBJEXT)
+flagstest_compress_debug_sections_none_LDADD = $(LDADD)
+flagstest_compress_debug_sections_none_DEPENDENCIES = libgoldtest.a \
+	../libgold.a ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 flagstest_o_specialfile_SOURCES = flagstest_o_specialfile.c
 flagstest_o_specialfile_OBJECTS = flagstest_o_specialfile.$(OBJEXT)
 flagstest_o_specialfile_LDADD = $(LDADD)
@@ -2017,7 +2060,11 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \
 	$(exception_static_test_SOURCES) $(exception_test_SOURCES) \
 	$(exception_x86_64_bnd_test_SOURCES) \
 	$(exclude_libs_test_SOURCES) \
-	flagstest_compress_debug_sections.c flagstest_o_specialfile.c \
+	flagstest_compress_debug_sections.c \
+	flagstest_compress_debug_sections_gabi.c \
+	flagstest_compress_debug_sections_gnu.c \
+	flagstest_compress_debug_sections_none.c \
+	flagstest_o_specialfile.c \
 	flagstest_o_specialfile_and_compress_debug_sections.c \
 	flagstest_o_ttext_1.c icf_virtual_function_folding_test.c \
 	$(ifuncmain1_SOURCES) ifuncmain1pic.c ifuncmain1picstatic.c \
@@ -3055,6 +3102,24 @@ exclude_libs_test$(EXEEXT): $(exclude_libs_test_OBJECTS) $(exclude_libs_test_DEP
 @NATIVE_LINKER_FALSE@flagstest_compress_debug_sections$(EXEEXT): $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_DEPENDENCIES) 
 @NATIVE_LINKER_FALSE@	@rm -f flagstest_compress_debug_sections$(EXEEXT)
 @NATIVE_LINKER_FALSE@	$(LINK) $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_LDADD) $(LIBS)
+@GCC_FALSE@flagstest_compress_debug_sections_gabi$(EXEEXT): $(flagstest_compress_debug_sections_gabi_OBJECTS) $(flagstest_compress_debug_sections_gabi_DEPENDENCIES) 
+@GCC_FALSE@	@rm -f flagstest_compress_debug_sections_gabi$(EXEEXT)
+@GCC_FALSE@	$(LINK) $(flagstest_compress_debug_sections_gabi_OBJECTS) $(flagstest_compress_debug_sections_gabi_LDADD) $(LIBS)
+@NATIVE_LINKER_FALSE@flagstest_compress_debug_sections_gabi$(EXEEXT): $(flagstest_compress_debug_sections_gabi_OBJECTS) $(flagstest_compress_debug_sections_gabi_DEPENDENCIES) 
+@NATIVE_LINKER_FALSE@	@rm -f flagstest_compress_debug_sections_gabi$(EXEEXT)
+@NATIVE_LINKER_FALSE@	$(LINK) $(flagstest_compress_debug_sections_gabi_OBJECTS) $(flagstest_compress_debug_sections_gabi_LDADD) $(LIBS)
+@GCC_FALSE@flagstest_compress_debug_sections_gnu$(EXEEXT): $(flagstest_compress_debug_sections_gnu_OBJECTS) $(flagstest_compress_debug_sections_gnu_DEPENDENCIES) 
+@GCC_FALSE@	@rm -f flagstest_compress_debug_sections_gnu$(EXEEXT)
+@GCC_FALSE@	$(LINK) $(flagstest_compress_debug_sections_gnu_OBJECTS) $(flagstest_compress_debug_sections_gnu_LDADD) $(LIBS)
+@NATIVE_LINKER_FALSE@flagstest_compress_debug_sections_gnu$(EXEEXT): $(flagstest_compress_debug_sections_gnu_OBJECTS) $(flagstest_compress_debug_sections_gnu_DEPENDENCIES) 
+@NATIVE_LINKER_FALSE@	@rm -f flagstest_compress_debug_sections_gnu$(EXEEXT)
+@NATIVE_LINKER_FALSE@	$(LINK) $(flagstest_compress_debug_sections_gnu_OBJECTS) $(flagstest_compress_debug_sections_gnu_LDADD) $(LIBS)
+@GCC_FALSE@flagstest_compress_debug_sections_none$(EXEEXT): $(flagstest_compress_debug_sections_none_OBJECTS) $(flagstest_compress_debug_sections_none_DEPENDENCIES) 
+@GCC_FALSE@	@rm -f flagstest_compress_debug_sections_none$(EXEEXT)
+@GCC_FALSE@	$(LINK) $(flagstest_compress_debug_sections_none_OBJECTS) $(flagstest_compress_debug_sections_none_LDADD) $(LIBS)
+@NATIVE_LINKER_FALSE@flagstest_compress_debug_sections_none$(EXEEXT): $(flagstest_compress_debug_sections_none_OBJECTS) $(flagstest_compress_debug_sections_none_DEPENDENCIES) 
+@NATIVE_LINKER_FALSE@	@rm -f flagstest_compress_debug_sections_none$(EXEEXT)
+@NATIVE_LINKER_FALSE@	$(LINK) $(flagstest_compress_debug_sections_none_OBJECTS) $(flagstest_compress_debug_sections_none_LDADD) $(LIBS)
 @GCC_FALSE@flagstest_o_specialfile$(EXEEXT): $(flagstest_o_specialfile_OBJECTS) $(flagstest_o_specialfile_DEPENDENCIES) 
 @GCC_FALSE@	@rm -f flagstest_o_specialfile$(EXEEXT)
 @GCC_FALSE@	$(LINK) $(flagstest_o_specialfile_OBJECTS) $(flagstest_o_specialfile_LDADD) $(LIBS)
@@ -3793,6 +3858,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception_test_main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exclude_libs_test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_compress_debug_sections.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_compress_debug_sections_gabi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_compress_debug_sections_gnu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_compress_debug_sections_none.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_o_specialfile.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_o_specialfile_and_compress_debug_sections.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_o_ttext_1.Po@am__quote@
@@ -4554,8 +4622,14 @@ initpri3a.log: initpri3a$(EXEEXT)
 	@p='initpri3a$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 flagstest_o_specialfile.log: flagstest_o_specialfile$(EXEEXT)
 	@p='flagstest_o_specialfile$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+flagstest_compress_debug_sections_none.log: flagstest_compress_debug_sections_none$(EXEEXT)
+	@p='flagstest_compress_debug_sections_none$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 flagstest_compress_debug_sections.log: flagstest_compress_debug_sections$(EXEEXT)
 	@p='flagstest_compress_debug_sections$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+flagstest_compress_debug_sections_gnu.log: flagstest_compress_debug_sections_gnu$(EXEEXT)
+	@p='flagstest_compress_debug_sections_gnu$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+flagstest_compress_debug_sections_gabi.log: flagstest_compress_debug_sections_gabi$(EXEEXT)
+	@p='flagstest_compress_debug_sections_gabi$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 flagstest_o_specialfile_and_compress_debug_sections.log: flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT)
 	@p='flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 flagstest_o_ttext_1.log: flagstest_o_ttext_1$(EXEEXT)
@@ -5460,9 +5534,74 @@ uninstall-am:
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	chmod a+x $@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	test -s $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_none: flagstest_debug.o gcctestdir/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=none
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	test -s $@
+
+# Dump DWARF debug sections.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_none.stdout: flagstest_compress_debug_sections_none
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -w $< > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	test -s $@
+
+# Dump compressed DWARF debug sections.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections.stdout: flagstest_compress_debug_sections
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+
+# Check there are compressed DWARF .zdebug_* sections.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections.check: flagstest_compress_debug_sections
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -SW $< | grep ".zdebug_" > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+
+# Compare DWARF debug info.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections.cmp: flagstest_compress_debug_sections.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_none.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	cmp flagstest_compress_debug_sections.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@		flagstest_compress_debug_sections_none.stdout > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gnu: flagstest_debug.o gcctestdir/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gnu
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	test -s $@
+
+# Dump compressed DWARF debug sections.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gnu.stdout: flagstest_compress_debug_sections_gnu
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -w $< | sed -e "s/.zdebug_/.debug_/" > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+
+# Check there are compressed DWARF .zdebug_* sections.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gnu.check: flagstest_compress_debug_sections_gnu
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -SW $< | grep ".zdebug_" > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+
+# Compare DWARF debug info.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gnu.cmp: flagstest_compress_debug_sections_gnu.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_none.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	cmp flagstest_compress_debug_sections_gnu.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@		flagstest_compress_debug_sections_none.stdout > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gabi: flagstest_debug.o gcctestdir/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib-gabi
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	test -s $@
+
+# Dump compressed DWARF debug sections.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gabi.stdout: flagstest_compress_debug_sections_gabi
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -w $< > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+
+# Check there are compressed DWARF .debug_* sections.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gabi.check: flagstest_compress_debug_sections_gabi
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -tW $< | grep "COMPRESSED" > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
+
+# Compare DWARF debug info.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections_gabi.cmp: flagstest_compress_debug_sections_gabi.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	flagstest_compress_debug_sections_none.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	cmp flagstest_compress_debug_sections_gabi.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@		flagstest_compress_debug_sections_none.stdout > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@		gcctestdir/ld
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
-- 
2.1.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]