summaryrefslogtreecommitdiff
path: root/gold/dwp.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update year range in copyright notice of binutils filesAlan Modra2023-01-011-2/+2
| | | | | | 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.
* Update year range in copyright notice of binutils filesAlan Modra2022-01-021-2/+2
| | | | | | | | | | 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-2/+2
|
* Cosmetic improvements for OSABI access.Cary Coutant2020-12-151-2/+2
| | | | | | | | | | | | | | | | | Add accessor methods to elfcpp::Ehdr class for EI_OSABI and EI_ABIVERSION; use those to simplify initialization of Osabi class and eliminate the need to template the class. elfcpp/ * elfcpp.h (class Ehdr): Add get_ei_osabi and get_ei_abiversion methods. gold/ * dwp.cc (class Dwo_file): Use new Ehdr::get_ei_osabi and get_ei_abiversion methods. * incremental.cc (make_sized_incremental_binary): Likewise. * object.cc (Sized_relobj_file::Sized_relobj_file): Likewise. (make_elf_sized_object): Likewise. * object.h (class Osabi): Make the class untemplated.
* Update year range in copyright notice of binutils filesAlan Modra2020-01-011-2/+2
|
* Update year range in copyright notice of binutils filesAlan Modra2019-01-011-2/+2
|
* Update year range in copyright notice of binutils filesAlan Modra2018-01-031-2/+2
|
* Update year range in copyright notice of all files.Alan Modra2017-01-021-2/+2
|
* Copyright update for binutilsAlan Modra2016-01-011-2/+2
|
* Support compressed debug sections in dynamic object files.Cary Coutant2015-03-211-45/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for reading compressed debug info in shared objects. It actually simplifies things, by moving the support for compressed sections all the way up to the top-level Object class, eliminating the need for several virtual methods. gold/ * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete. (Sized_relobj_dwo::setup): Build compressed section map. (Sized_relobj_dwo::do_decompressed_section_contents): Delete. * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed section map. * object.cc (Sized_relobj_file::Sized_relobj_file): Remove compressed_sections_ field. (build_compressed_section_map): Take Object instead of Sized_relobj_file parameter; add decompress_if_needed parameter. (Sized_relobj_file::do_find_special_sections): Store compressed section map in parent Object. (Sized_relobj_file::do_decompressed_section_contents): Move implementation to Object::decompressed_section_contents. (Sized_relobj_file::do_discard_decompressed_sections): Move implementation to Object::discard_decompressed_sections. * object.h (build_compressed_section_map): Declare. (Object::Object): Add compressed_sections_ field. (Object::section_is_compressed): Move implementation here. (Object::decompressed_section_contents): De-virtualize. (Object::discard_decompressed_sections): De-virtualize. (Object::do_section_is_compressed): Delete. (Object::do_decompressed_section_contents): Delete. (Object::set_compressed_sections): New method. (Object::compressed_sections): New method. (Object::compressed_sections_): New data member. (Compressed_section_info, Compressed_section_map): Move to top of file. (Sized_relobj_file::do_section_is_compressed): Delete. (Sized_relobj_file::do_decompressed_section_contents): Delete. (Sized_relobj_file::do_discard_decompressed_sections): Delete. (Sized_relobj_file::compressed_sections_): Move to Object class.
* Correct printed year in copyright notices for gold.Alan Modra2015-01-021-1/+1
|
* ChangeLog rotatation and copyright year updateAlan Modra2015-01-021-2/+2
|
* Make Elf_file::section_name() a const function, so that it can be used inCary Coutant2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | places where we have only a const Elf_file*. elfcpp/ * elfcpp_file.h (Elf_file::shnum): New const function. (Elf_file::shstrndx): New const function. (Elf_file::large_shndx_offset): New const function. (Elf_file::section_name): Add const attribute. (Elf_file::section_header_offset): Likewise. gold/ * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute. * dynobj.h (Sized_dynobj::do_section_name): Likewise. * incremental.cc (Sized_relobj_incr::do_section_name): Likewise. (Sized_incr_dynobj::do_section_name): Likewise. * incremental.h (Sized_relobj_incr::do_section_name): Likewise. (Sized_incr_dynobj::do_section_name): Likewise. * object.h (Object::section_name): Likewise. (Object::do_section_name): Likewise. (Sized_relobj_file::do_section_name): Likewise. * plugin.cc (Sized_pluginobj::do_section_name): Likewise. * plugin.h (Sized_pluginobj::do_section_name): Likewise.
* Fix dwp to allow intermediate .dwp files with no .debug_types sections.Cary Coutant2014-06-241-4/+9
| | | | | | | gold/ * dwp.cc (Dwo_file::read): Allow files with no .debug_types sections. (Dwo_file::sized_read_unit_index): Likewise.
* Update copyright yearsAlan Modra2014-03-051-2/+2
|
* Fix various copyright issuesAlan Modra2014-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | binutils/ * README: Add "Copyright Notices" paragraph. gas/ * config/bfin-lex-wrapper.c: Correct copyright date. * config/tc-frv.c: Correct copyright punctuation. * config/tc-ip2k.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-mep.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic4x.h: Likewise. ld/testsuite/ * ld-scripts/phdrs2.exp: Correct copyright punctuation. * ld-v850/v850.exp: Correct copyright typo. opcodes/ * i386-gen.c (process_copyright): Emit copyright notice on one line. gold/ * dwp.cc (print_version): Update copyright year to current.
* Add --verify-only option to DWP.Cary Coutant2013-11-141-9/+192
| | | | | | | | | | | | | | | | gold/ * dwp.cc (Dwo_file_entry): New type. (File_list): Use Dwo_file_entry. (Dwo_file::verify): New function. (Dwo_file::verify_dwo_list): New function. (Dwo_file::sized_verify_dwo_list): New function. (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file list. (Dwp_options): New enum type. (dwp_options): Add --verify-only. (usage): Likewise. (main): Likewise. * dwp.h (gold_info): Add declaration.
* Restore support for dwp v2 DWARF package file format.Cary Coutant2013-10-311-541/+598
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gold/ * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add tu_length parameter. Adjust all callers. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise. * dwp.cc: Include dwarf.h. (Section_bounds): New struct type. (Unit_set): New struct type. (Dwo_file::Dwo_file): Initialize new data member. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index): Combine and rename to... (Dwo_file::read_unit_index): ...this. (Dwo_file::sized_read_compunit_index) (Dwo_file::sized_read_typeunit_index): Combine and rename to... (Dwo_file::sized_read_unit_index): ...this. (Dwo_file::copy_section): Remove section_name, is_str_offsets parameters; add section_id parameter. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to... (Dwo_file::add_unit_set): ...this. (Dwo_file::shndx_map_): Remove. (Dwo_file::sect_offsets_): New data member. (Dwp_output_file::Dwp_output_file): Initialize new data members. (Dwp_output_file::add_section): Rename to... (Dwp_output_file::add_contribution): ...this. (Dwp_output_file::add_cu_set): Combine parameters into a struct. (Dwp_output_file::add_tu_set): Likewise. (Dwp_output_file::Contribution): New type. (Dwp_output_file::Section::contributions): New data member. (Dwp_output_file::Cu_or_tu_set): Remove. (Dwp_output_file::Section::Section): New ctor. (Dwp_output_file::Dwp_index::Shndx_pool): Remove. (Dwp_output_file::Dwp_index::Section_table): New type. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members. (Dwp_output_file::Dwp_index::enter_set): Change type of "set" parameter. (Dwp_output_file::Dwp_index::shndx_pool): Remove. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove. (Dwp_output_file::Dwp_index::section_table): New member function. (Dwp_output_file::Dwp_index::section_table_end): New member function. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove. (Dwp_output_file::Dwp_index::section_table_rows): New member function. (Dwp_output_file::Dwp_index::section_table_cols): New member function. (Dwp_output_file::Dwp_index::shndx_pool_): Remove. (Dwp_output_file::Dwp_index::section_table_): New data member. (Dwp_output_file::Dwp_index::section_mask_): New data member. (Dwp_output_file::add_output_section): New member function. (Dwp_output_file::write_new_section): New member function. (Dwp_output_file::write_contributions): New member function. (Dwp_output_file::section_id_map_): New data member. (class Dwo_id_info_reader): Remove. (class Unit_reader): New class. (get_dwarf_section_name): New function. (Dwo_file::read_executable): Adjust initializations of class data. (Dwo_file::read): Add support for v2 package file format. (Dwo_file::read_unit_index): Likewise. (Dwo_file::sized_read_unit_index): Likewise. (Dwo_file::copy_section): Likewise. (Dwo_file::add_unit_set): Likewise. (Dwp_output_file::add_output_section): Likewise. (Dwp_output_file::add_contribution): Likewise. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check for empty slot. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package file format. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty slot. (Dwp_output_file::initialize): Remove unused function. (Dwp_output_file::finalize): Add support for v2 package file format. (Dwp_output_file::write_index): Likewise. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust function prototype.
* gold/Cary Coutant2013-08-071-598/+541
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert support for v2 DWP files: 2013-03-01 Cary Coutant <ccoutant@google.com> Add dwp support for v2 DWARF package file format. * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add tu_length parameter. Adjust all callers. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise. * dwp.cc: Include dwarf.h. (Section_bounds): New struct type. (Unit_set): New struct type. (Dwo_file::Dwo_file): Initialize new data member. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index): Combine and rename to... (Dwo_file::read_unit_index): ...this. (Dwo_file::sized_read_compunit_index) (Dwo_file::sized_read_typeunit_index): Combine and rename to... (Dwo_file::sized_read_unit_index): ...this. (Dwo_file::copy_section): Remove section_name, is_str_offsets parameters; add section_id parameter. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to... (Dwo_file::add_unit_set): ...this. (Dwo_file::shndx_map_): Remove. (Dwo_file::sect_offsets_): New data member. (Dwp_output_file::Dwp_output_file): Initialize new data members. (Dwp_output_file::add_section): Rename to... (Dwp_output_file::add_contribution): ...this. (Dwp_output_file::add_cu_set): Combine parameters into a struct. (Dwp_output_file::add_tu_set): Likewise. (Dwp_output_file::Contribution): New type. (Dwp_output_file::Section::contributions): New data member. (Dwp_output_file::Cu_or_tu_set): Remove. (Dwp_output_file::Section::Section): New ctor. (Dwp_output_file::Dwp_index::Shndx_pool): Remove. (Dwp_output_file::Dwp_index::Section_table): New type. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members. (Dwp_output_file::Dwp_index::enter_set): Change type of "set" parameter. (Dwp_output_file::Dwp_index::shndx_pool): Remove. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove. (Dwp_output_file::Dwp_index::section_table): New member function. (Dwp_output_file::Dwp_index::section_table_end): New member function. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove. (Dwp_output_file::Dwp_index::section_table_rows): New member function. (Dwp_output_file::Dwp_index::section_table_cols): New member function. (Dwp_output_file::Dwp_index::shndx_pool_): Remove. (Dwp_output_file::Dwp_index::section_table_): New data member. (Dwp_output_file::Dwp_index::section_mask_): New data member. (Dwp_output_file::add_output_section): New member function. (Dwp_output_file::write_new_section): New member function. (Dwp_output_file::write_contributions): New member function. (Dwp_output_file::section_id_map_): New data member. (class Dwo_id_info_reader): Remove. (class Unit_reader): New class. (get_dwarf_section_name): New function. (Dwo_file::read_executable): Adjust initializations of class data. (Dwo_file::read): Add support for v2 package file format. (Dwo_file::read_unit_index): Likewise. (Dwo_file::sized_read_unit_index): Likewise. (Dwo_file::copy_section): Likewise. (Dwo_file::add_unit_set): Likewise. (Dwp_output_file::add_output_section): Likewise. (Dwp_output_file::add_contribution): Likewise. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check for empty slot. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package file format. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty slot. (Dwp_output_file::initialize): Remove unused function. (Dwp_output_file::finalize): Add support for v2 package file format. (Dwp_output_file::write_index): Likewise. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust function prototype.
* * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsignedAlan Modra2013-03-211-1/+1
| | | | | | comparison warning. * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used uninitialized" warning.
* Add dwp support for v2 DWARF package file format.Cary Coutant2013-03-011-541/+598
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gold/ * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add tu_length parameter. Adjust all callers. * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise. * dwp.cc: Include dwarf.h. (Section_bounds): New struct type. (Unit_set): New struct type. (Dwo_file::Dwo_file): Initialize new data member. (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index): Combine and rename to... (Dwo_file::read_unit_index): ...this. (Dwo_file::sized_read_compunit_index) (Dwo_file::sized_read_typeunit_index): Combine and rename to... (Dwo_file::sized_read_unit_index): ...this. (Dwo_file::copy_section): Remove section_name, is_str_offsets parameters; add section_id parameter. (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to... (Dwo_file::add_unit_set): ...this. (Dwo_file::shndx_map_): Remove. (Dwo_file::sect_offsets_): New data member. (Dwp_output_file::Dwp_output_file): Initialize new data members. (Dwp_output_file::add_section): Rename to... (Dwp_output_file::add_contribution): ...this. (Dwp_output_file::add_cu_set): Combine parameters into a struct. (Dwp_output_file::add_tu_set): Likewise. (Dwp_output_file::Contribution): New type. (Dwp_output_file::Section::contributions): New data member. (Dwp_output_file::Cu_or_tu_set): Remove. (Dwp_output_file::Section::Section): New ctor. (Dwp_output_file::Dwp_index::Shndx_pool): Remove. (Dwp_output_file::Dwp_index::Section_table): New type. (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members. (Dwp_output_file::Dwp_index::enter_set): Change type of "set" parameter. (Dwp_output_file::Dwp_index::shndx_pool): Remove. (Dwp_output_file::Dwp_index::shndx_pool_end): Remove. (Dwp_output_file::Dwp_index::section_table): New member function. (Dwp_output_file::Dwp_index::section_table_end): New member function. (Dwp_output_file::Dwp_index::shndx_pool_size): Remove. (Dwp_output_file::Dwp_index::section_table_rows): New member function. (Dwp_output_file::Dwp_index::section_table_cols): New member function. (Dwp_output_file::Dwp_index::shndx_pool_): Remove. (Dwp_output_file::Dwp_index::section_table_): New data member. (Dwp_output_file::Dwp_index::section_mask_): New data member. (Dwp_output_file::add_output_section): New member function. (Dwp_output_file::write_new_section): New member function. (Dwp_output_file::write_contributions): New member function. (Dwp_output_file::section_id_map_): New data member. (class Dwo_id_info_reader): Remove. (class Unit_reader): New class. (get_dwarf_section_name): New function. (Dwo_file::read_executable): Adjust initializations of class data. (Dwo_file::read): Add support for v2 package file format. (Dwo_file::read_unit_index): Likewise. (Dwo_file::sized_read_unit_index): Likewise. (Dwo_file::copy_section): Likewise. (Dwo_file::add_unit_set): Likewise. (Dwp_output_file::add_output_section): Likewise. (Dwp_output_file::add_contribution): Likewise. (Dwp_output_file::Dwp_index::find_or_add): Use row index to check for empty slot. (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package file format. (Dwp_output_file::Dwp_index::grow): Use row index to check for empty slot. (Dwp_output_file::initialize): Remove unused function. (Dwp_output_file::finalize): Add support for v2 package file format. (Dwp_output_file::write_index): Likewise. * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust function prototype.
* gold/Cary Coutant2013-01-291-79/+191
| | | | | | | | | | | | | | * dwp.cc (File_list): New typedef. (Dwo_name_info_reader): New class. (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters. (Dwo_id_info_reader::visit_top_die): Remove unused member function. (Dwo_file::~Dwo_file): Delete input_file_ after obj_. (Dwo_file::read_executable): New function. (Dwo_file::read): Move common setup code to ... (Dwo_file::make_object): ... here. (dwp_options): Add --exec/-e. (usage): Likewise. (main): Likewise.
* gold/Cary Coutant2012-12-151-2/+6
| | | | | * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs. (Dwp_output_file::Dwp_index::enter_set): Add assert.
* gold/Cary Coutant2012-10-291-12/+44
| | | | | | | * dwp.cc (usage): Add file and exit status parameters; add --help and --version options. (print_version): New function. (main): Add --help and --version options.
* Issue a fatal error on bad fwrite returnH.J. Lu2012-10-251-1/+3
| | | | | * dwp.cc (Dwo_file::record_target_info): Issue a fatal error on bad fwrite return.
* Use section_offset_type in remap_str_offsetH.J. Lu2012-10-251-2/+2
| | | | | * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type on val.
* gold/Cary Coutant2012-10-241-0/+2074
* dwp.h: New header file. * dwp.cc: New source file. * gold.h: Move shared declarations to system.h. * system.h: New header file. * Makefile.am: Add dwp. * Makefile.in: Regenerate.