aboutsummaryrefslogtreecommitdiff
path: root/gold/options.h
AgeCommit message (Collapse)AuthorFilesLines
2016-09-02Handle ARM-specific --target1-abs, --target1-rel and --target2 optionsDoug Kwan1-0/+11
2016-08-23[gold] Implement -z stack-size optionRoland McGrath1-2/+4
gold/ * options.h (General_options): Grok -z stack-size. * output.h (Output_segment::set_size): New method. * layout.cc (Layout::create_executable_stack_info): Renamed to ... (Layout::create_stack_segment): ... this. Always create the segment if -z stack-size was used. (Layout::set_segment_offsets): Don't call ->set_offset on the PT_GNU_STACK segment.
2016-08-23Add --be8 option to gold.Bharathi Seshadri1-0/+3
gold/ * options.h (General_options): Add --be8 option. * arm.cc (Arm_relobj::do_relocate_sections): Add code to swap for be8. (Output_data_plt_arm_standard::do_fill_first_plt_entry): Likewise. (Output_data_plt_arm_short::do_fill_plt_entry): Likewise. (Output_data_plt_arm_long::do_fill_plt_entry): Likewise. (Target_arm::do_adjust_elf_header): Do EF_ARM_BE8 adjustment.
2016-06-22gold: Add a linker configure option --enable-relroH.J. Lu1-1/+1
Add a configure option --enable-relro to decide whether -z relro should be enabled by default. Default to yes. PR ld/20283 * NEWS: Mention --enable-relro. * configure.ac: Add --enable-relro. (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default to 1. * config.in: Regenerated. * configure: Likewise. * options.h (General_options::relro): Default to DEFAULT_LD_Z_RELRO.
2016-01-01Copyright update for binutilsAlan Modra1-1/+1
2015-12-17Implement --long-plt flag (ARM only).Peter Collingbourne1-0/+4
gold/ PR gold/18780 * arm.cc (Target_arm::do_make_data_plt): Choose PLT generator based on value of --long-plt flag. (Output_data_plt_arm_standard::do_get_plt_entry_size): Moved to Output_data_plt_arm_short. (Output_data_plt_arm_standard::do_fill_plt_entry): Likewise. (Output_data_plt_arm_standard::plt_entry): Likewise. (Output_data_plt_arm_standard::do_fill_first_plt_entry): Fix variable reference. (Output_data_plt_arm_short): New class. (Output_data_plt_arm_short::do_fill_plt_entry): Error out on too large PLT offsets instead of asserting. (Output_data_plt_arm_long): New class. * options.h (General_options): Define --long-plt flag.
2015-11-05Revert patch for PR 19119, which led to PR 19172 and 19197.Cary Coutant1-1/+1
Gold does not support all the emulations that Gnu ld does, and supports only one spelling per target. The -m option is used only in the rare case where there are no ELF input files, and we produce an empty output file. In those cases, users are expected to supply a -m option naming one of the supported emulations. In the many cases where a build script provides an unnecessary -m option naming an emulation that gold does not support, we will simply ignore the option, as we did before the reverted patch. gold/ PR gold/19119 PR gold/19172 PR gold/19197 Revert commit 6457197210144f50a696097c0d308d81d46d5510: 2015-10-16 H.J. Lu <hongjiu.lu@intel.com> * options.h (General_options): Remove "obsolete" from -m. * parameters.cc (set_parameters_target): Check if input target is compatible with output emulation set by "-m emulation".
2015-11-05Add aarch64-specific --no-apply-dynamic-relocs option.Cary Coutant1-0/+5
With --no-apply-dynamic-relocs on aarch64 targets, gold will not apply link-time values for absolute relocations that become dynamic relocations. This provides a workaround for broken Android dynamic linkers that use the link-time value as an extra addend to the relocation. gold/ PR gold/19163 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply certain relocations if --no-apply-dynamic-relocs is set. * options.h (--apply-dynamic-relocs): New aarch64-specific option.
2015-10-16Don't ignore "-m emulation" command line optionH.J. Lu1-1/+1
Gold shouldn't ignore "-m emulation" command line option, which may lead to incorrect output. PR gold/19119 * options.h (General_options): Remove "obsolete" from -m. * parameters.cc (set_parameters_target): Check if input target is compatible with output emulation set by "-m emulation".
2015-07-232015-07-23 Ian Coolidge <icoolidge@google.com>Han Shen1-0/+4
Plumb --pic-veneer option for gold. gold/ChangeLog: * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub generation. * options.h (General_options): Add --pic-veneer option.
2015-07-12Extend --compress-debug-sections in goldH.J. Lu1-2/+2
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.
2015-06-12[gold][aarch64] Fix erratum 835769.Han Shen1-3/+6
gold/ChangeLog: * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move defintion outside class definition. (AArch64_insn_utilities::AARCH64_ZR): New static constant. (AArch64_insn_utilities::aarch64_op31): New member. (AArch64_insn_utilities::aarch64_ra): New member. (AArch64_insn_utilities::aarch64_mac): New member. (AArch64_insn_utilities::aarch64_mlxl): New member. (ST_E_835769): New global enum member. (Stub_table::relocate_stubs): Add 835769 handler. (Stub_template_repertoire::Stub_template_repertoire): Install new stub type. (AArch64_relobj::scan_errata): This func is renamed from scan_erratum_843419. (AArch64_relobj::do_count_local_symbols): Add 835769 handler. (AArch64_relobj::do_relocate_sections): Add 835769 handler. (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler. (Target_aarch64::scan_erratum_835769_span): New method. (Target_aarch64::create_erratum_stub): New method. (Target_aarch64::is_erratum_835769_sequence): New method. (Target_aarch64::scan_erratum_843419_sequence): Move part of the code into create_erratum_stub. * options.h (fix_cortex_a53_835769): New option.
2015-06-04Change default to discard temporary local symbols in merge sections.Cary Coutant1-4/+33
Add --discard-none to keep all local symbols. gold/ PR gold/17498 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard temporary locals in merge sections. * options.cc (General_options::parse_discard_all): New method. (General_options::parse_discard_locals): New method. (General_options::parse_discard_none): New method. (General_options::General_options): Initialize discard_locals_. * options.h (--discard-all): Convert to special option. (--discard-locals): Likewise. (--discard-none): New option. (General_options::discard_all): New method. (General_options::discard_locals): New method. (General_options::discard_sec_merge): New method. (General_options::Discard_locals): New enum. (General_options::discard_locals_): New data member.
2015-04-27[gold] Rename '--fix-cortex-a53' to '--fix-cortex-a53-843419'.Han Shen1-3/+4
Keep gold consistent with bfd erratum-fixing option names, so as to ease life in Makefile/scripts. gold/ * options.h (--fix-cortex-a53-843419): Rename option. * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed option. (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
2015-04-23Add option --weak-unresolved-symbols to treat unresolved symbols as weak ref.Sriraman Tallam1-0/+3
This patch adds option --weak-unresolved-symbols to treat unresolved symbols as weak references. This is helpful when we want the link to succeed with unresolved symbols and the dynamic loader to not complain at run-time. Option --warn-unresolved-symbols lets the link succeed but could fail at run-time with unresolved symbol warnings especially when the unresolved symbols have GOT entries and dynamic relocations against them, like when -fPIE is used.
2015-04-16[gold] The first patch to address cortex-a53 erratum-843419.Han Shen1-0/+4
It implemented scanning the binary and reporting occurrences to users when '--fix-cortex-a53' is turned on. With this, gold users will be able to see if or not there are such erratum occurrences in the output binary. Also included in the CL is reading/recording mapping symbols, which is needed during scan. gold/ChangeLog: * aarch64.cc (AArch64_insn_utilities): New utility class. (AArch64_relobj::Mapping_symbol_position): New struct. (AArch64_relobj::Mapping_symbol_info): New typedef. (AArch64_relobj::do_count_local_symbols): New function overriding parent's implementation. (AArch64_relobj::mapping_symbol_info_): New member (AArch64_relobj::scan_erratum_843419): New method. (Target_aarch64::scan_erratum_843419_span): New method. (Target_aarch64::is_erratum_843419_sequence): New method. * options.h (fix_cortex_a53): New option.
2015-04-01Regenerate configure in goldH.J. Lu1-7/+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.
2015-01-02ChangeLog rotatation and copyright year updateAlan Modra1-1/+1
2014-12-01Add support for -z global.Dmitriy Ivanov1-0/+3
gold/ * layout.cc (Layout::finish_dynamic_section): When '-z global' is specified set DF_1_GLOBAL in DT_FLAGS_1 flags. * options.h (General_options): New -z option (global).
2014-09-292014-09-29 Sriraman Tallam <tmsriram@google.com>Sriraman Tallam1-1/+2
* options.h (--pic-executable): Add negative to alias to -no-pie.
2014-08-13Add option -no-pie.Sriraman Tallam1-1/+2
2014-03-05Update copyright yearsAlan Modra1-2/+1
2014-02-05Fix problems with the --dynamic-list option.Cary Coutant1-0/+7
PR gold/13577 complains that even though symbols listed in the --dynamic-list script are exported, they are still bound symbolically if -Bsymbolic is also used. There are two underlying problems here. First, -Bsymbolic should be overridden by --dynamic-list, since the dynamic list provides an explicit list of symbols that are not bound within the library, and if we go ahead and set DT_SYMBOLIC, then the dynamic loader will bind it within the library anyway. Second, gold did not properly identify the symbols listed in the file as preemptible. PR gold/16530 complains that symbols listed in the --dynamic-list script can still be garbage collected. I've fixed this by checking the symbols as they're added to the symbol table. (Unlike the --export-dynamic-symbol option, we can't iterate over the list, because the --dynamic-list script can have wildcards in it.) gold/ 2014-02-05 Cary Coutant <ccoutant@google.com> PR gold/13577 * options.cc (General_options::parse_dynamic_list): Set have_dynamic_list_. (General_options::General_options): Initialize have_dynamic_list_. (General_options::finalize): Turn off -Bsymbolic and -Bsymbolic-functions if --dynamic-list provided. * options.h (General_options::have_dynamic_list): New function. (General_options::have_dynamic_list_): New data member. * symtab.h (Symbol::is_preemptible): Handle --dynamic-list correctly. PR gold/16530 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named in --dynamic-list, mark it. * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case. (dynamic_list_2): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/dynamic_list_2.cc: New file. * testsuite/dynamic_list_2.t: New file. * testsuite/dynamic_list_lib1.cc: New file. * testsuite/dynamic_list_lib2.cc: New file. * testsuite/gc_dynamic_list_test.c: New file. * testsuite/gc_dynamic_list_test.sh: New file. * testsuite/gc_dynamic_list_test.t: New file.
2013-07-19gold/Roland McGrath1-0/+2
* options.h (General_options): Add -Trodata-segment option. * parameters.cc (Parameters::check_rodata_segment): New function. (Parameters::set_target_once): Call it. * parameters.h (Parameters): Declare it (private member function). * layout.cc (load_seg_unusable_for_headers): New function, broken out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr() then validate rodata segment rather than text segment. (relaxation_loop_body): Call that. (is_text_segment): New function. Don't admit a non-executable segment if TARGET->isolate_execinstr(). (set_segment_offsets): Call it. Honor -Trodata-segment option.
2013-05-302013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>Cary Coutant1-0/+6
Sriraman Tallam <tmsriram@google.com> * options.h (sort_section): New option. * output.h (Input_section_sort_section_prefix_special_ordering_compare): Rename from Input_section_sort_section_name_special_ordering_compare. (Input_section_sort_section_name_compare): New struct. * output.cc (Output_section::Input_section_sort_section_name_compare:: operator()): New function. (Output_section::sort_attached_input_sections): Use new sort function for .text if --sort-section=name is specified. * layout.cc (Layout::make_output_section): Add sorting by name when --sort-section=name is specified. * testsuite/Makefile.am (text_section_grouping): Test option --sort-section=name. * testsuite/Makefile.in: Regenerate. * testsuite/section_sorting_name.cc: New file. * testsuite/section_sorting_name.sh: New file.
2013-05-10gold/Roland McGrath1-0/+4
* options.h (General_options): Add --rosegment-gap option. * options.cc (finalize): --rosegment-gap implies --rosegment. * layout.cc (set_segment_offsets): Let user option override target->rosegment_gap().
2013-05-10gold/Roland McGrath1-214/+215
* options.h (General_options): Remove leading space from help messages for -nostdlib and --rosegment.
2013-04-262013-04-26 Geoff Pike <gpike@chromium.org>Cary Coutant1-1/+10
gold/ * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks(). * layout.cc (Hash_task): New class. (Layout::queue_build_id_tasks): New function. (Layout::write_build_id): Handle single-thread portion of build ID computation. (In some cases, all of it is single-threaded.) Replace {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same functionality in fewer lines of code. * layout.h (Layout::queue_build_id_tasks): New function declaration. * options.h (General_options): make "--build-id" default to tree rather than sha1. Add two new options related to --build-id=tree: --build-id-chunk-size-for-treehash and --build-id-min-file-size-for-treehash. * Makefile.am: add testing of --build-id=tree and related new options (these tests will be invoked by "make check"). * Makefile.in: Regenerate.
2013-02-15 * options.h (DEFINE_uint64_alias): Define.Ian Lance Taylor1-0/+29
(class General_options): Add -Ttext-segment as an alias for -Ttext.
2013-01-24Default text reordering fix with a flag to turn it off.Sriraman Tallam1-0/+5
2013-01-24 Sriraman Tallam <tmsriram@google.com> * layout.cc (Layout::layout): Check for option text_reorder. (Layout::make_output_section): Ditto. * options.h (text_reorder): New option. * output.cc (Input_section_sort_compare): Remove special ordering of section names. (Output_section:: Input_section_sort_section_name_special_ordering_compare:: operator()): New function. (Output_section::sort_attached_input_sections): Use new sort function for .text. * output.h (Input_section_sort_section_name_special_ordering_compare): New struct. * testsuite/Makefile.am (text_section_grouping): Test option --no-text-reorder * testsuite/Makefile.in: Regenerate. * testsuite/text_section_grouping.sh: Check order of functions without default text reordering.
2013-01-18gold: enable new dtags by defaultMike Frysinger1-1/+1
The "new" dtags options have been around for 14+ years, and for all the targets that gold supports, these flags have always existed. So enable them by default. Having behavior be different from ld.bfd isn't new, and this behavior is the "better" one, so there shouldn't be a problem based on that. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-01-07Add -fuse-ld= for GCC linker option compatibilityH.J. Lu1-0/+4
* options.h (General_options): Add -fuse-ld= for GCC linker option compatibility.
2012-12-12 * options.h (General_options): Add --toc-sort/--no-toc-sort.Alan Modra1-2/+7
Replace no_toc_optimize with toc_optimize. * output.h (Output_section::input_sections): Provide non-const variant. * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_, set_has_small_toc_reloc, has_small_toc_reloc): New variable and accessors. (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc. (class Sort_toc_sections): New. (Target_powerpc::do_finalize_sections): Sort toc sections. (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2012-12-07 * options.h (General_options): Add no_toc_optimize.Alan Modra1-0/+3
* powerpc.cc (ok_lo_toc_insn): New function. (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2012-12-06 * options.h (General_options): Add plt_align, plt_static_chain,Alan Modra1-3/+16
plt_thread_safe. Update stub_group_size help text. * powerpc.cc (Target_powerpc::plt_thread_safe): New access function for new plt_thread_safe_ var. (use_plt_offset): Correct comments. (Target_powerpc::do_relax): Look for thread creation symbols to determine default plt_thread_safe value. Clear plt call stubs as well as branch stubs each iteration. (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New insn constants. (l, hi, ha, write_insn): Move earlier. (Stub_table): Delete prev_size, add last_plt_size and last_branch_size. (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear plt stubs too. (Stub_table::update_size): Adjust. (Stub_table::prev_size, set_prev_size): Delete. (Stub_table::stub_align): Let --plt-align affect result. (Stub_table::plt_call_size): Calculate sizes for various stubs. (Stub_table::branch_stub_size): Use last_plt_size in address calc. (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size. (Stub_table::do_write): Support more stub variants.
2012-06-07gold/Cary Coutant1-1/+1
* layout.cc (gdb_sections): Remove ".debug_" prefixes, add .debug_macro. (lines_only_debug_sections): Likewise. (gdb_fast_lookup_sections): New static array. (is_gdb_debug_section): Rename formal parameter. (is_lines_only_debug_section): Likewise. (is_gdb_fast_lookup_section): New function. (Layout::include_section): Check for ".zdebug_" prefix; pass section name suffix to is_gdb_debug_section, et al.; check for fast-lookup sections when building .gdb_index. * options.h (--strip-debug-gdb): Update GDB version number.
2012-06-06gold/Cary Coutant1-0/+9
* configure.ac: Add check for fallocate. * configure: Regenerate. * config.in: Regenerate. * options.h (class General_options): Add --mmap-output-file and --posix-fallocate options. * output.cc: (posix_fallocate): Remove; replace with... (gold_fallocate): New function. (Output_file::map_no_anonymous): Call gold_fallocate. (Output_file::map): Check --mmap-output-file option.
2012-04-17 * archive.cc (Library_base::should_include_member): Check forCary Coutant1-0/+3
--export-dynamic-symbol. * options.h (class General_options): Add --export-dynamic-symbol. * symtab.cc (Symbol::should_add_dynsym_entry): Check for --export-dynamic-symbol. (Symbol_table::gc_mark_undef_symbols): Likewise. (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2012-03-212012-03-21 Cary Coutant <ccoutant@google.com>Cary Coutant1-0/+4
* Makefile.am: Add gdb-index.cc, gdb-index.h. * Makefile.in: Regenerate. * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function. (Sized_elf_reloc_mapper::symbol_section): New function. (Sized_elf_reloc_mapper::do_get_reloc_target): New function. (make_elf_reloc_mapper): New function. (Dwarf_abbrev_table::clear_abbrev_codes): New function. (Dwarf_abbrev_table::do_read_abbrevs): New function. (Dwarf_abbrev_table::do_get_abbrev): New function. (Dwarf_ranges_table::read_ranges_table): New function. (Dwarf_ranges_table::read_range_list): New function. (Dwarf_pubnames_table::read_section): New function. (Dwarf_pubnames_table::read_header): New function. (Dwarf_pubnames_table::next_name): New function. (Dwarf_die::Dwarf_die): New function. (Dwarf_die::read_attributes): New function. (Dwarf_die::skip_attributes): New function. (Dwarf_die::set_name): New function. (Dwarf_die::set_linkage_name): New function. (Dwarf_die::attribute): New function. (Dwarf_die::string_attribute): New function. (Dwarf_die::int_attribute): New function. (Dwarf_die::uint_attribute): New function. (Dwarf_die::ref_attribute): New function. (Dwarf_die::child_offset): New function. (Dwarf_die::sibling_offset): New function. (Dwarf_info_reader::check_buffer): New function. (Dwarf_info_reader::parse): New function. (Dwarf_info_reader::do_parse): New function. (Dwarf_info_reader::do_read_string_table): New function. (Dwarf_info_reader::lookup_reloc): New function. (Dwarf_info_reader::get_string): New function. (Dwarf_info_reader::visit_compilation_unit): New function. (Dwarf_info_reader::visit_type_unit): New function. (Sized_dwarf_line_info::Sized_dwarf_line_info): Use Sized_elf_reloc_mapper. (Sized_dwarf_line_info::symbol_section): Remove function. (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper. (Sized_dwarf_line_info::read_line_mappings): Remove object parameter, adjust callers. (Sized_dwarf_line_info::format_file_lineno): Fix type of cast. * dwarf_reader.h: Include <sys/types.h>. (class Track_relocs): Remove forward declaration. (class Elf_reloc_mapper): New class. (class Sized_elf_reloc_mapper): New class. (class Dwarf_abbrev_table): New class. (class Dwarf_range_list): New class. (class Dwarf_ranges_table): New class. (class Dwarf_pubnames_table): New class. (class Dwarf_die): New class. (class Dwarf_info_reader): New class. (Sized_dwarf_line_info::read_line_mappings): Remove object parameter. (Sized_dwarf_line_info::symbol_section): Remove member function. * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from base class. * gdb-index.cc: New source file. * gdb-index.h: New source file. * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info and .debug_types sections, call Layout::add_to_gdb_index. (Sized_relobj_incr::do_section_name): Implement. (Sized_relobj_incr::do_section_contents): Adjust parameter list and return type; Implement. (Sized_incr_dynobj::do_section_contents): Adjust parameter list and return type. * incremental.h (Sized_relobj_incr::do_section_contents): Adjust parameter list and return type. (Sized_incr_dynobj::do_section_contents): Likewise. * layout.cc: Include gdb-index.h. (Layout::Layout): Initialize gdb_index_data_. (Layout::init_fixed_output_section): Check for .gdb_index section. (Layout::add_to_gdb_index): New function. Instantiate. * layout.h: Add forward declaration for class Gdb_index. (Layout::add_to_gdb_index): New member function. (Layout::gdb_index_data_): New data member. * main.cc: Include gdb-index.h. (main): Print statistics for gdb index. * object.cc (Object::section_contents): Move code into do_section_contents. (need_decompressed_section): Check for sections needed when building gdb index. (build_compressed_section_map): Likewise. (Sized_relobj_file::do_read_symbols): Need local symbols when building gdb index. (Sized_relobj_file::do_layout): Track .debug_info and .debug_types sections; call Layout::add_to_gdb_index. (Sized_relobj_file::do_decompressed_section_contents): Call do_section_contents directly. * object.h (Object::do_section_contents): Adjust parameter list and return type. (Object::do_decompressed_section_contents): Call do_section_contents directly. (Sized_relobj_file::do_section_contents): Adjust parameter list and return type. * options.h (class General_options): Add --gdb-index option. * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter list and return type. * plugin.h (Sized_pluginobj::do_section_contents): Likewise. * reloc.h (Track_relocs::checkpoint): New function. (Track_relocs::reset): New function. * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh): New test cases. * testsuite/Makefile.in: Regenerate. * testsuite/gdb_index_test.cc: New test source file. * testsuite/gdb_index_test_1.sh: New test source file. * testsuite/gdb_index_test_2.sh: New test source file.
2011-11-03 * configure.ac: Add --with-lib-path option. Define LIB_PATH andIan Lance Taylor1-2/+2
NATIVE_LINKER. * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR. * options.cc (General_options::finalize): Use library search path from configure script if specified. If not native and no sysroot, only search TOOLLIBDIR. * options.h (Search_directory::Search_directory): Change name to const std::string&. (General_options::add_to_library_path_with_sysroot): Change arg to const std::string&. * configure, Makefile.in, config.in: Rebuild.
2011-11-03 * arm.cc (Target_arm::may_use_v5t_interworking): Check whetherIan Lance Taylor1-0/+4
we are working around the ARM1176 Erratum. * options.h (General_options::fix_arm1176): Add option. * testsuite/Makefile.am: Add testcases, and keep current ones working. * testsuite/Makefile.in: Regenerate. * testsuite/arm_fix_1176.s: New file. * testsuite/arm_fix_1176.sh: Likewise.
2011-10-31 * options.h (class General_options): Add --[no-]gnu-unique options.Cary Coutant1-0/+4
* symtab.cc (Symbol_table::sized_write_globals): Convert STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2011-10-19 PR gold/13204Ian Lance Taylor1-0/+5
* layout.cc (Layout::segment_precedes): Don't assert failure if a --section-start option was seen. * options.h (General_options::any_section_start): New function.
2011-07-15 * options.h (class General_options): Add --print-output-format.Ian Lance Taylor1-3/+6
Move -EL next to -EB, for better --help output. * target-select.cc: Include <cstdio>, "options.h", and "parameters.h". (Target_selector::do_target_bfd_name): New function. (print_output_format): New function. * target-select.h (class Target_selector): Update declarations. (Target_selector::target_bfd_name): New function. (print_output_format): Declare. * main.cc: Include "target-select.h". (main): Handle --print-output-format. * gold.cc: Include "target-select.h". (queue_initial_tasks): Handle --print-output-format when there are no input files. * parameters.cc (parameters_force_valid_target): Give a better error message if -EB/-EL does not match target. * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New function.
2011-07-11 PR gold/12979Ian Lance Taylor1-0/+3
* options.h (class General_options): Add -Bgroup. * options.cc (General_options::finalize): If -Bgroup is set, default to --unresolved-symbols=report-all. * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup. * target-reloc.h (issue_undefined_symbol_error): Handle --unresolved-symbols=report-all.
2011-07-09 PR gold/12386Ian Lance Taylor1-0/+7
* options.h (class General_options): Add --unresolved-symbols. * target-reloc.h (issue_undefined_symbol_error): Check --unresolved-symbols. Add comments.
2011-07-06 * incremental.cc (Sized_incremental_binary::do_file_has_changed):Cary Coutant1-2/+20
Check disposition for startup file. (Incremental_inputs::report_command_line): Ignore --incremental-startup-unchanged option. * options.cc (General_options::parse_incremental_startup_unchanged): New function. (General_options::General_options): Initialize new data member. * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP. (General_options): Add --incremental-startup-unchanged option. (General_options::incremental_startup_disposition): New function. (General_options::incremental_startup_disposition_): New data member.
2011-07-06 * incremental.cc (Incremental_inputs::report_command_line): IgnoreCary Coutant1-0/+13
--incremental-patch option. * layout.cc (Free_list::allocate): Extend allocation beyond original end if enabled. (Layout::make_output_section): Mark sections that should get patch space. * options.cc (parse_percent): New function. * options.h (parse_percent): New function. (DEFINE_percent): New macro. (General_options): Add --incremental-patch option. * output.cc (Output_section::Output_section): Initialize new data members. (Output_section::add_input_section): Print section name when out of patch space. (Output_section::add_output_section_data): Likewise. (Output_section::set_final_data_size): Add patch space when doing --incremental-full. (Output_section::do_reset_address_and_file_offset): Remove patch space. (Output_segment::set_section_list_addresses): Print debug output only if --incremental-update. * output.h (Output_section::set_is_patch_space_allowed): New function. (Output_section::is_patch_space_allowed_): New data member. (Output_section::patch_space_): New data member. * parameters.cc (Parameters::incremental_full): New function. * parameters.h (Parameters::incremental_full): New function * testsuite/Makefile.am (incremental_test_2): Add test for --incremental-patch option. * testsuite/Makefile.in: Regenerate. * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments. (t18): Remove function body.
2011-07-03 PR gold/12957Ian Lance Taylor1-0/+8
* options.h (class General_options): Add -f and -F. * options.cc (General_options::finalize): Fatal error if -f/-F are used without -shared. * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2011-07-02 PR gold/12525Ian Lance Taylor1-1/+1
* options.h (class General_options): Support -z notext. * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use -Wl,-z,notext. (two_file_shared_nonpic.so): Likewise. (two_file_shared_mixed.so): Likewise. (two_file_shared_mixed_1.so): Likewise. (weak_undef_lib_nonpic.so): Likewise. (alt/weak_undef_lib_nonpic.so): Likewise. (tls_test_shared_nonpic.so): Likewise. * testsuite/Makefile.in: Rebuild.