summaryrefslogtreecommitdiff
path: root/gold/compressed_output.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update year range in copyright notice of binutils filesAlan Modra2023-01-011-1/+1
| | | | | | The newer update-copyright.py fixes file encoding too, removing cr/lf on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
* Re: gold: add --compress-debug-sections=zstd [PR 29641]Alan Modra2022-11-111-1/+1
| | | | | | Fix the following: compressed_output.cc:86:8: error: assignment of read-only variable ‘size’ 86 | size = ZSTD_compress(*compressed_data + header_size, size, uncompressed_data,
* gold: add --compress-debug-sections=zstd [PR 29641]Fangrui Song2022-11-101-13/+44
| | | | | | | | | This option compresses output debug sections with zstd and sets ch_type to ELFCOMPRESS_ZSTD. Latest gdb and lldb support ELFCOMPRESS_ZSTD. There will be an error if zstd is not enabled at configure time. error: --compress-debug-sections=zstd: gold is not built with zstd support
* gold, dwp: support zstd compressed input debug sections [PR 29641]Fangrui Song2022-11-101-24/+20
| | | | This feature is enabled if config/zstd.m4 uses zstd.
* Update year range in copyright notice of binutils filesAlan Modra2022-01-021-1/+1
| | | | | | | | | | The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
* Update year range in copyright notice of binutils filesAlan Modra2021-01-011-1/+1
|
* Update year range in copyright notice of binutils filesAlan Modra2020-01-011-1/+1
|
* Update year range in copyright notice of binutils filesAlan Modra2019-01-011-1/+1
|
* Update year range in copyright notice of binutils filesAlan Modra2018-01-031-1/+1
|
* gold: Add put_ch_reserved to 64-bit Chdr_writeH.J. Lu2017-07-281-0/+4
| | | | | | | | | | | | | | | | | | The 64-bit ELF compression header has a reserved field. It should be cleared to avoid random bits in it. elfcpp/ PR gold/21857 * elfcpp.h (Chdr_write): Add put_ch_reserved. (Chdr_write<64, true>::put_ch_reserved): New. (Chdr_write<64, false>::put_ch_reserved): Likewise. gold/ PR gold/21857 * compressed_output.cc (Output_compressed_section::set_final_data_size): Call put_ch_reserved to clear the reserved field for 64-bit ELF.
* Update year range in copyright notice of all files.Alan Modra2017-01-021-1/+1
|
* Copyright update for binutilsAlan Modra2016-01-011-1/+1
|
* Make default compression gABI compliantH.J. Lu2015-07-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All programs in binutils+gdb git repo now support gABI compression with the SHF_COMPRESSED bit. This patch makes the zlib-gabi option as compression default for gas, gold, ld and objcopy, instead of the zlib-gnu option whose outputs are incompatible with gABI. binutils/ * objcopy.c (copy_file): Set BFD_COMPRESS_GABI if not zlib-gnu. * doc/binutils.texi: Change --compress-debug-sections and --compress-debug-sections=zlib to zlib-gabi. binutils/testsuite/ * binutils-all/compress.exp: Update. gas/ * as.c (parse_args): Make --compress-debug-sections and --compress-debug-sections=zlib the same as --compress-debug-sections=zlib-gabi. * doc/as.texinfo: Change --compress-debug-sections and --compress-debug-sections=zlib to zlib-gabi. gold/ * compressed_output.cc (Output_compressed_section::set_final_data_size): Make --compress-debug-sections=zlib the same as --compress-debug-sections=zlib-gabi. * testsuite/Makefile.am (flagstest_compress_debug_sections.check): Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of ".zdebug_". * testsuite/Makefile.in: Regenerated. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Make --compress-debug-sections=zlib the same as --compress-debug-sections=zlib-gabi. * ld.texinfo: Change --compress-debug-sections=zlib to zlib-gabi. ld/testsuite/ * ld-elf/zlibbegin.rS: Updated to .debug_.* with the SHF_COMPRESSED bit. * ld-elf/zlibnormal.rS: Likewise.
* Extend --compress-debug-sections in goldH.J. Lu2015-07-121-10/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add SHF_COMPRESSED section decompression to goldH.J. Lu2015-07-121-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SHF_COMPRESSED section decompression to gold. PR gold/18321 * compressed_output.h (decompress_input_section): Add arguments for ELF class, big endian and sh_flags. * compressed_output.cc (decompress_input_section): Likewise. Support the SHF_COMPRESSED section. * dynobj.h (Dynobj): Add elfsize and is_big_endian member functions. * plugin.h (Pluginobj): Likewise. * layout.cc (Layout::get_output_section_flags): Also clear the SHF_COMPRESSED bit. * object.h (Compressed_section_info): Add flag to store sh_flags. (Object): Add pure virtual elfsize and is_big_endian member functions. * object.cc (need_decompressed_section): Don't skip the ".zdebug" prefix here. (build_compressed_section_map): Check SHF_COMPRESSED for uncompressed size. Store sh_flags in Compressed_section_info. Pass size, big_endian and sh_flags to decompress_input_section. Skip the ".debug"/".zdebug" prefix when passing section name to need_decompressed_section. (Sized_relobj_file<size, big_endian>::do_find_special_section): Don't check ".zdebug_*" sections. (Object::decompressed_section_contents): Pass ELF class, big endian and sh_flags to decompress_input_section. * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections): Likewise. * testsuite/Makefile.am (check_DATA): Add debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout. (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout. (debug_msg_cdebug_gabi.o): New. (odr_violation1_cdebug_gabi.o): Likewise. (odr_violation2_cdebug_gabi.o): Likewise. (debug_msg_cdebug_gabi.err): Likewise. (check_SCRIPTS): Add gdb_index_test_2_gabi.sh. (gdb_index_test_cdebug_gabi.o): Likewise. (gdb_index_test_2_gabi): Likewise. (gdb_index_test_2_gabi.stdout): Likewise. * testsuite/gdb_index_test_2_gabi.sh: New file. * testsuite/Makefile.in: Regenerated.
* Regenerate configure in goldH.J. Lu2015-04-011-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Regenerate configure for zlib.m4 change, which adds --with-system-zlib and removes --with-zlib in gold. zlib is enabled unconditionally with builtin zlib imported from GCC. * Makefile.am (ZLIB): New. (ZLIBINC): Likewise. (AM_CFLAGS): Add $(ZLIBINC). (AM_CXXFLAGS): Likewise. (ldadd_varldadd_var): Add $(ZLIB). (incremental_dump_LDADD): Likewise. (dwp_LDADD): Likewise. * compressed_output.cc: Don't check HAVE_ZLIB_H to include <zlib.h>. (zlib_compress): Don't check HAVE_ZLIB_H. (zlib_decompress): Likewise. * options.h (compress_debug_sections): Likewise. * configure.ac (AM_CONDITIONAL): Removed. * testsuite/Makefile.am (ZLIB): New. (LDADD): Add $(ZLIB). Don't check HAVE_ZLIB. * Makefile.in: Regenerated. * config.in: Likewise. * configure: Likewise. * testsuite/Makefile.in: Likewise.
* ChangeLog rotatation and copyright year updateAlan Modra2015-01-021-1/+1
|
* Update copyright yearsAlan Modra2014-03-051-1/+1
|
* * compressed_output.cc (zlib_decompress): Fix signature inIan Lance Taylor2010-07-131-1/+1
| | | | !HAVE_ZLIB_H case.
* * compressed_output.cc (zlib_decompress): New function.Cary Coutant2010-07-121-4/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (get_uncompressed_size): New function. (decompress_input_section): New function. * compressed_output.h (get_uncompressed_size): New function. (decompress_input_section): New function. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info) Handle compressed debug sections. * layout.cc (is_compressed_debug_section): New function. (Layout::output_section_name): Map compressed section names to canonical names. * layout.h (is_compressed_debug_section): New function. (is_debug_info_section): Recognize compressed debug sections. * merge.cc: Include compressed_output.h. (Output_merge_data::do_add_input_section): Handle compressed debug sections. (Output_merge_string::do_add_input_section): Handle compressed debug sections. * object.cc: Include compressed_output.h. (Sized_relobj::Sized_relobj): Initialize new data members. (build_compressed_section_map): New function. (Sized_relobj::do_read_symbols): Handle compressed debug sections. * object.h (Object::section_is_compressed): New method. (Object::do_section_is_compressed): New method. (Sized_relobj::Compressed_section_map): New type. (Sized_relobj::do_section_is_compressed): New method. (Sized_relobj::compressed_sections_): New data member. * output.cc (Output_section::add_input_section): Handle compressed debug sections. * reloc.cc: Include compressed_output.h. (Sized_relobj::write_sections): Handle compressed debug sections.
* Revert -Wshadow changes, all changes from:Ian Lance Taylor2009-12-141-7/+7
| | | | | | 2009-12-11 Doug Kwan <dougkwan@google.com> 2009-12-11 Nick Clifton <nickc@redhat.com> * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
* Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton2009-12-111-7/+7
| | | | Fix up all warnings generated by the addition of this switch.
* * compressed_output.h (class Output_compressed_section): UseIan Lance Taylor2008-04-031-21/+22
| | | | | | | | | | | | | | unsigned buffer. * compressed_output.cc (zlib_compress): Use unsigned buffers, add zlib header. (zlib_compressed_suffix): Removed. (Output_compressed_section::set_final_data_size): Use unsigned buffers. * testsuite/Makefile.am (flagstest_compress_debug_sections): Fix linker invocation. (flagstest_o_specialfile_and_compress_debug_sections): Likewise. * testsuite/Makefile.in: Regenerated.
* Update copyright years. Update language files.Ian Lance Taylor2008-03-131-1/+1
|
* From Craig Silverstein: rework option handling to make it easier toIan Lance Taylor2008-03-041-1/+1
| | | | add a new option.
* From Craig Silverstein: Have Parameters point to General_options.Ian Lance Taylor2008-02-281-1/+1
|
* From Craig Silverstein: rename option functions for future optionIan Lance Taylor2008-02-261-1/+1
| | | | handling rewrite.
* Don't include options.h in fileread.h. Remove General_optionsIan Lance Taylor2008-01-181-0/+1
| | | | reference from Output_file class.
* Compress all debug sections.Ian Lance Taylor2007-12-011-152/+25
|
* From Cary Coutant: Avoid compilation warnings if no zlib.h.Ian Lance Taylor2007-11-301-4/+12
|
* From Craig Silverstein: Add support for compressing .debug_str section.Ian Lance Taylor2007-11-301-0/+267