Commit Graph

1533 Commits

Author SHA1 Message Date
Ian Lance Taylor 0bf402d505 Fix mingw gold build with plugins enabled
* Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
	* configure.ac: Export DLOPEN_LIBS and add headers check.
	* plugin.cc: Handle non-dlfcn case.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2013-01-11 14:36:36 +00:00
Sriraman Tallam 9e9143bc87 Make linker scripts and section ordering via --section-ordering-file or
linker plugins work. This patch lets linker scripts take precedence.

2013-01-09  Sriraman Tallam  <tmsriram@google.com>

	* output.h (sort_attached_input_sections): Change to be public.
	* script-sections.cc
	(Output_section_definition::set_section_addresses): Sort
	attached input sections according to section order before linker
	script assigns section addresses.
	(Orphan_output_section::set_section_addresses): Sort
	attached input sections according to section order before linker
	script assigns section addresses.
	* Makefile.am (final_layout.sh): Use a simple linker script to
	check if section ordering still works.
	* Makefile.in: Regenerate.
2013-01-10 00:18:15 +00:00
Ian Lance Taylor 679af3685c * arm.cc (Target_arm::attributes_accept_div): New function.
(Target_arm::attributes_forbid_div): New function.
	(Target_arm::merge_object_attributes): Merge the Tag_DIV_use
	attribute using the same new functions as what bfd/elf32_arm.c
	does.
2013-01-09 15:27:24 +00:00
Cary Coutant 3136a00eec gold/
PR gold/14993
	* output.cc (Output_section::add_input_section): For incremental
	updates, don't track input sections that are allocated from patch
	space.
2013-01-07 21:36:56 +00:00
H.J. Lu f2a6224b9c Properly install gold as default linker
PR gold/14897
	* configure.ac (--enable-ld): Removed.
	(install_as_default): Set to yes only for --enable-gold=default
	or --disable-ld.
	* configure: Regenerated.
2013-01-07 19:55:41 +00:00
H.J. Lu 4f46f626dc Add -fuse-ld= for GCC linker option compatibility
* options.h (General_options): Add -fuse-ld= for GCC linker
	option compatibility.
2013-01-07 16:57:57 +00:00
Cary Coutant 26e4ef59d6 gold/
* configure.ac: Fix typo restoring CXXFLAGS.
	* configure: Regenerate.
2013-01-05 00:00:51 +00:00
Cary Coutant 3d587466ef gold/
* testsuite/Makefile.am (CXXLINK_S): New macro.
	(debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
	* testsuite/Makefile.in: Regenerate.
2013-01-04 23:50:27 +00:00
H.J. Lu 44db66958c Update gold copyright year to 2013
* version.cc (print_version): Update copyright year to 2013.
2013-01-02 18:39:21 +00:00
Ian Lance Taylor edcac0c105 * layout.cc (Layout::special_ordering_of_input_section): New
function.
	(Layout::layout): If input section requires special ordering, must
	sort input sections.
	(Layout::make_output_section): May sort .text input sections.
	(Layout::is_section_name_prefix_grouped): Remove.
	* layout.h (class Layout): Declare
	special_ordering_of_input_section.  Don't declare
	is_section_name_prefix_grouped.
	* output.cc (Output_section::add_input_section): Revert last
	change.
	(Output_section::Input_section_sort::match_file_name): Don't crash
	if called on output section data.
	(Output_section::Input_section_sort_compare): Sort based on
	special ordering.
	(Output_section::Input_section_sort_section_order_index_compare):
	Revert last patch.
	(Output_section::sort_attached_input_sections): Likewise.
2012-12-21 06:24:31 +00:00
Sriraman Tallam 28f2a4ac6f Group text sections with prefixes .text.unlikely,.text.hot and .text.startup
by default.


2012-12-18  Sriraman Tallam  <tmsriram@google.com>

	* layout.cc (Layout::is_section_name_prefix_grouped): New function.
	* layout.h (Layout::is_section_name_prefix_grouped): New function.
	* output.cc (Output_section::add_input_section): Check if section
	name contains special prefix.  Keep input sections to sort such
	sections.
	(Output_section::Input_section_sort_section_order_index_compare
	 ::operator()): Group sections according to prefixes.
	* (Output_section::sort_attached_input_sections): Add condition
	to Input_section_entry constructor call.
	* testsuite/Makefile.am (text_section_grouping): New test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/text_section_grouping.cc: New file.
	* testsuite/text_section_grouping.sh: New file.
2012-12-19 02:55:15 +00:00
Nick Clifton 5bf135a788 Add copyright notices 2012-12-17 16:56:12 +00:00
Cary Coutant 59965708ea gold/
* testsuite/Makefile.am (exception_separate_shared_12_test): Add
    	--no-as-needed flag.
    	(exception_separate_shared_12_test): Likewise.
    	(incremental_copy_test): Likewise.
    	* testsuite/Makefile.in: Regenerate.
2012-12-15 01:55:08 +00:00
Cary Coutant 2a77e2ab18 gold/
* dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
	(Dwp_output_file::Dwp_index::enter_set): Add assert.
2012-12-15 00:57:30 +00:00
Alan Modra e3deeb9c3a * powerpc.cc (class Track_tls): New.
(class Relocate, class Scan): Inherit Track_tls.
	(Target_powerpc::Scan::local, global): Track tls optimization
	and avoid creating plt entry for __tls_get_addr if all uses
	are optimized away.
	(Target_powerpc::Relocate::relocate): Update to use Track_tls.
2012-12-12 08:09:41 +00:00
Alan Modra d8f5a2749d * options.h (General_options): Add --toc-sort/--no-toc-sort.
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-12 03:41:40 +00:00
Roland McGrath 4c8a1de1fe gold/
* testsuite/binary_unittest.cc (read_all): New function.
	(Sized_binary_test): Use it instead of ::read.
	* fileread.cc (do_read): Don't assume pread always reads the whole
	amount in a single call.
2012-12-10 17:38:42 +00:00
Nick Clifton 752937aa0c Add copyright notices 2012-12-10 12:48:03 +00:00
Alan Modra edc27beb58 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
Set EM_PPC64 or EM_PPC here.
	(Target_selector_powerpc::do_recognize): Delete.
2012-12-10 11:45:18 +00:00
Alan Modra 906b9150c7 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
stub_table_.
	(Target_powerpc::Branch_info::make_stub): Don't omit addend.
2012-12-10 11:30:57 +00:00
Roland McGrath 418c15ae72 gold/
* testsuite/binary_unittest.cc (Sized_binary_test):
	Use open_descriptor rather than ::open.
2012-12-07 21:48:32 +00:00
Ian Lance Taylor db399005e8 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2012-12-07 05:03:30 +00:00
Ian Lance Taylor ae2eea65c6 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2012-12-07 04:28:52 +00:00
Alan Modra decdd3bc36 * powerpc.cc (Stub_table::do_write): Delete redundant Address
typedef and invalid_address constant.
	(Output_data_glink, Stub_table, Target_powerpc): Explicitly
	instantiate constants.
2012-12-07 04:23:36 +00:00
Alan Modra aba6bc71dd * options.h (General_options): Add no_toc_optimize.
* powerpc.cc (ok_lo_toc_insn): New function.
	(Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2012-12-07 00:03:18 +00:00
Alan Modra 9e69ed506a * options.h (General_options): Add plt_align, plt_static_chain,
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-12-06 03:13:17 +00:00
Alan Modra f43ba157ad * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
(Target_powerpc::do_define_standard_symbols): New function.
2012-12-04 03:13:31 +00:00
Alan Modra dc9589e975 typo fix 2012-12-03 06:38:01 +00:00
Alan Modra 34171bc50f * output.h: Formatting, whitespace. 2012-12-03 05:48:47 +00:00
Alan Modra ec661b9dca * layout.h (Layout::get_executable_sections): Declare.
* layout.cc (Layout::get_executable_sections): New function.
	* arm.cc (Target_arm::group_sections): Use it.
	(Arm_output_section::group_sections): Delete now redundant test.
	* output.cc (Output_reloc::Output_reloc): Add is_relative.
	param to handle relative relocs.
	* output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
	(Output_data_reloc::add_absolute): Adjust.
	(Output_data_reloc::add_relative): New function.
	(Output_data::reset_data_size): New function.
	(Output_relaxed_input_section::set_relobj, set_shndx): New functions.
	(Output_section::set_addralign): New function.
	(Output_section::checkpoint_set_addralign): New function.
	(Output_section::clear_section_offsets_need_adjustment): New function.
	(Output_section::input_sections): Make public.
	* powerpc.cc (class Output_data_brlt_powerpc): New.
	(class Stub_table, class Stub_control): New.
	(Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
	stub_table_, set_stub_table, stub_table): New vectors and accessor
	functions.
	(Target_powerpc::do_may_relax, do_relax, push_branch,
	new_stub_table, stub_tables, brlt_section, group_sections,
	add_branch_lookup_table, find_branch_lookup_table,
	write_branch_lookup_table, make_brlt_section): New functions.
	(Target_powerpc::struct Sort_sections, class Branch_info): New.
	(Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
	branch_info_): New vars.
	(Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
	make call stubs here.
	(Output_data_glink): Remove all call stub handling from this class.
	(Target_powerpc::Scan::local, global): Save interesting branch
	relocs and relocs for ifunc.  Adjust calls to plt entry functions.
	(Target_powerpc::do_finalize_sections): Only make reg save/restore
	functions on final link.
	(Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
	Handle long branch destinations too.
	(Target_powerpc::do_dynsym_value, do_plt_address_for_global,
	do_plt_address_for_local): Adjust lookup of plt call stubs.
2012-12-03 05:30:59 +00:00
Alan Modra 627b30b77e * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
relocs against protected symbols when building 32-bit shared libs.
2012-11-30 05:01:20 +00:00
Alan Modra 40b469d719 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
param.  Call got_section() to make .got.  Update all callers
	and their callers and so on.
2012-11-30 04:50:00 +00:00
Alan Modra bb66a627d0 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
_GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
	(Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
	value if it already exists.
2012-11-30 04:47:08 +00:00
H.J. Lu d2cf1c6cfc Fix TLS to LE optimization for x32
PR gold/14858
	* x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2012-11-20 05:56:06 +00:00
Roland McGrath edccdf7c8b bfd/
* elf32-arm.c (elf32_arm_nacl_plt0_entry): Use bic rather than bfc
	instruction for data sandboxing.

gold/
	* arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
	than bfc instruction for data sandboxing.
2012-11-15 00:30:11 +00:00
Alan Modra 6febeb7413 Regenerate. 2012-11-08 03:03:26 +00:00
Alan Modra 0a6f1bf2f9 * configure.ac: Apply 2012-09-10 change to config.in here.
* configure: Regenerate.
2012-11-05 12:26:55 +00:00
Alan Modra 26a4e9cbc4 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
(struct Opd_ent): Use "Address" rather than "Offset".
	(Output_data_got_powerpc::got_base_offset): Return Valtype.
	(Target_powerpc::got_section): Make public.
	(Target_powerpc::scan_relocs): Move code setting symbols..
	(Powerpc_relobj::do_scan_relocs): ..to here, new function.
	Create _SDA_BASE_ only when referenced.
2012-11-05 03:29:58 +00:00
Roland McGrath cc9280133f gold/
* i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
	from last change.
2012-11-02 19:50:36 +00:00
Roland McGrath 62fe925ad4 gold/
* target.h (Sized_target::relocate_relocs): Use Elf_Off
	for offset_in_output_section parameter.
	(Sized_target::relocate_special_relocatable): Likewise.
	* arm.cc (Target_arm::relocate_relocs): Likewise.
	(Target_arm::relocate_special_relocatable): Likewise.
	* i386.cc (Target_i386::relocate_relocs): Likewise.
	* powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
	* sparc.cc (Target_sparc::relocate_relocs): Likewise.
	* target-reloc.h (relocate_relocs): Likewise.
	* testsuite/testfile.cc (Target_test): Likewise.
	* tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
	* x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2012-11-01 23:27:00 +00:00
Roland McGrath c2c9fdb45e gold/
* system.h: Move inclusion of <clocale> to after <libintl.h> in
	[ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2012-11-01 22:44:58 +00:00
Roland McGrath 3e536b9a7a gold/
* descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
	parameter, which is unused in the [!F_SETFD] case.
2012-11-01 22:43:26 +00:00
Roland McGrath 50ed5eb142 gold/
* dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
	SYMNDX to off_t before comparing it to this->data_size().
	* output.cc (Output_symtab_xindex::endian_do_write): Likewise.
	* incremental.cc (Output_section_incremental_inputs::do_write):
	Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2012-11-01 22:35:06 +00:00
Roland McGrath 2cadc0bfec gold/
* nacl.cc: Include "libiberty.h" for vasprintf declaration.
2012-11-01 18:16:23 +00:00
Nick Clifton 3bfcb6528e bfd:
* elf32-arm.c (elf32_arm_print_private_bfd_data): Recognise and
        display the new ARM hard-float/soft-float ABI flags for EABI_VER5
        (elf32_arm_post_process_headers): Add the hard-float/soft-float
        ABI flag as appropriate for ET_DYN/ET_EXEC in EABI_VER5.

binutils:
        * readelf.c (decode_ARM_machine_flags): Recognise and display the
        new ARM hard-float/soft-float ABI flags for EABI_VER5. Split out
        the code for EABI_VER4 and EABI_VER5 to allow this.

elfcpp:
        * arm.h: New enum for EABI soft- and hard-float flags.

gold:
        * gold.cc (Target_arm::do_adjust_elf_header): Add the
        hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
        in EABI_VER5.

include:
        * elf/arm.h (EF_ARM_ABI_FLOAT_SOFT): New define.
        (EF_ARM_ABI_FLOAT_HARD): Likewise.

ld/testsuite:
        * ld-arm/eabi-hard-float.s: New test source.
        * ld-arm/eabi-soft-float.s: New test source.
        * ld-arm/eabi-hard-float.d: New test.
        * ld-arm/eabi-soft-float.d: New test.
        * ld-arm/eabi-soft-float-ABI4.d: New test.
        * ld-arm/eabi-soft-float-r.d: New test.
        * ld-arm/arm-elf.xp: Use the new tests.

binutils:
	PR binutils/14779
	* configure.in: Add checks for wchar.h and mbstate_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* readelf.c: Conditionally include wchar.h.
	(print_symbol): Conditionally use mbstate_t.
2012-10-30 12:44:58 +00:00
Cary Coutant c1a8d56e4e gold/
* dwp.cc (usage): Add file and exit status parameters;
	add --help and --version options.
	(print_version): New function.
	(main): Add --help and --version options.
2012-10-29 23:01:51 +00:00
H.J. Lu b2490a7b4f Add final_layout_sequence.txt to MOSTLYCLEANFILES
* testsuite/Makefile.am (MOSTLYCLEANFILES): Add
	final_layout_sequence.txt.
	* testsuite/Makefile.in: Regenerated.
2012-10-26 00:50:05 +00:00
H.J. Lu aa54351297 Strip out -Wp,-D_FORTIFY_SOURCE= for gold tests
* testsuite/Makefile.am (COMPILE1): New variable. Renamed from
	COMPILE generated by automake.
	(LINK1): Likewise.
	(CXXCOMPILE1): Likewise.
	(CXXLINK1): Likewise.
	(COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
	(LINK): Likewise.
	(CXXCOMPILE): Likewise.
	(CXXLINK): Likewise.
	* testsuite/Makefile.in: Regenerated.
2012-10-25 22:50:54 +00:00
H.J. Lu d361fafb73 Issue a fatal error on bad fwrite return
* dwp.cc (Dwo_file::record_target_info): Issue a fatal error
	on bad fwrite return.
2012-10-25 20:51:32 +00:00
H.J. Lu 598c7410cc Use section_offset_type in remap_str_offset
* dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
	on val.
2012-10-25 20:50:24 +00:00
Cary Coutant 35c813e224 gold/
* testsuite/Makefile.am (TEST_OBJCOPY): New macro.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/dwp_test.h: New source file.
	* testsuite/dwp_test_1.cc: New source file.
	* testsuite/dwp_test_1.s: New source file.
	* testsuite/dwp_test_1.sh: New source file.
	* testsuite/dwp_test_1b.cc: New source file.
	* testsuite/dwp_test_1b.s: New source file.
	* testsuite/dwp_test_2.cc: New source file.
	* testsuite/dwp_test_2.s: New source file.
	* testsuite/dwp_test_2.sh: New source file.
	* testsuite/dwp_test_main.cc: New source file.
	* testsuite/dwp_test_main.s: New source file.
2012-10-24 02:32:15 +00:00
Cary Coutant 774299092d gold/
* 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.
2012-10-24 02:26:39 +00:00
Cary Coutant ed5d6712b8 gold/
* dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
	Dwarf_info_reader::read_from_pointer.
	(Dwarf_pubnames_table::read_header): Likewise.
	(Dwarf_pubnames_table::next_name): Likewise.
	(Dwarf_die::read_attributes): Likewise.
	(Dwarf_die::skip_attributes): Likewise.
	(Dwarf_info_reader::read_from_pointer): New function template.
	* dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
	(Dwarf_pubnames_table): Likewise.
	(Dwarf_info_reader::read_from_pointer): New function template.
	* gdb-index.cc (Gdb_index_info_reader): Adjust call to
	Dwarf_pubnames_table ctor.
2012-10-23 21:41:37 +00:00
Cary Coutant 8787852de1 gold/
* dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
	abbrev_shndx.
	* dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
	abbrev_shndx_.
	(Dwarf_info_reader::set_abbrev_shndx): New method.
	(Dwarf_info_reader::abbrev_shndx_): New data member.
2012-10-23 21:37:26 +00:00
Cary Coutant 9fc236f3fd gold/
* dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
	from object, not parameters.
	(Dwarf_info_reader::parse): Likewise.
	* object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
	(Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
	(Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
	methods.
2012-10-23 21:34:58 +00:00
Cary Coutant effe83657d gold/
* fileread.cc (Input_file::Input_file): New constructor.
	* fileread.h (class Input_file): Add new constructor.
2012-10-23 21:29:20 +00:00
Alan Modra 1698990d32 PR gold/14727
* object.cc (Relobj::is_section_name_included): Also match
	.sdata personality section.
2012-10-18 05:36:02 +00:00
Alan Modra 168a472611 * target-reloc.h (class Default_comdat_behavior): New, package up..
(get_comdat_behaviour): ..this.
	(relocate_section): Add Relocate_comdat_behavior template arg,
	adjust code to suit.
	* arm.cc (Target_arm::relocate_section): Adjust to suit.
	(Target_arm::scan_reloc_section): Likewise.
	* i386.cc (Target_i386::relocate_section): Likewise.
	* sparc.cc (Target_sparc::relocate_section): Likewise.
	* tilegx.cc (Target_tilegx::relocate_section): Likewise.
	* x86_64.cc (Target_x86_64::relocate_section): Likewise.
	* powerpc.cc (class Relocate_comdat_behavior): New.
	(Target_powerpc::relocate_section): Don't zap opd relocs.  Supply
	gold::relocate_section with new template arg.
2012-10-18 04:18:18 +00:00
Alan Modra acc276d812 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
dynamic relocs for GOT_TPREL got entries, without symbol if
	resolving locally.
	(Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
	(Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
	(Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2012-10-17 14:33:41 +00:00
Alan Modra e10f987022 PR gold/14726
* gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2012-10-17 11:58:39 +00:00
Sriraman Tallam ae034989da 2012-10-16 Sriraman Tallam <tmsriram@google.com>
* layout.cc (Layout::include_section): Keep sections marked
	SHF_EXCLUDE when doing relocatable links.
2012-10-16 16:50:32 +00:00
Alan Modra f3a0ed298a * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
(Target_powerpc::do_finalize_sections): Call it.
	(Output_data_save_res): New class and supporting functions.
	(Target_powerpc::symval_for_branch): Only look up .opd entry for
	normal symbols defined in object files.
2012-10-16 00:23:00 +00:00
Alan Modra c6de8ed456 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
(struct Opd_ent): Make "discard" a bit field.  Add "gc_mark".
	(Target_powerpc::do_gc_mark_symbol): Delay marking function code
	section if scan_opd_relocs not yet called.
	(Target_powerpc::gc_process_relocs): Call process_gc_mark.
2012-10-12 09:44:11 +00:00
Alan Modra 03e25981b6 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
add_local_ifunc_entry): Revert last change.
	(Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2012-10-12 09:39:19 +00:00
Alan Modra c9824451ad * powerpc.cc (Target_powerpc::do_plt_address_for_local,
do_plt_address_for_global): New functions.
	(Output_data_got_powerpc::do_write): Don't segfault when linking
	statically.
	(Output_data_plt_powerpc::add_entry, add_ifunc_entry,
	add_local_ifunc_entry): Return true on adding entry..
	(Target_powerpc::make_plt_entry): ..use to avoid unnecessary
	glink->add_entry call.  Remove unused symtab param.  Adjust calls.
	(Target_powerpc::make_local_ifunc_plt_entry): Likewise.
	(Target_powerpc::make_iplt_section): Remove symtab param.  Don't
	set up symbols here.
	(Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
	syms here.  Do so even when no .iplt.  Don't segfault when linking
	statically.
	(Output_data_glink::add_entry, find_entry): Rearrange params.  Add
	new variants without reloc param.
	(Glink_sym_ent::Glink_sym_ent): Likewise.
	(Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
	reloc when refs will resolve to plt call stub.
	(Target_powerpc::Scan::local): Correct ifunc handling.  Allow
	R_PPC_PLTREL24 to resolve locally.
	(Target_powerpc::Scan::global): Correct ifunc handling.
	(Target_powerpc::Relocate::relocate): Correct local sym glink
	lookup.  Don't destroy "value" when we have a plt call stub,
	and when checking plt call validity.
	(Target_powerpc::do_dynsym_value): Simplify.
2012-10-05 08:18:07 +00:00
Alan Modra 19fec8c1d3 * i386.cc (Output_data_plt_i386::address_for_global,
address_for_local): Add plt offset to returned value.  Adjust uses.
	* sparc.cc (Output_data_plt_sparc::address_for_global,
	address_for_local): Likewise.
	* tilegx.cc (Output_data_plt_tilegx::address_for_global,
	address_for_local): Likewise.
	* x86_64.cc (Output_data_plt_x86_64::address_for_global,
	address_for_local): Likewise.
	* target.h (Target::plt_address_for_global, plt_address_for_local):
	Update comment.
	* output.cc (Output_reloc::symbol_value): Don't add plt offset here.
	(Output_data_got::Got_entry::write): Nor here.
	* output.h: Comment fix.
2012-10-05 00:45:54 +00:00
Walter Lee e867b64722 Adjust the value of _GLOBAL_OFFSET_TABLE_ for got bigger than 0x8000
bytes, so that the 16 bit relocations have a greater chance of
working.
	* tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
	global_offset_table_ value for larget got.
	(Target_tilegx::Relocate::relocate): Handle adjusted got value.
2012-10-03 00:58:03 +00:00
Alan Modra e5d5f5ed43 * powerpc.cc (Target_powerpc::iplt_): New output section.
(Target_powerpc::iplt_section, make_iplt_section,
	reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
	(Target_powerpc::make_plt_entry): Handle ifunc syms.
	Target_powerpc::plt_entry_count): Count iplt entries too.
	(Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
	reloc section in constructor.  New params.
	(Target_powerpc::make_plt_section): Create reloc section here instead.
	(Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
	functions.
	(Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
	(Output_data_glink::add_entry, find_entry): New functions to
	deal with local syms.
	(Glink_sym_ent): Add support for local syms.
	(Output_data_glink::do_write): Handle ifunc plt entries.
	(Target_powerpc::Scan::get_reference_flags): Handle more relocs.
	(Target_powerpc::Scan::local, global): Handle ifunc syms.
	(Target_powerpc::Relocate::relocate): Likewise.
	(Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2012-09-29 10:29:05 +00:00
Alan Modra ec4dbad32d * object.h (Sized_relobj_file::adjust_local_symbol,
do_adjust_local_symbol): New functions.
	* object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
	* powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
	(Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
	and irregular opd entry spacing.
	(Powerpc_relobj::do_read_relocs): Add opd size checks.
	(Global_symbol_visitor_opd): New functor.
	(Target_powerpc::do_finalize_sections): Omit global symbols defined
	on deleted opd entries.
2012-09-25 00:59:25 +00:00
Walter Lee 5c0b3823c6 Add support for tilegx in gold.
* configure.ac (ENABLE_GOLD): support tilegx*
	* configure: rebuild
elfcpp:
	* tilegx.h: New file.
	* elfcpp.h: add EM_TILEGX.
gold:
	* tilegx.cc: New file.
	* Makefile.am (TARGETSOURCES): Add tilegx.cc
	(ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
	* configure.tgt: Add entries for tilegx*.
	* configure.ac: Likewise.
	* Makefile.in: Rebuild.
	* configure: Likewise.
	* testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
	tilegx.
2012-09-15 17:11:28 +00:00
Alan Modra bfdfa4cd8d * target-reloc.h (scan_relocs): Call scan.local for relocs
against symbols in discarded sections.  Pass is_discarded
	param.
	* arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
	Add is_discarded param.
	* powerpc (Target_powerpc::Scan::local): Likewise.  Use
	is_discarded to flag opd entry as discarded.  Don't emit dyn
	relocs on such entries.
	(Target_powerpc::Scan::global): Similarly detect and handle
	such opd entries.
	(Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
	opd_ent_.  Update all uses.
	(Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
	(Target_powerpc::relocate_section): Zero out discarded opd
	entry relocs.
2012-09-12 22:43:54 +00:00
Ian Lance Taylor d77a055577 PR gold/14570
* output.cc: Rename Output_data_got template parameter from size
	to got_size for all functions.  Compile all variants of
	Output_data_got.
	(Output_data_got::Got_entry::write): Correct use of size for
	symbol value.  Use local_is_tls rather than casting to
	Sized_relobj_file.
	* object.h (class Object): Add local_is_tls and do_local_is_tls.
	(class Sized_relobj_file): Add do_local_is_tls.
	* incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2012-09-12 18:29:18 +00:00
Alan Modra 815a120572 PR gold/14566
* layout.cc (Layout::set_segment_offsets): When using
	common-page-size alignment, ensure we are on a new max-page-size
	page.
	* output.cc (Output_segment::set_section_addresses): Use
	abi_pagesize, not common_pagesize for relro boundary.
	(Output_segment::set_offset): Likewise.
2012-09-10 23:10:41 +00:00
Alan Modra bd73a62d77 * output.h (Output_data_got::add_global_tls, add_local_tls,
add_local_tls_pair): New functions.
	(Output_data_got::add_local_pair_with_rel): Remove second
	reloc param.  Expand comment.
	(Output_data_got::Got_entry): Rename use_plt_offset_ to
	use_plt_or_tls_offset_, similarly for constructor param.
	(Output_data_got::Got_entry::write): Add got_index param.
	* output.cc (Output_data_got::add_global_tls, add_local_tls,
	add_local_tls_pair): New functions.
	(Output_data_got::Got_entry::write): Handle tls symbols
	with use_plt_or_tls_offset_ set specially.
	(Output_data_got::add_local_pair_with_rel): Only one reloc.
	(Output_data_got::do_write): Replace iterator with index, pass
	index to entry write function.
	* target.h (Target::tls_offset_for_local, tls_offset_for_global,
	do_tls_offset_for_local, do_tls_offset_for_global): New functions.
	* arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
	call.
	* i386.cc (Target_i386::Scan::local): Likewise.
	* sparc.cc (Target_sparc::Scan::local): Likewise.
	* x86_64.cc (Target_x86_64::Scan::local): Likewise.
	* powerpc.cc (Target_powerpc::do_tls_offset_for_local,
	do_tls_offset_for_global): New functions.
	(Target_powerpc::Scan::local): Correct TLS relocations and got
	entry values.
	(Target_powerpc::Scan::global): Don't emit unnecessary
	dynamic relocations on TLS GOT entries.
2012-09-10 23:05:54 +00:00
Alan Modra 00716ab174 * config.in: Disable sanity check for kfreebsd. 2012-09-10 22:30:57 +00:00
Sterling Augustine c891b3f924 2012-09-10 Sterling Augustine <saugustine@google.com>
* gdb-index.cc (Gdb_index::pubnames_read): New parameter.
	(Gdb_index::pubtypes_read): New parameter.
	(Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
	to calls.
	* gdb-index.h (Gdb_index): New fields pubnames_object_ and
	pubtypes_object_.
2012-09-10 19:16:33 +00:00
Alan Modra e81fea4d17 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
(Sized_target::gc_add_reference, do_gc_add_reference): New functions.
	* gc.h (gc_process_relocs): Call target gc_add_reference.
	* gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
	* symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
	(Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
	unnecessary cast.
	* powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
	to cater for when we don't need code offset.  Update use.
	(Powerpc_relobj::access_from_map_, opd_valid_): New vars.
	(Powerpc_relobj::access_from_map, add_reference, opd_valid,
	set_opd_valid): New functions.
	(Target_powerpc::do_gc_add_reference): New function.
	(Target_powerpc::gc_process_relocs): Call gc()->add_reference on
	stashed refs.
	(Target_powerpc::do_gc_mark_symbol): New function.
2012-09-09 03:43:51 +00:00
Cary Coutant d2d60eefc4 2012-09-06 Cary Coutant <ccoutant@google.com>
gold/
	* dwarf_reader.cc (Dwarf_die::read_attributes): Add
	DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
	(Dwarf_die::skip_attributes): Likewise.
	* object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
	* testsuite/gdb_index_test.cc (inline_func_1): New function.
	(main): Call it.
	* testsuite/gdb_index_test_comm.sh: Check index for inline function.
2012-09-07 20:14:10 +00:00
H.J. Lu 32ed457365 Add .got.plt output section statement
* testsuite/script_test_3.t: Add .got.plt output section
	statement.
	* testsuite/script_test_4.t: Likewise.
2012-09-06 04:46:18 +00:00
Alan Modra f4baf0d43d * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
update all uses and lose "enum" when using type.
2012-09-05 11:27:14 +00:00
Alan Modra 864a1b5697 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
* configure: Regenerate.
	* testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
	(plugin_final_layout.stdout): Likewise.
	(memory_test): Set page sizes to 0x1000.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/discard_locals_test.sh: Add FIXME comment.
	* testsuite/justsyms_exec.c: Disable function test for powerpc64.
	* testsuite/pr14265.t: Add .got output section statement.
	* testsuite/script_test_2.t: Likewise.
	* testsuite/script_test_3.t: Likewise.
	* testsuite/script_test_4.t: Likewise.
	* testsuite/script_test_5.t: Likewise.
	* testsuite/script_test_6.t: Likewise.
	* testsuite/script_test_7.t: Likewise.
	* testsuite/script_test_9.t: Likewise.
2012-09-05 11:01:43 +00:00
Alan Modra 3ea0a085a6 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
(Powerpc_relocate_functions::Status): New typedef.
	(Target_powerpc::Scan::get_reference_flags): Handle more relocs.
	(Target_powerpc::Scan::local): Handle REL64.
	(Target_powerpc::Scan::global): Likewise, and dynamic relocs
	for REL32 and REL64.
	(Target_powerpc::symval_for_branch): New function, extracted from..
	(Target_powerpc::Relocate::relocate): ..here.  Correct plt call
	checks.  Report overflow errors.
2012-09-05 02:54:26 +00:00
Alan Modra 7404fe1b8d * object.h (Sized_relobj_file::emit_relocs): Delete.
(Sized_relobj_file::emit_relocs_reltype): Delete.
	* reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
	relocate_relocs for --emit-relocs.
	(Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
	* output.h: Update comment.
	(Output_segment::first_section): New function.
	(Output_segment::first_section_load_address): Use first_section.
	* output.cc (Output_segment::first_section): New function extracted..
	(Output_segment::first_section_load_address): ..from here.  Delete.
	* target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
	* target.h (Sized_target::relocate_for_relocatable): Likewise.
	* arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
	adjust call to target.h function.
	* i386.cc (Target_i386): Likewise.
	* sparc.cc (Target_sparc): Likewise.
	* x86_64.cc (Target_x86_64): Likewise.
	* powerpc.cc (Target_powerpc): Likewise.
	(Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS.  Ensure
	first tls section has section symbol for optimised local dynamic
	output relocs.
	(Target_powerpc::Relocate::relocate): Correct local dynamic value.
	(Target_powerpc::relocate_relocs): Adjust relocs emitted for
	optimised tls code.
	* testsuite/testfile.cc (Target_test::relocate_for_relocatable):
	Rename to relocate_relocs.  Update error message.
2012-09-05 00:34:20 +00:00
Andreas Schwab 957564c930 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
--just-symbols.
2012-09-04 08:04:31 +00:00
Alan Modra dd93cd0ae8 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
(Powerpc_relobj::toc_base_offset): New stub function.
	(Target_powerpc): Add tp_offset, dtp_offset.  Rename
	got_mod_index_offset to tlsld_got_offset.  Update all refs.
	(Target_powerpc::Relocate::enum skip_tls): New.
	(Target_powerpc::call_tls_get_addr_): New var.
	(Target_powerpc::is_branch_reloc): Move to file scope.
	(Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
	(Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
	New functions.
	(Target_powerpc::enum Got_type): Delete old values, add new ones.
	(powerpc_info): Correct common_pagesize for ppc64.
	(at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
	(Powerpc_relocate_functions): Add overflow check enums and functions.
	Add non-shift version of rela, rela_ua.  Delete all rel public
	functions.  Delete addr16_lo.  Add addr64, addr64_u, addr32,
	addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
	addr16_ha3, addr14 functions.
	(Output_data_got_powerpc::add_constant_pair): New function.
	(Output_data_got_powerpc::got_base_offset): Likewise.
	(Output_data_got_powerpc::do_write): Correct 64-bit got header.
	(instruction constants): Sort, add some more.
	(Output_data_glink::do_write): Add and use Address typedef.  Use
	object->toc_base_offset() stub for 64-bit.
	(Target_powerpc::tlsld_got_offset): Use add_constant_pair.
	(Target_powerpc::Scan::get_reference_flags): Handle more relocs.
	(Target_powerpc::Scan::local, global): Emit relative dynamic reloc
	for R_PPC64_TOC.  Handle more relocs.  Generate got entries for TLS.
	Always treat .opd relocs as against locally defined symbol.
	Correct condition for RELATIVE relocs.
	(Target_powerpc::do_finalize_sections): Test for NULL sections.
	(Target_powerpc::Relocate::relocate): Use plt call stub as value
	for 32-bit syms with a plt entry.  Correct ppc64 toc base
	calculations.  Handle TLS relocs, and more.  Add overflow
	checking and adjust for Powerpc_relocate_functions changes.
	(Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
	Reinstate --emit-relocs code with FIXME.
2012-08-31 01:09:52 +00:00
Alan Modra a1373b60b3 * layout.cc (Layout::set_segment_offsets): Set p_align to
abi_pagesize, not common_pagesize.
	(Layout::relaxation_loop_body): Similarly use abi_pagesize
	to determine whether file header can go in segment.
2012-08-30 05:57:05 +00:00
Alan Modra 703d02da76 * output.h (Output_reloc::Output_reloc <output section>): Add
is_relative param.  Adjust calls.
	(Output_reloc::add_output_section_relative): New functions.
	* output.cc (Output_reloc::Output_reloc <output section>): Handle
	is_relative.
	(Output_reloc::symbol_value): Handle SECTION_CODE.
2012-08-30 05:54:59 +00:00
Sriraman Tallam 16164a6b00 Patch adds support to allow plugins to map selected subset of sections to unique
segments.


2012-08-24  Sriraman Tallam  <tmsriram@google.com>

	* gold.cc (queue_middle_tasks): Call layout again when unique
	segments for sections is desired.
	* layout.cc (Layout::Layout): Initialize new members.
	(Layout::get_output_section_flags): New function.
	(Layout::choose_output_section): Call get_output_section_flags.
	(Layout::layout): Make output section for mapping to a unique segment.
	(Layout::insert_section_segment_map): New function.
	(Layout::attach_allocated_section_to_segment): Make unique segment for
	output sections marked so.
	(Layout::segment_precedes): Check for unique segments when sorting.
	* layout.h (Layout::Unique_segment_info): New struct.
	(Layout::Section_segment_map): New typedef.
	(Layout::insert_section_segment_map): New function.
	(Layout::get_output_section_flags): New function.
	(Layout::is_unique_segment_for_sections_specified): New function.
	(Layout::set_unique_segment_for_sections_specified): New function.
	(Layout::unique_segment_for_sections_specified_): New member.
	(Layout::section_segment_map_): New member.
	* object.cc (Sized_relobj_file<size, big_endian>::do_layout):
	Rename is_gc_pass_one to is_pass_one.
	Rename is_gc_pass_two to is_pass_two.
	Rename is_gc_or_icf to is_two_pass.
	Check for which pass based on whether symbols data is present.
	Make it two pass when unique segments for sections is desired.
	* output.cc (Output_section::Output_section): Initialize new
	members.
	* output.h (Output_section::is_unique_segment): New function.
	(Output_section::set_is_unique_segment): New function.
	(Output_section::is_unique_segment_): New member.
	(Output_section::extra_segment_flags): New function.
	(Output_section::set_extra_segment_flags): New function.
	(Output_section::extra_segment_flags_): New member.
	(Output_section::segment_alignment): New function.
	(Output_section::set_segment_alignment): New function.
	(Output_section::segment_alignment_): New member.
	(Output_segment::Output_segment): Initialize is_unique_segment_.
	(Output_segment::is_unique_segment): New function.
	(Output_segment::set_is_unique_segment): New function.
	(Output_segment::is_unique_segment_): New member.
	* plugin.cc (allow_unique_segment_for_sections): New function.
	(unique_segment_for_sections): New function.
	(Plugin::load): Add new functions to transfer vector.
	* Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
	* Makefile.in: Regenerate.
	* testsuite/plugin_final_layout.sh: Check if unique segment
	functionality works.
	* testsuite/plugin_section_order.c (onload): Check if new interfaces
	are available.
	(allow_unique_segment_for_sections): New global.
	(unique_segment_for_sections): New global.
	(claim_file_hook): Call allow_unique_segment_for_sections.
	(all_symbols_read_hook): Call unique_segment_for_sections.


2012-08-24  Sriraman Tallam  <tmsriram@google.com>

	* plugin-api.h (ld_plugin_allow_unique_segment_for_sections):
	New interface.
	(ld_plugin_unique_segment_for_sections): New interface.
	(LDPT_ALLOW_UNIQUE_SEGMENT_FOR_SECTIONS): New enum val.
	(LDPT_UNIQUE_SEGMENT_FOR_SECTIONS): New enum val.
	(tv_allow_unique_segment_for_sections): New member.
	(tv_unique_segment_for_sections): New member.
2012-08-24 18:35:35 +00:00
Cary Coutant 1e2bee4f5f 2012-08-22 Cary Coutant <ccoutant@google.com>
gold/
	* layout.cc (Layout::include_section): Don't assert on GROUP
	sections with --emit-relocs.
2012-08-22 18:26:32 +00:00
Cary Coutant 1d5dfe78f9 2012-08-21 Cary Coutant <ccoutant@google.com>
gold/
	* symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
	if --export-dynamic-symbol names an undef symbol.
2012-08-21 21:41:04 +00:00
Alan Modra c9269dff67 * powerpc.cc: Formatting and white space.
(Powerpc_relobj): Rename got2_section_ to special_.
	Add opd_ent_shndx_ and opd_ent_off_ vectors.
	(Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
	scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
	(Target_powerpc): Add Address typedef and invalid_address.  Use
	throughout.
	(Target_powerpc::is_branch_reloc): New function.
	(Powerpc_relocate_functions): Add Address typedef, use throughout.
	(Powerpc_relocate_functions:rela, rela_ua): Correct type used
	for dst_mask, value and addend.
	(Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
	(ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
	(Output_data_glink::do_write): Correct toc base.  Don't try to use
	uint16_t for 24-bit offset.  Use get_output_section_offset and
	check return.
	(Target_powerpc::Scan::local): Handle more relocs.
	(Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
	(Target_powerpc::Relocate::relocate): Correct toc base calculation.
	Plug in toc restoring insn after plt calls.  Translate branches
	to function descriptor symbols to corresponding entry point.
	(Target_powerpc::relocate_for_relocatable): Check return from
	get_output_section_offset.
	* symtab.h: Comment typo.
2012-08-18 11:12:50 +00:00
Ian Lance Taylor b1759dce03 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
unsupported_relocal_local to call unsupported_reloc_global.
2012-08-15 04:03:54 +00:00
Nick Clifton b9b2ae8bbf PR ld/14265
* script-sections.cc (Sections_element::output_section_name): Add
	keep return parameter.
	(Output_section_element::match_name): Add keep return parameter.
	Return the value of the keep_ member.
	* script-sections.h (class Output_section): Update
	output_section_name prototype.
	* layout.cc (Layout::keep_input_section): New public member
	function.
	(Layout::choose_output_section): Pass keep parameter to
	output_section_name.
	* layout.h (class Layout): Add keep_input_section.
	* object.cc (Sized_relobj_file::do_layout): Check for kept input
	sections.
	* testsuite/Makefile.am: Add a test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/pr14265.c: Source file for the test.
	* testsuite/pr14265.t: Linker script for the test.
	* testsuite/pr14265.sh: Shell script for the test.

	* ld-gc/gc.exp: Add a new test.
	* ld-gc/pr14265.c: Source file for the new test.
	* ld-gc/pr14265.t: Linker script for the new test.
	* ld-gc/pr14265.d: Expected symbol dump.
2012-08-14 08:31:57 +00:00
Alan Modra 921b53228f * target.h (Target::output_section_name): New function.
(Target::do_output_section_name): New function.
	* layout.cc (Layout::choose_output_section): Call the above.
	* powerpc.cc (Target_powerpc::do_output_section_name): New function.
2012-08-14 03:39:03 +00:00
Alan Modra 6ce7895693 elfcpp/
* powerpc.h: Add more relocs.
	(R_PPC_REL16*): Rename to R_POWERPC_REL16*.
gold/
	* powerpc.cc: Update for renamed R_PPC_REL16 relocs.
	(Output_data_got_powerpc::do_write): Don't rely on base class lookup
	for replace_constant call.
	(Output_data_plt_powerpc::do_print_to_mapfile): New function.
	(Output_data_glink::do_print_to_mapfile): New function.
	(Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
	(Target_powerpc::Relocate::relocate): Likewise.
2012-08-14 02:22:32 +00:00
Alan Modra d1a8cabd8f * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
(Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
	(Output_data_glink::add_entry,find_entry): Remove shndx param.
	(class Glink_sym_ent): Rename from struct Glink_sym_ent.  Remove
	all references to shndx_.  Handle special case for R_PPC_PLTREL24
	here.
	(class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
	(Output_data_glink::do_write): Retrieve got2_shdnx from object.
	(Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
	here.
	(Target_powerpc::Scan::global): Nor on make_plt_entry call.
	(Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2012-08-14 01:07:01 +00:00
Alan Modra d83ce4e3cd * powerpc.cc: Whitespace fixes. Wrap overly long lines.
(glink insn constants): Use uint32_t.
	(Output_data_glink::add_entry): Use insert, not [] operator.
2012-08-12 03:07:32 +00:00
Alan Modra cf43a2fe99 * object.h (Sized_relobj_file::find_shdr): New function.
(Sized_relobj_file::find_special_sections): New function.
	* object.cc (Sized_relobj_file::find_shdr): New function.
	(Sized_relobj_file::find_eh_frame): Use find_shdr.
	(Sized_relobj_file::find_special_sections): New function, split out..
	(Sized_relobj_file::do_read_symbols): ..from here.
	* output.h (Output_data_got::replace_constant): New function.
	(Output_data_got::num_entries): New function.
	(Output_data_got::last_got_offset,set_got_size): Use num_entries.
	(Output_data_got::got_offset): Protected rather than private.
	(Output_data_got::replace_got_entry): New function.
	* output.cc (Output_data_got::replace_got_entry): New function.
	* powerpc.cc (class Powerpc_relobj): New.
	(class Powerpc_relocate_functions): Delete all psymval variants or
	convert to value,addend type.  Delete pcrela, pcrela_unaligned.
	Implement _ha functions using corresponding _hi function.
	(Powerpc_relobj::find_special_sections): New function.
	(Target_powerpc::do_make_elf_object): New function.
	(class Output_data_got_powerpc): New.
	(class Output_data_glink): New.
	(class Powerpc_scan_relocatable_reloc): New.
	Many more changes througout file.
2012-08-11 04:41:28 +00:00
Nick Clifton 3c892704a9 Updated Vietnamese translation. 2012-08-09 14:46:44 +00:00
Ian Lance Taylor 82435b3b3d * layout.cc (Layout::add_target_dynamic_tags): If
dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
	plt_rel.
2012-08-07 13:24:47 +00:00
Nick Clifton a6dc81d2ab Updated translations 2012-07-30 08:43:46 +00:00
Cary Coutant f1415016b6 2012-07-18 Cary Coutant <ccoutant@google.com>
PR gold/14344
	* configure.ac: Add check for -gpubnames support.
	* configure: Regenerate.
	* testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
	support; force -gno-pubnames.
	(gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
	support.
	(gdb_index_test_4): New test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/gdb_index_test_1.sh: Refactor code into common file.
	* testsuite/gdb_index_test_2.sh: Likewise.
	* testsuite/gdb_index_test_3.sh: Don't look for space after colon.
	* testsuite/gdb_index_test_4.sh: New script.
	* testsuite/gdb_index_test_comm.sh: New script with common code;
	don't look for space after colon.
2012-07-19 00:19:35 +00:00
Sriraman Tallam b7fd7c377d 2012-07-16 Sriraman Tallam <tmsriram@google.com>
* gold.cc (queue_middle_tasks): Update function order only after
	deferred objects due to plugins are processed.
2012-07-16 19:00:18 +00:00
Ian Lance Taylor 1f3212db28 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
(Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
	(Target_arm::scan_reloc_for_stub): Likewise.
	* common.cc (Symbol_table::do_allocate_commons_list): Likewise.
	* dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
	* ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
	* incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
	* powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2012-07-11 14:18:40 +00:00
Ian Lance Taylor 81c82a68dc PR gold/14309
* configure.ac: Test whether std::tr1::hash<off_t> works.
	* gold.h: Add a specialization for std::tr1::hash<off_t> if
	needed.
	* output.h (class Output_fill): Add virtual destructor.
	* configure, config.in: Rebuild.
2012-07-10 14:54:29 +00:00
Roland McGrath eabc84f484 gold/
* layout.cc (finalize): Define __ehdr_start symbol if applicable.
2012-06-22 18:02:24 +00:00
Rafael Ávila de Espíndola 370e30b6f9 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
* plugin.cc (Plugin::load): Handle position independent executables.
2012-06-12 22:52:41 +00:00
Cary Coutant fb1b895daa gold/
* 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-07 05:14:44 +00:00
Cary Coutant 7c0640fa36 gold/
* 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-06-06 22:12:47 +00:00
Doug Kwan 2a49eb6935 2012-06-05 Jing Yu <jingyu@google.com>
* gold.h (textdomain): Add do {} to empty while(0).
	(bindtextdomain): Likewise.
2012-06-06 07:49:26 +00:00
Cary Coutant fad072ac13 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
has_dynsym_index.
2012-06-04 20:00:31 +00:00
Sriraman Tallam 8cc69fb6b5 2012-05-25 Sriraman Tallam <tmsriram@google.com>
* symtab.cc (Symbol_table::define_special_symbol):
	Initialize *poldsym to prevent uninitialized variable errors.
2012-05-25 22:53:52 +00:00
Cary Coutant 1be75daacf gold/
* layout.cc (Layout::section_name_mapping): Add rules to handle
	exact match on .data.rel.ro.local or .data.rel.ro.
	(Layout::output_section_name): Check for exact matches.
2012-05-24 01:02:15 +00:00
Cary Coutant 9b689de015 gold/
* layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
	more carefully.
2012-05-23 20:54:37 +00:00
Cary Coutant b24fdbf5e0 gold/
* symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
	object before exporting symbol.
2012-05-22 23:50:52 +00:00
H.J. Lu e550e1a2af Include "config.h" first
* testsuite/tls_test.cc: Include "config.h" first.
	* testsuite/tls_test_c.c: Likewise.
2012-05-21 16:52:38 +00:00
Nick Clifton df7b86aa4c PR 14072
* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* sysdep.h: Generate an error if included before config.h.
	* alpha-opc.c: Include sysdep.h before any other header file.
	* alpha-dis.c: Likewise.
	* avr-dis.c: Likewise.
	* cgen-opc.c: Likewise.
	* cr16-dis.c: Likewise.
	* cris-dis.c: Likewise.
	* crx-dis.c: Likewise.
	* d10v-dis.c: Likewise.
	* d10v-opc.c: Likewise.
	* d30v-dis.c: Likewise.
	* d30v-opc.c: Likewise.
	* h8500-dis.c: Likewise.
	* i370-dis.c: Likewise.
	* i370-opc.c: Likewise.
	* m10200-dis.c: Likewise.
	* m10300-dis.c: Likewise.
	* micromips-opc.c: Likewise.
	* mips-opc.c: Likewise.
	* mips61-opc.c: Likewise.
	* moxie-dis.c: Likewise.
	* or32-opc.c: Likewise.
	* pj-dis.c: Likewise.
	* ppc-dis.c: Likewise.
	* ppc-opc.c: Likewise.
	* s390-dis.c: Likewise.
	* sh-dis.c: Likewise.
	* sh64-dis.c: Likewise.
	* sparc-dis.c: Likewise.
	* sparc-opc.c: Likewise.
	* spu-dis.c: Likewise.
	* tic30-dis.c: Likewise.
	* tic54x-dis.c: Likewise.
	* tic80-dis.c: Likewise.
	* tic80-opc.c: Likewise.
	* tilegx-dis.c: Likewise.
	* tilepro-dis.c: Likewise.
	* v850-dis.c: Likewise.
	* v850-opc.c: Likewise.
	* vax-dis.c: Likewise.
	* w65-dis.c: Likewise.
	* xgate-dis.c: Likewise.
	* xtensa-dis.c: Likewise.
	* rl78-decode.opc: Likewise.
	* rl78-decode.c: Regenerate.
	* rx-decode.opc: Likewise.
	* rx-decode.c: Regenerate.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* sysdep.h: Generate an error if included before config.h.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* aclocal.m4: Regenerate.
	* bfd-in.h: Generate an error if included before config.h.
	* sysdep.h: Likewise.
	* bfd-in2.h: Regenerate.
	* compress.c: Remove #include "config.h".
	* plugin.c: Likewise.
	* elf32-m68hc1x.c: Include sysdep.h before alloca-conf.h.
	* elf64-hppa.c: Likewise.
	* som.c: Likewise.
	* xsymc.c: Likewise.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* aclocal.m4: Regenerate.
	* Makefile.am: Use wrappers around C files generated by flex.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* itbl-lex-wrapper.c: New file.
	* config/bfin-lex-wrapper.c: New file.
	* cgen.c: Include as.h before setjmp.h.
	* config/tc-dlx.c: Include as.h before any other header.
	* config/tc-h8300.c: Likewise.
	* config/tc-lm32.c: Likewise.
	* config/tc-mep.c: Likewise.
	* config/tc-microblaze.c: Likewise.
	* config/tc-mmix.c: Likewise.
	* config/tc-msp430.c: Likewise.
	* config/tc-or32.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-tic54x.c: Likewise.
	* config/tc-xtensa.c: Likewise.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* unwind-ia64.h: Include config.h.
2012-05-17 15:13:28 +00:00
Cary Coutant 1007b5031a gold/
* layout.cc (Layout::make_output_section): Mark .tdata section
	as RELRO.
	* testsuite/relro_test.cc: Add a TLS variable.
2012-05-14 17:35:43 +00:00
H.J. Lu fd885f3a4d Handle R_X86_64_64 properly for x32
elfcpp/

	PR gold/14091
	* x86_64.h (R_X86_64_RELATIVE64): New.

gold/

	PR gold/14091
	* x86_64.cc (Target_x86_64::Scan::local): For x32, generate
	R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
	R_X86_64_64.
2012-05-11 11:10:19 +00:00
Cary Coutant 80f5885c06 gold/
* layout.cc (gdb_sections): Update GDB version, add .debug_addr.
	(lines_only_debug_sections): Likewise.
2012-05-08 18:00:02 +00:00
Roland McGrath 2e702c99c5 * configure.ac (ENABLE_GOLD): Consider *-*-nacl* targets ELF.
* configure: Regenerate.

gold/
	* nacl.cc: New file.
	* nacl.h: New file.
	* Makefile.am (CCFILES, HFILES): Add them.
	* Makefile.in: Regenerate.
	* i386.cc (Output_data_plt_i386_nacl): New class.
	(Output_data_plt_i386_nacl_exec): New class.
	(Output_data_plt_i386_nacl_dyn): New class.
	(Target_i386_nacl): New class.
	(Target_selector_i386_nacl): New class.
	(target_selector_i386): Use it instead of Target_selector_i386.
	* x86_64.cc (Output_data_plt_x86_64_nacl): New class.
	(Target_x86_64_nacl): New class.
	(Target_selector_x86_64_nacl): New class.
	(target_selector_x86_64, target_selector_x32): Use it instead of
	Target_selector_x86_64.
	* arm.cc (Output_data_plt_arm_nacl): New class.
	(Target_arm_nacl): New class.
	(Target_selector_arm_nacl): New class.
	(target_selector_arm, target_selector_armbe): Use it instead of
	Target_selector_arm.

	* target-select.cc (select_target): Take new Input_file* and off_t
	arguments, pass them on to recognize method of selector.
	* object.cc (make_elf_sized_object): Update caller.
	* parameters.cc (parameters_force_valid_target): Likewise.
	* incremental.cc (make_sized_incremental_binary): Likewise.
	* target-select.h: Update decl.
	(Target_selector::recognize): Take new Input_file* argument,
	pass it on to do_recognize.
	(Target_selector::do_recognize): Take new Input_file* argument.
	* freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
	* powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
	* sparc.cc (Target_selector_sparc::do_recognize): Likewise.
	* testsuite/testfile.cc (Target_selector::do_recognize): Likewise.

	* target.h (Target::Target_info): New members isolate_execinstr
	and rosegment_gap.
	(Target::isolate_execinstr, Target::rosegment_gap): New methods.
	* arm.cc (Target_arm::arm_info): Update initializer.
	* i386.cc (Target_i386::i386_info): Likewise.
	* powerpc.cc (Target_powerpc::powerpc_info): Likewise.
	* sparc.cc (Target_sparc::sparc_info): Likewise.
	* x86_64.cc (Target_x86_64::x86_64_info): Likewise.
	* testsuite/testfile.cc (Target_test::test_target_info): Likewise.
	* layout.cc (Layout::attach_allocated_section_to_segment):
	Take new const Target* argument.  If target->isolate_execinstr(), act
	like --rosegment.
	(Layout::find_first_load_seg): Take new const Target* argument;
	if target->isolate_execinstr(), reject PF_X segments.
	(Layout::relaxation_loop_body): Update caller.
	(Layout::set_segment_offsets): If target->isolate_execinstr(),
	reset file offset to zero when we hit LOAD_SEG, and then do a second
	loop over the segments before LOAD_SEG to reassign offsets after
	addresses have been determined.  Handle target->rosegment_gap().
	(Layout::attach_section_to_segment): Take new const Target* argument;
	pass it to attach_allocated_section_to_segment.
	(Layout::make_output_section): Update caller.
	(Layout::attach_sections_to_segments): Take new const Target* argument;
	pass it to attach_section_to_segment.
	* gold.cc (queue_middle_tasks): Update caller.
	* layout.h (Layout): Update method decls with new arguments.

	* arm.cc (Target_arm::Target_arm): Take optional argument for the
	Target_info pointer to use.
	(Target_arm::do_make_data_plt): New virtual method.
	(Target_arm::make_data_plt): New method that calls it.
	(Target_arm::make_plt_entry): Use it.
	(Output_data_plt_arm::Output_data_plt_arm): Take additional argument
	for the section alignment.
	(Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
	method.
	(Output_data_plt_arm::first_plt_entry_offset): Call it.
	(Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
	method.
	(Output_data_plt_arm::get_plt_entry_size): Call it.
	(Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
	(Output_data_plt_arm::fill_plt_entry): New method that calls it.
	(Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
	method.
	(Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
	(Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
	method instead of sizeof(plt_entry).
	(Output_data_plt_arm::add_entry): Likewise.
	Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
	(Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
	than static method.
	(Target_arm::plt_entry_size): Likewise.
	(Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
	Move to ...
	(Output_data_plt_arm_standard): ... here, new class.
	(Output_data_plt_arm::do_write): Move guts of PLT filling to...
	(Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
	(Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.

	* x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
	Take additional argument for the PLT entry size.
	(Output_data_plt_x86_64::get_tlsdesc_plt_offset):
	Use get_plt_entry_size method rather than plt_entry_size variable.
	(Output_data_plt_x86_64::reserve_slot): Likewise.
	(Output_data_plt_x86_64::do_adjust_output_section): Likewise.
	(Output_data_plt_x86_64::add_entry): Likewise.
	(Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
	(Output_data_plt_x86_64::address_for_global): Likewise.
	(Output_data_plt_x86_64::address_for_local): Likewise.
	(Output_data_plt_x86_64::set_final_data_size): Likewise.
	(Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
	Make method non-static.
	(Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
	method.
	(Output_data_plt_x86_64::get_plt_entry_size): Just call that.
	(Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
	(Output_data_plt_x86_64::add_eh_frame): New method to call it.
	(Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
	virtual method.
	(Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
	(Output_data_plt_x86_64::do_fill_plt_entry): New abstract
	virtual method.
	(Output_data_plt_x86_64::fill_plt_entry): New method to call it.
	(Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
	virtual method.
	(Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
	(Output_data_plt_x86_64::plt_entry_size)
	(Output_data_plt_x86_64::first_plt_entry)
	(Output_data_plt_x86_64::plt_entry)
	(Output_data_plt_x86_64::tlsdesc_plt_entry)
	(Output_data_plt_x86_64::plt_eh_frame_fde_size)
	(Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
	(Output_data_plt_x86_64_standard): ... here, new class.
	(Target_x86_64::Target_x86_64): Take optional argument for the
	Target_info pointer to use.
	(Target_x86_64::do_make_data_plt): New virtual method.
	(Target_x86_64::make_data_plt): New method to call it.
	(Target_x86_64::init_got_plt_for_update): Use that.
	Call this->plt_->add_eh_frame method here.
	(Output_data_plt_x86_64::init):	Don't do add_eh_frame_for_plt here.
	(Target_x86_64::first_plt_entry_offset): Call method on this->plt_
	rather than static method.
	(Target_x86_64::plt_entry_size): Likewise.
	(Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
	rather than plt_entry_size variable.  Move guts of PLT filling to...
	(Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
	(Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
	(Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.

	* i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
	additional argument for the section alignment.
	Don't do add_eh_frame_for_plt here.
	(Output_data_plt_i386::first_plt_entry_offset): Make the method
	non-static.  Use get_plt_entry_size method rather than plt_entry_size
	variable.
	(Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
	method.
	(Output_data_plt_i386::get_plt_entry_size): Call it.
	(Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
	(Output_data_plt_i386::add_eh_frame): New method to call it.
	(Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
	method.
	(Output_data_plt_i386::fill_first_plt_entry): New method to call it.
	(Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
	method.
	(Output_data_plt_i386::fill_plt_entry): New method to call it.
	(Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
	method instead of plt_entry_size.
	(Output_data_plt_i386::plt_entry_size)
	(Output_data_plt_i386::plt_eh_frame_fde_size)
	(Output_data_plt_i386::plt_eh_frame_fde): Move to ...
	(Output_data_plt_i386_standard): ... here, new class.
	(Output_data_plt_i386_exec): New class.
	(Output_data_plt_i386::exec_first_plt_entry): Move to ...
	(Output_data_plt_i386_exec::first_plt_entry): ... here.
	(Output_data_plt_i386::exec_plt_entry): Move to ...
	(Output_data_plt_i386_exec::plt_entry): ... here.
	(Output_data_plt_i386_dyn): New class.
	(Output_data_plt_i386::first_plt_entry): Move to ...
	(Output_data_plt_i386_dyn::first_plt_entry): ... here.
	(Output_data_plt_i386::dyn_plt_entry): Move to ...
	(Output_data_plt_i386_dyn::plt_entry): ... here.
	(Target_i386::Target_i386): Take optional argument for the Target_info
	pointer to use.
	(Target_i386::do_make_data_plt): New virtual method.
	(Target_i386::make_data_plt): New method to call it.
	(Target_i386::make_plt_section): Use that.
	Call this->plt_->add_eh_frame method here.
	(Output_data_plt_i386::add_entry): Use get_plt_entry_size method
	rather than plt_entry_size variable.
	(Output_data_plt_i386::add_local_ifunc_entry): Likewise.
	(Output_data_plt_i386::address_for_local): Likewise.
	(Output_data_plt_i386::do_write): Likewise.
	Move guts of PLT filling to...
	(Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
	(Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
	(Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
	(Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.

Change-Id: Id24b95600489835ff5e860a39c147203d4380c2b
2012-05-02 21:37:24 +00:00
Cary Coutant b9b9f2ee72 elfcpp/
* dwarf.h (enum DW_TAG, enum DW_FORM, enum DW_AT, enum DW_ENCODING)
	(enum DW_OP, enum DW_CFA): Remove.
	Include dwarf2.def.

gold/

	* dwarf_reader.cc (Dwarf_die::read_attributes)
	(Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
	(Dwarf_die::uint_attribute): Remove DW_FORM_null.
	* reduced_debug_output.cc
	(Output_reduced_debug_info_section::get_die_end): Remove
	DW_FORM_GNU_ref_index.  Add default case.
2012-05-01 22:46:36 +00:00
Cary Coutant b008ea786b [Checking in missing files from previous commit.]
* testsuite/gdb_index_test_3.c: New test source file.
        * testsuite/gdb_index_test_3.sh: New test source file.
2012-05-01 22:43:54 +00:00
Mark Wielaard 57923f48a1 gold: Handle DW_AT_high_pc as offset from DW_AT_low_pc in gdb-index.cc.
* dwarf_reader.cc (Dwarf_die::address_attribute): New function.
        * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
        * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
        DW_AT_high_pc as offset from DW_AT_low_pc.

        * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
        * testsuite/Makefile.in: Regenerate.
        * testsuite/gdb_index_test_3.c: New test source file.
        * testsuite/gdb_index_test_3.sh: New test source file.
2012-05-01 19:12:21 +00:00
Ian Lance Taylor 2c54b4f422 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
pointer.
	(Stub_addend_reader::operator()): Declare Arm_relocate_functions
	as a class, not a struct.
	(Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
	(Target_arm::apply_cortex_a8_workaround): Likewise.
	* gc.h: Declare Reloc_types as a struct, not a class.
	* object.h: Declare Symbols_data as a struct.
	* reloc.h: Declare Read_relocs_data as a struct.
	* target.h: Declare Relocate_info as a struct.
2012-04-26 00:07:21 +00:00
David S. Miller a5a5f7a336 gold: Add linker relaxation of tail calls on sparc.
gold/

	* sparc.cc (Target_sparc::Relocate::relax_call): New function.
	(Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
	and R_SPARC_WPLT30.
2012-04-24 22:40:23 +00:00
Cary Coutant f038d49652 * incremental-dump.cc (find_input_containing_global): Replace
magic number with symbolic constant.
	(dump_incremental_inputs): Update version number.
	* incremental.cc (Output_section_incremental_inputs): Update version
	number; import symbolic constants from Incremental_inputs_reader.
	(Incremental_inputs::create_data_sections): Align relocations
	section correctly for 64-bit targets.
	(Output_section_incremental_inputs::set_final_data_size): Use symbolic
	constants; add padding.
	(Output_section_incremental_inputs::write_header): Add assert for
	header_size.
	(Output_section_incremental_inputs::write_input_files): Add assert
	for input_entry_size.
	(Output_section_incremental_inputs::write_info_blocks): Add padding;
	add assert for object_info_size, input_section_entry_size,
	global_sym_entry_size.
	* incremental.h (Incremental_inputs_reader): Add symbolic constants
	for data structure sizes; use them.
	(Incremental_input_entry_reader): Import symbolic constants from
	Incremental_inputs_reader; use them.
2012-04-24 22:05:28 +00:00
David S. Miller a4d851453b gold: Maintain sparc ELF header bits properly
gold/

	* sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
	and elf_flags_set_.
	(Target_sparc::Target_sparc): Initialize new fields.
	(Target_sparc::do_make_elf_object): New function.
	(Target_sparc::do_adjust_elf_header): New function.
2012-04-23 23:42:03 +00:00
Cary Coutant 1d50909894 elfcpp/
* elfcpp_swap.h (struct Swap_aligned32): New template.

gold/

	* gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
	CU range table of gdb index.
2012-04-23 23:31:15 +00:00
David S. Miller 7ebeff7f3a gold: Fix parameterization of do_adjust_elf_header
gold/

	* target.cc (Sized_target::do_adjust_elf_header): Use big_endian
	instead of false.
2012-04-20 22:23:47 +00:00
David S. Miller 2a1079e885 gold: Add support for sparc GOTDATA optimizations in Gold.
gold/

	* sparc.cc (Target_sparc::got_address): New function.
	(Sparc_relocate_functions::gdop_hix22): New function.
	(Sparc_relocate_functions::gdop_lox10): New function.
	(Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
	relocs.
	(Target_sparc::Scan::local): Likewise if the global symbol is not
	preemptible and is not IFUNC.
	(Target_sparc::Relocate::relocate): Perform GOTDATA code
	transformations for local and non-preemptible non-IFUNC global
	symbols.
2012-04-17 02:29:46 +00:00
David S. Miller 0bc964fc79 gold: Fix 64-bit sparc GOLD crash in gdb-index code.
gold/

	* gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
	writing out 64-bit part of ranges.
2012-04-17 02:10:39 +00:00
David S. Miller 661d7a80a2 gold: Build Gold IFUNC tests with -fPIC/-fPIE instead of -fpic/-fpie.
gold/

	* Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
	-fpic and -fpie respectively.
	* Makefile.in: Regenerate.
2012-04-17 02:09:42 +00:00
David S. Miller 8c2bf391c4 gold: Add sparc IFUNC support to Gold.
elfcpp/

	* sparc.h (R_SPARC_JMP_IREL): New relocation.

gold/

	* sparc.cc (class Target_sparc): Add rela_ifunc_.
	(Target_sparc::Target_sparc): Initialize new field.
	(Target_sparc::do_plt_section_for_global): New function.
	(Target_sparc::do_plt_section_for_local): New function.
	(Target_sparc::reloc_needs_plt_for_ifunc): New function.
	(Target_sparc::make_plt_section): New function, broken out of
	make_plt_entry.  Use ORDER_NON_RELRO_FIRST for ".plt".
	(Target_sparc::make_plt_entry): Call make_plt_section.
	(Target_sparc::make_local_ifunc_plt_entry): New function.
	(Target_sparc::rela_ifunc_section): New function.
	(Target_sparc::plt_section): Remove const.
	(Output_data_plt_sparc): Update declarations.  Define Global_ifunc
	and Local_ifunc types.  Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
	and ifunc_count_ fields.
	(Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
	(Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
	(Output_data_plt_sparc::add_local_ifunc_entry): New function.
	(Output_data_plt_sparc::rela_ifunc): New function.
	(Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
	(Output_data_plt_sparc::has_ifunc_section): New function.
	(Output_data_plt_sparc::entry_count): Include ifunc_count_.
	(Output_data_plt_sparc::address_for_global): New function.
	(Output_data_plt_sparc::address_for_local): New function.
	(Output_data_plt_sparc::plt_index_to_offset): New function.
	(Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
	and entry_count.
	(Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
	entry_count.
	(Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
	R_SPARC_JMP_IREL to switch.
	(Target_sparc::Scan::check_non_pic): Likewise.
	(Target_sparc::Scan::local): Handle IFUNC symbols.
	(Target_sparc::Scan::local): Likewise.
	(Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
	and plt_address_for_local.
	(Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
	Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2012-04-17 01:57:23 +00:00
David S. Miller 13cf9988bc gold: Allow use_plt_offset to be specified for global relocations.
gold/

	* output.h (Output_reloc): Allow use_plt_offset for global relocs too.
	(class Output_data_reloc): Adjust calls to Output_reloc_type.
	(Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
	* output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
	global relocs too.
	(Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
	* powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
	calls.
	* sparc.cc (Target_sparc::Scan::global): Likewise.
	* x86_64.cc (Target_x86_64::Scan::global): Likewise.
2012-04-17 01:50:39 +00:00
Cary Coutant 31821be097 * archive.cc (Library_base::should_include_member): Check for
--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-04-17 00:28:41 +00:00
David S. Miller 2615994e91 Support R_SPARC_WDISP10 and R_SPARC_H34.
include/

	* elf/sparc.h (R_SPARC_WDISP10): New reloc.
	* opcode/sparc.h: Define '=' as generating R_SPARC_WDISP10.

opcodes/

	* sparc-dis.c (X_DISP10): Define.
	(print_insn_sparc): Handle '='.

bfd/

	* reloc.c (BFD_RELOC_SPARC_H34, BFD_RELOC_SPARC_SIZE32,
	BFD_RELOC_SPARC_SIZE64, BFD_RELOC_SPARC_WDISP10): New relocs.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Likewise.
	* elfxx-sparc.c (sparc_elf_wdisp10_reloc): New function.
	(_bfd_sparc_elf_howto_table): Add entries for R_SPARC_H34,
	R_SPARC_SIZE32, R_SPARC_64, and R_SPARC_WDISP10.
	(_bfd_sparc_elf_reloc_type_lookup): Handle new relocs.
	(_bfd_sparc_elf_check_relocs): Likewise.
	(_bfd_sparc_elf_gc_sweep_hook): Likewise.
	(_bfd_sparc_elf_relocate_section): Likewise.

gas/

	* config/tc-sparc.c (sparc_ip): Handle '=', "%h34", "%l34", and
	BFD_RELOC_SPARC_H34.
	(md_apply_fix): Handle BFD_RELOC_SPARC_WDISP10 and BFD_RELOC_SPARC_H34.
	(tc_gen_reloc): Likewise.

gas/testsuite/

	* gas/sparc/reloc64.s: Add abs34 code model tests.
	* gas/sparc/reloc64.d: Update.

elfcpp/

	* sparc.h (R_SPARC_WDISP10): New relocation.

gold/

	* sparc.cc (Reloc::wdisp10): New relocation method.
	(Reloc::h34): Likewise.
	(Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
	(Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
	R_SPARC_WDISP10.
	(Target_sparc::Scan::local): Likewise.
	(Target_sparc::Scan::global): Likewise.
	(Target_sparc::Relocate::relocate): Likewise.
2012-04-12 16:26:06 +00:00
Cary Coutant 6782735d48 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
low_pc == 0.
2012-04-09 23:32:20 +00:00
Ian Lance Taylor 8c7a0b00aa * timer.cc: #include <unistd.h>. 2012-04-06 17:21:55 +00:00
Roland McGrath 5879767462 binutils/
2012-04-06  Roland McGrath  <mcgrathr@google.com>

	* configure.in (AC_CHECK_HEADERS): Add locale.h.
	* config.in: Regenerate.
	* configure: Regenerate.

gas/
2012-04-06  Roland McGrath  <mcgrathr@google.com>

	* configure.in (AC_CHECK_HEADERS): Add locale.h.
	* config.in: Regenerate.
	* configure: Regenerate.

gold/
2012-04-06  Roland McGrath  <mcgrathr@google.com>

	* configure.in (AC_CHECK_HEADERS): Add locale.h.
	* config.in: Regenerate.
	* configure: Regenerate.

ld/
2012-04-06  Roland McGrath  <mcgrathr@google.com>

	* configure.in (AC_CHECK_HEADERS): Add locale.h.
	* config.in: Regenerate.
	* configure: Regenerate.
2012-04-06 16:49:02 +00:00
Nick Clifton 443507505d * configure.in (AC_CHECK_FUNCS): Add setlocale.
(AM_LC_MESSAGES): Add.
	* aclocal.m4: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.
2012-04-05 08:43:41 +00:00
Cary Coutant c1027032c2 2012-03-21 Cary Coutant <ccoutant@google.com>
* 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.
2012-03-21 19:02:22 +00:00
Doug Kwan 647f15745a 2012-03-19 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::do_define_standard_symbols): New method.
 	(Target_arm::do_finalize_sections): Remove code which defines
	__exidx_start and __exidx_end.  Make symbol table parameter
	anonymous as it is not used.
	* gold.cc (queue_middle_tasks): Call target hook to define any
	target-specific symbols.
	* target.h (Target::define_standard_symbols): New method.
	(Target::do_define_standard_symbols): Same.
	* testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/arm_exidx.s: Generate data relocations for __exidx_start
	and __exidx_end.
	* testsuite/arm_exidx_test.sh: Check that no unused dynamic
	relocations are generated for __exidx_start and __exidx_end.
2012-03-19 23:54:07 +00:00
Doug Kwan 7c6109da4a 2012-03-16 Doug Kwan <dougkwan@google.com>
* testsuite/Makefile.am: Disable test initpri3b.
	* testsuite/Makefile.in: Regenerate.
2012-03-17 01:33:19 +00:00
Doug Kwan 7b8957f8c3 2012-03-15 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::got_section): Make .got section read-only
	if -z now is given.
2012-03-15 18:24:06 +00:00
Ian Lance Taylor 14dc9ef7d1 PR gold/13850
* layout.cc (Layout::make_output_section): Correctly mark
	SHT_INIT_ARRAY, et. al., as relro.
2012-03-15 16:32:22 +00:00
Doug Kwan fa40b62ad4 2012-03-14 Doug Kwan <dougkwan@google.com>
* gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
	dynamic relocations for protected symbols in shared objects.
2012-03-14 23:07:07 +00:00
Ian Lance Taylor fd32500759 * resolve.cc (Symbol_table::resolve): When merging common symbols,
keep the larger alignment.
2012-03-13 16:08:53 +00:00
Cary Coutant e8dd54e14a * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
handling of DW_LNE_define_file.
2012-03-13 00:25:58 +00:00
Cary Coutant feb5f3b016 elfcpp/
Update DWARF enums from ../include/dwarf2.h.
	* dwarf.h (enum DW_TAG): Add new DWARF-4 tags.
	(enum DW_FORM): Add new DWARF-4 and Fission extensions.
	(enum DW_AT): New enum.
	(enum DW_LINE_EXTENDED_OPS): Add new DWARF-4 opcode.
	(enum DW_ENCODING): Add new DWARF-4 encoding.
	(enum DW_OP): Add new DWARF-4 opcodes.
	(enum DW_CHILDREN): New enum.
	(enum DW_LANG): New enum.

gold/

	* reduced_debug_output.cc
	(Output_reduced_debug_info_section::get_die_end): Add new FORM
	codes to switch.
2012-03-13 00:13:08 +00:00