diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-07-12 10:56:41 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-07-12 10:56:58 -0700 |
commit | fb8b9dbc147d37129e5a366a395302f532f5d190 (patch) | |
tree | e19ef3d0329c2db4d6d7843c108c715b0b23f193 /gold | |
parent | 480586639d6b814b2e87f6f106b8635cf7442b20 (diff) | |
download | gdb-fb8b9dbc147d37129e5a366a395302f532f5d190.zip gdb-fb8b9dbc147d37129e5a366a395302f532f5d190.tar.gz gdb-fb8b9dbc147d37129e5a366a395302f532f5d190.tar.bz2 |
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.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 43 | ||||
-rw-r--r-- | gold/compressed_output.cc | 89 | ||||
-rw-r--r-- | gold/options.h | 4 | ||||
-rw-r--r-- | gold/output.h | 5 | ||||
-rw-r--r-- | gold/testsuite/Makefile.am | 83 | ||||
-rw-r--r-- | gold/testsuite/Makefile.in | 140 |
6 files changed, 350 insertions, 14 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 93b363a..a8c2507 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,5 +1,48 @@ 2015-07-12 H.J. Lu <hongjiu.lu@intel.com> + 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. + +2015-07-12 H.J. Lu <hongjiu.lu@intel.com> + PR gold/18321 * compressed_output.h (decompress_input_section): Add arguments for ELF class, big endian and sh_flags. diff --git a/gold/compressed_output.cc b/gold/compressed_output.cc index 02d7821..2630330 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,86 @@ Output_compressed_section::set_final_data_size() this->write_to_postprocessing_buffer(); bool success = false; + enum { none, 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 = gnu_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()); + } + this->set_flags(flags); this->set_data_size(compressed_size); } else diff --git a/gold/options.h b/gold/options.h index 455a09d..f4da128 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 9c28c9a..d2f4668 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -1319,8 +1319,22 @@ 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 $@ @@ -1334,6 +1348,73 @@ flagstest_compress_debug_sections_and_build_id_tree: flagstest_debug.o gcctestdi -Wl,--build-id-min-file-size-for-treehash=0 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. check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index 1131512..1c336c6 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. # Test --compress-debug-sections with --build-id=tree. @@ -246,8 +246,11 @@ 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_and_build_id_tree \ +@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 \ @@ -352,6 +355,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 \ @@ -907,8 +920,11 @@ 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_and_build_id_tree$(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) \ @@ -1199,6 +1215,33 @@ flagstest_compress_debug_sections_and_build_id_tree_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) @@ -2051,6 +2094,9 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \ $(exclude_libs_test_SOURCES) \ flagstest_compress_debug_sections.c \ flagstest_compress_debug_sections_and_build_id_tree.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 \ @@ -3096,6 +3142,24 @@ exclude_libs_test$(EXEEXT): $(exclude_libs_test_OBJECTS) $(exclude_libs_test_DEP @NATIVE_LINKER_FALSE@flagstest_compress_debug_sections_and_build_id_tree$(EXEEXT): $(flagstest_compress_debug_sections_and_build_id_tree_OBJECTS) $(flagstest_compress_debug_sections_and_build_id_tree_DEPENDENCIES) @NATIVE_LINKER_FALSE@ @rm -f flagstest_compress_debug_sections_and_build_id_tree$(EXEEXT) @NATIVE_LINKER_FALSE@ $(LINK) $(flagstest_compress_debug_sections_and_build_id_tree_OBJECTS) $(flagstest_compress_debug_sections_and_build_id_tree_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) @@ -3847,6 +3911,9 @@ distclean-compile: @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_and_build_id_tree.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@ @@ -4610,10 +4677,16 @@ 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_and_build_id_tree.log: flagstest_compress_debug_sections_and_build_id_tree$(EXEEXT) @p='flagstest_compress_debug_sections_and_build_id_tree$(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) @@ -5522,6 +5595,14 @@ 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 $@ @@ -5531,6 +5612,63 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@ -Wl,--build-id-chunk-size-for-treehash=4096 \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ -Wl,--build-id-min-file-size-for-treehash=0 @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 > $@ |