From fd6fc0c5f6ec26b3b526655a721b7b0af0b14644 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Tue, 24 Feb 2015 18:17:57 +0800 Subject: Update binutils-2.25/gold to ToT commit be66981e1605eff305ac9c561825f4bd6801fca2 Author: H.J. Lu Date: Sun Feb 22 05:18:50 2015 -0800 Set GOLD_DEFAULT_SIZE to 32 for x32 * configure.ac (default_size): Set to 32 for x32. * configure: Regenerated. Change-Id: I4b2d8927e4e41cf2fac3c92d00e8aef69b5ce21f --- binutils-2.25/gold/ChangeLog | 560 +++- binutils-2.25/gold/Makefile.am | 2 +- binutils-2.25/gold/Makefile.in | 2 +- binutils-2.25/gold/NEWS | 2 +- binutils-2.25/gold/README | 2 +- binutils-2.25/gold/aarch64-reloc-property.cc | 2 +- binutils-2.25/gold/aarch64-reloc-property.h | 2 +- binutils-2.25/gold/aarch64-reloc.def | 104 +- binutils-2.25/gold/aarch64.cc | 3081 ++++++++++++++++++-- binutils-2.25/gold/archive.cc | 64 +- binutils-2.25/gold/archive.h | 2 +- binutils-2.25/gold/arm-reloc-property.cc | 2 +- binutils-2.25/gold/arm-reloc-property.h | 2 +- binutils-2.25/gold/arm-reloc.def | 2 +- binutils-2.25/gold/arm.cc | 616 +++- binutils-2.25/gold/attributes.cc | 2 +- binutils-2.25/gold/attributes.h | 2 +- binutils-2.25/gold/binary.cc | 17 +- binutils-2.25/gold/binary.h | 5 +- binutils-2.25/gold/common.cc | 2 +- binutils-2.25/gold/common.h | 2 +- binutils-2.25/gold/compressed_output.cc | 2 +- binutils-2.25/gold/compressed_output.h | 2 +- binutils-2.25/gold/configure | 29 +- binutils-2.25/gold/configure.ac | 18 +- binutils-2.25/gold/configure.tgt | 3 +- binutils-2.25/gold/copy-relocs.cc | 2 +- binutils-2.25/gold/copy-relocs.h | 2 +- binutils-2.25/gold/cref.cc | 2 +- binutils-2.25/gold/cref.h | 2 +- binutils-2.25/gold/debug.h | 2 +- binutils-2.25/gold/defstd.cc | 2 +- binutils-2.25/gold/defstd.h | 2 +- binutils-2.25/gold/descriptors.cc | 19 +- binutils-2.25/gold/descriptors.h | 2 +- binutils-2.25/gold/dirsearch.cc | 2 +- binutils-2.25/gold/dirsearch.h | 2 +- binutils-2.25/gold/dwarf_reader.cc | 2 +- binutils-2.25/gold/dwarf_reader.h | 2 +- binutils-2.25/gold/dwp.cc | 4 +- binutils-2.25/gold/dwp.h | 2 +- binutils-2.25/gold/dynobj.cc | 2 +- binutils-2.25/gold/dynobj.h | 2 +- binutils-2.25/gold/ehframe.cc | 2 +- binutils-2.25/gold/ehframe.h | 2 +- binutils-2.25/gold/errors.cc | 2 +- binutils-2.25/gold/errors.h | 2 +- binutils-2.25/gold/expression.cc | 2 +- binutils-2.25/gold/ffsll.c | 2 +- binutils-2.25/gold/fileread.cc | 4 +- binutils-2.25/gold/fileread.h | 2 +- binutils-2.25/gold/freebsd.h | 2 +- binutils-2.25/gold/ftruncate.c | 2 +- binutils-2.25/gold/gc.cc | 2 +- binutils-2.25/gold/gc.h | 9 +- binutils-2.25/gold/gdb-index.cc | 6 +- binutils-2.25/gold/gdb-index.h | 2 +- binutils-2.25/gold/gold-threads.cc | 2 +- binutils-2.25/gold/gold-threads.h | 2 +- binutils-2.25/gold/gold.cc | 5 +- binutils-2.25/gold/gold.h | 2 +- binutils-2.25/gold/i386.cc | 2 +- binutils-2.25/gold/icf.cc | 2 +- binutils-2.25/gold/icf.h | 2 +- binutils-2.25/gold/incremental-dump.cc | 2 +- binutils-2.25/gold/incremental.cc | 3 +- binutils-2.25/gold/incremental.h | 2 +- binutils-2.25/gold/int_encoding.cc | 2 +- binutils-2.25/gold/int_encoding.h | 2 +- binutils-2.25/gold/layout.cc | 33 +- binutils-2.25/gold/layout.h | 5 +- binutils-2.25/gold/main.cc | 2 +- binutils-2.25/gold/mapfile.cc | 18 +- binutils-2.25/gold/mapfile.h | 2 +- binutils-2.25/gold/merge.cc | 30 +- binutils-2.25/gold/merge.h | 2 +- binutils-2.25/gold/mips.cc | 32 +- binutils-2.25/gold/mremap.c | 2 +- binutils-2.25/gold/nacl.cc | 2 +- binutils-2.25/gold/nacl.h | 2 +- binutils-2.25/gold/object.cc | 24 +- binutils-2.25/gold/object.h | 9 +- binutils-2.25/gold/options.cc | 9 +- binutils-2.25/gold/options.h | 8 +- binutils-2.25/gold/output.cc | 17 +- binutils-2.25/gold/output.h | 13 +- binutils-2.25/gold/parameters.cc | 2 +- binutils-2.25/gold/parameters.h | 2 +- binutils-2.25/gold/plugin.cc | 24 +- binutils-2.25/gold/plugin.h | 14 +- binutils-2.25/gold/po/Make-in | 2 +- binutils-2.25/gold/powerpc.cc | 549 ++-- binutils-2.25/gold/pread.c | 2 +- binutils-2.25/gold/readsyms.cc | 2 +- binutils-2.25/gold/readsyms.h | 2 +- binutils-2.25/gold/reduced_debug_output.cc | 2 +- binutils-2.25/gold/reduced_debug_output.h | 2 +- binutils-2.25/gold/reloc-types.h | 2 +- binutils-2.25/gold/reloc.cc | 2 +- binutils-2.25/gold/reloc.h | 2 +- binutils-2.25/gold/resolve.cc | 2 +- binutils-2.25/gold/script-c.h | 2 +- binutils-2.25/gold/script-sections.cc | 2 +- binutils-2.25/gold/script-sections.h | 2 +- binutils-2.25/gold/script.cc | 2 +- binutils-2.25/gold/script.h | 2 +- binutils-2.25/gold/sparc.cc | 2 +- binutils-2.25/gold/stringpool.cc | 2 +- binutils-2.25/gold/stringpool.h | 2 +- binutils-2.25/gold/symtab.cc | 3 +- binutils-2.25/gold/symtab.h | 8 +- binutils-2.25/gold/system.h | 2 +- binutils-2.25/gold/target-reloc.h | 2 +- binutils-2.25/gold/target-select.cc | 2 +- binutils-2.25/gold/target-select.h | 2 +- binutils-2.25/gold/target.cc | 2 +- binutils-2.25/gold/target.h | 2 +- binutils-2.25/gold/testsuite/Makefile.am | 137 +- binutils-2.25/gold/testsuite/Makefile.in | 220 +- binutils-2.25/gold/testsuite/arm_abs_global.sh | 2 +- binutils-2.25/gold/testsuite/arm_attr_merge.sh | 2 +- .../gold/testsuite/arm_branch_in_range.sh | 2 +- .../gold/testsuite/arm_branch_out_of_range.sh | 2 +- binutils-2.25/gold/testsuite/arm_branch_range.t | 2 +- binutils-2.25/gold/testsuite/arm_cortex_a8.sh | 2 +- binutils-2.25/gold/testsuite/arm_exidx_test.sh | 2 +- .../gold/testsuite/arm_farcall_arm_arm.sh | 2 +- .../gold/testsuite/arm_farcall_arm_thumb.sh | 2 +- .../gold/testsuite/arm_farcall_thumb_arm.sh | 2 +- .../gold/testsuite/arm_farcall_thumb_thumb.sh | 2 +- binutils-2.25/gold/testsuite/arm_fix_1176.sh | 2 +- binutils-2.25/gold/testsuite/arm_fix_v4bx.sh | 2 +- binutils-2.25/gold/testsuite/arm_thm_jump11.t | 2 +- binutils-2.25/gold/testsuite/arm_thm_jump8.t | 2 +- .../gold/testsuite/arm_unaligned_reloc.sh | 2 +- binutils-2.25/gold/testsuite/basic_test.cc | 2 +- binutils-2.25/gold/testsuite/binary_test.cc | 2 +- binutils-2.25/gold/testsuite/binary_unittest.cc | 2 +- binutils-2.25/gold/testsuite/common_test_1.c | 2 +- binutils-2.25/gold/testsuite/common_test_1_v1.c | 2 +- binutils-2.25/gold/testsuite/common_test_1_v2.c | 2 +- binutils-2.25/gold/testsuite/common_test_2.c | 2 +- binutils-2.25/gold/testsuite/common_test_3.c | 2 +- binutils-2.25/gold/testsuite/constructor_test.cc | 2 +- binutils-2.25/gold/testsuite/copy_test.cc | 2 +- binutils-2.25/gold/testsuite/copy_test_1.cc | 2 +- binutils-2.25/gold/testsuite/copy_test_2.cc | 2 +- binutils-2.25/gold/testsuite/copy_test_v1.cc | 2 +- binutils-2.25/gold/testsuite/debug_msg.cc | 4 +- binutils-2.25/gold/testsuite/debug_msg.sh | 2 +- binutils-2.25/gold/testsuite/defsym_test.sh | 2 +- .../testsuite/discard_locals_relocatable_test.c | 2 +- binutils-2.25/gold/testsuite/discard_locals_test.c | 2 +- .../gold/testsuite/discard_locals_test.sh | 2 +- binutils-2.25/gold/testsuite/dwp_test.h | 2 +- binutils-2.25/gold/testsuite/dwp_test_1.cc | 2 +- binutils-2.25/gold/testsuite/dwp_test_1.sh | 2 +- binutils-2.25/gold/testsuite/dwp_test_1b.cc | 2 +- binutils-2.25/gold/testsuite/dwp_test_2.cc | 2 +- binutils-2.25/gold/testsuite/dwp_test_2.sh | 2 +- binutils-2.25/gold/testsuite/dwp_test_main.cc | 2 +- binutils-2.25/gold/testsuite/dyn_weak_ref.sh | 2 +- binutils-2.25/gold/testsuite/dyn_weak_ref_1.c | 2 +- binutils-2.25/gold/testsuite/dyn_weak_ref_2.c | 2 +- binutils-2.25/gold/testsuite/dynamic_list.sh | 2 +- binutils-2.25/gold/testsuite/dynamic_list_2.cc | 2 +- binutils-2.25/gold/testsuite/dynamic_list_2.t | 2 +- binutils-2.25/gold/testsuite/dynamic_list_lib1.cc | 2 +- binutils-2.25/gold/testsuite/dynamic_list_lib2.cc | 2 +- binutils-2.25/gold/testsuite/ehdr_start_def.cc | 2 +- binutils-2.25/gold/testsuite/ehdr_start_test.cc | 2 +- binutils-2.25/gold/testsuite/ehdr_start_test.t | 2 +- binutils-2.25/gold/testsuite/ehdr_start_test_4.sh | 2 +- binutils-2.25/gold/testsuite/exception_test.h | 2 +- binutils-2.25/gold/testsuite/exception_test_1.cc | 2 +- binutils-2.25/gold/testsuite/exception_test_2.cc | 2 +- .../gold/testsuite/exception_test_main.cc | 2 +- binutils-2.25/gold/testsuite/exclude_libs_test.sh | 2 +- binutils-2.25/gold/testsuite/final_layout.cc | 2 +- binutils-2.25/gold/testsuite/final_layout.sh | 2 +- binutils-2.25/gold/testsuite/gc_comdat_test.sh | 2 +- binutils-2.25/gold/testsuite/gc_comdat_test_1.cc | 2 +- binutils-2.25/gold/testsuite/gc_comdat_test_2.cc | 2 +- .../gold/testsuite/gc_dynamic_list_test.c | 2 +- .../gold/testsuite/gc_dynamic_list_test.sh | 2 +- .../gold/testsuite/gc_dynamic_list_test.t | 2 +- .../gold/testsuite/gc_orphan_section_test.cc | 2 +- .../gold/testsuite/gc_orphan_section_test.sh | 2 +- binutils-2.25/gold/testsuite/gc_tls_test.cc | 2 +- binutils-2.25/gold/testsuite/gc_tls_test.sh | 2 +- binutils-2.25/gold/testsuite/gdb_index_test.cc | 2 +- binutils-2.25/gold/testsuite/gdb_index_test_1.sh | 2 +- binutils-2.25/gold/testsuite/gdb_index_test_2.sh | 2 +- binutils-2.25/gold/testsuite/gdb_index_test_3.c | 2 +- binutils-2.25/gold/testsuite/gdb_index_test_3.sh | 2 +- binutils-2.25/gold/testsuite/gdb_index_test_4.sh | 2 +- .../gold/testsuite/gdb_index_test_comm.sh | 2 +- binutils-2.25/gold/testsuite/hidden_test.sh | 2 +- binutils-2.25/gold/testsuite/hidden_test_1.c | 2 +- binutils-2.25/gold/testsuite/hidden_test_main.c | 2 +- .../gold/testsuite/icf_keep_unique_test.cc | 2 +- .../gold/testsuite/icf_keep_unique_test.sh | 2 +- .../testsuite/icf_preemptible_functions_test.cc | 2 +- .../testsuite/icf_preemptible_functions_test.sh | 2 +- binutils-2.25/gold/testsuite/icf_safe_so_test.cc | 10 +- binutils-2.25/gold/testsuite/icf_safe_so_test.sh | 2 +- binutils-2.25/gold/testsuite/icf_safe_test.cc | 2 +- binutils-2.25/gold/testsuite/icf_safe_test.sh | 4 +- .../gold/testsuite/icf_sht_rel_addend_test.sh | 2 +- .../gold/testsuite/icf_sht_rel_addend_test_1.cc | 2 +- .../gold/testsuite/icf_sht_rel_addend_test_2.cc | 2 +- .../gold/testsuite/icf_string_merge_test.cc | 2 +- .../gold/testsuite/icf_string_merge_test.sh | 2 +- binutils-2.25/gold/testsuite/icf_test.cc | 2 +- binutils-2.25/gold/testsuite/icf_test.sh | 2 +- .../testsuite/icf_virtual_function_folding_test.cc | 2 +- binutils-2.25/gold/testsuite/incr_comdat_test_1.cc | 2 +- .../gold/testsuite/incr_comdat_test_2_v1.cc | 2 +- .../gold/testsuite/incr_comdat_test_2_v2.cc | 2 +- .../gold/testsuite/incr_comdat_test_2_v3.cc | 2 +- binutils-2.25/gold/testsuite/incremental_test.sh | 2 +- binutils-2.25/gold/testsuite/incremental_test_1.c | 2 +- binutils-2.25/gold/testsuite/incremental_test_2.c | 2 +- binutils-2.25/gold/testsuite/initpri1.c | 2 +- binutils-2.25/gold/testsuite/initpri2.c | 2 +- binutils-2.25/gold/testsuite/initpri3.c | 2 +- binutils-2.25/gold/testsuite/justsyms.t | 2 +- binutils-2.25/gold/testsuite/justsyms_1.cc | 2 +- binutils-2.25/gold/testsuite/justsyms_2.cc | 2 +- binutils-2.25/gold/testsuite/justsyms_exec.c | 2 +- binutils-2.25/gold/testsuite/justsyms_lib.c | 2 +- binutils-2.25/gold/testsuite/large.c | 2 +- .../gold/testsuite/large_symbol_alignment.cc | 2 +- binutils-2.25/gold/testsuite/leb128_unittest.cc | 2 +- binutils-2.25/gold/testsuite/many_sections_test.cc | 2 +- binutils-2.25/gold/testsuite/memory_test.sh | 2 +- .../gold/testsuite/merge_string_literals.sh | 2 +- .../gold/testsuite/merge_string_literals_1.cc | 2 +- .../gold/testsuite/merge_string_literals_2.cc | 2 +- binutils-2.25/gold/testsuite/missing_key_func.cc | 2 +- binutils-2.25/gold/testsuite/missing_key_func.sh | 2 +- binutils-2.25/gold/testsuite/no_version_test.c | 2 +- binutils-2.25/gold/testsuite/no_version_test.sh | 2 +- binutils-2.25/gold/testsuite/object_unittest.cc | 2 +- .../gold/testsuite/pie_copyrelocs_shared_test.cc | 2 +- .../gold/testsuite/pie_copyrelocs_test.cc | 2 +- .../gold/testsuite/plugin_common_test_1.c | 2 +- .../gold/testsuite/plugin_common_test_2.c | 2 +- .../gold/testsuite/plugin_final_layout.cc | 2 +- .../gold/testsuite/plugin_final_layout.sh | 2 +- .../gold/testsuite/plugin_section_order.c | 2 +- binutils-2.25/gold/testsuite/plugin_test.c | 58 +- binutils-2.25/gold/testsuite/plugin_test_1.sh | 18 +- binutils-2.25/gold/testsuite/plugin_test_10.sh | 2 +- binutils-2.25/gold/testsuite/plugin_test_11.sh | 59 + binutils-2.25/gold/testsuite/plugin_test_2.sh | 14 +- binutils-2.25/gold/testsuite/plugin_test_3.sh | 18 +- binutils-2.25/gold/testsuite/plugin_test_4.sh | 2 +- binutils-2.25/gold/testsuite/plugin_test_6.sh | 26 +- binutils-2.25/gold/testsuite/plugin_test_7.sh | 2 +- binutils-2.25/gold/testsuite/plugin_test_7_1.c | 2 +- binutils-2.25/gold/testsuite/plugin_test_7_2.c | 2 +- binutils-2.25/gold/testsuite/plugin_test_tls.sh | 20 +- binutils-2.25/gold/testsuite/pr12826.sh | 2 +- binutils-2.25/gold/testsuite/pr14265.sh | 2 +- binutils-2.25/gold/testsuite/protected_1.cc | 2 +- binutils-2.25/gold/testsuite/protected_2.cc | 2 +- binutils-2.25/gold/testsuite/protected_3.cc | 2 +- binutils-2.25/gold/testsuite/protected_4.cc | 2 +- binutils-2.25/gold/testsuite/protected_main_1.cc | 2 +- binutils-2.25/gold/testsuite/protected_main_2.cc | 2 +- binutils-2.25/gold/testsuite/protected_main_3.cc | 2 +- binutils-2.25/gold/testsuite/relro_script_test.t | 2 +- binutils-2.25/gold/testsuite/relro_test.cc | 2 +- binutils-2.25/gold/testsuite/relro_test.sh | 2 +- binutils-2.25/gold/testsuite/relro_test_main.cc | 2 +- .../gold/testsuite/retain_symbols_file_test.sh | 2 +- binutils-2.25/gold/testsuite/script_test_1.cc | 2 +- binutils-2.25/gold/testsuite/script_test_1.t | 2 +- binutils-2.25/gold/testsuite/script_test_10.sh | 2 +- binutils-2.25/gold/testsuite/script_test_10.t | 2 +- binutils-2.25/gold/testsuite/script_test_2.cc | 2 +- binutils-2.25/gold/testsuite/script_test_2.t | 2 +- binutils-2.25/gold/testsuite/script_test_2a.cc | 2 +- binutils-2.25/gold/testsuite/script_test_2b.cc | 2 +- binutils-2.25/gold/testsuite/script_test_3.sh | 2 +- binutils-2.25/gold/testsuite/script_test_3.t | 2 +- binutils-2.25/gold/testsuite/script_test_4.sh | 2 +- binutils-2.25/gold/testsuite/script_test_4.t | 2 +- binutils-2.25/gold/testsuite/script_test_5.cc | 2 +- binutils-2.25/gold/testsuite/script_test_5.sh | 2 +- binutils-2.25/gold/testsuite/script_test_5.t | 2 +- binutils-2.25/gold/testsuite/script_test_6.sh | 2 +- binutils-2.25/gold/testsuite/script_test_6.t | 2 +- binutils-2.25/gold/testsuite/script_test_7.sh | 2 +- binutils-2.25/gold/testsuite/script_test_7.t | 2 +- binutils-2.25/gold/testsuite/script_test_8.sh | 2 +- binutils-2.25/gold/testsuite/script_test_9.cc | 2 +- binutils-2.25/gold/testsuite/script_test_9.sh | 2 +- binutils-2.25/gold/testsuite/searched_file_test.cc | 2 +- .../gold/testsuite/searched_file_test_lib.cc | 2 +- .../gold/testsuite/section_sorting_name.cc | 2 +- .../gold/testsuite/section_sorting_name.sh | 2 +- binutils-2.25/gold/testsuite/split_i386.sh | 2 +- binutils-2.25/gold/testsuite/split_x32.sh | 55 + binutils-2.25/gold/testsuite/split_x32_1.s | 33 + binutils-2.25/gold/testsuite/split_x32_2.s | 33 + binutils-2.25/gold/testsuite/split_x32_3.s | 22 + binutils-2.25/gold/testsuite/split_x32_4.s | 23 + binutils-2.25/gold/testsuite/split_x32_n.s | 12 + binutils-2.25/gold/testsuite/split_x86_64.sh | 2 +- binutils-2.25/gold/testsuite/start_lib_test_1.c | 2 +- binutils-2.25/gold/testsuite/start_lib_test_2.c | 2 +- binutils-2.25/gold/testsuite/start_lib_test_3.c | 2 +- binutils-2.25/gold/testsuite/start_lib_test_main.c | 2 +- .../gold/testsuite/strong_ref_weak_def.sh | 2 +- .../gold/testsuite/strong_ref_weak_def_1.c | 2 +- .../gold/testsuite/strong_ref_weak_def_2.c | 2 +- binutils-2.25/gold/testsuite/test.cc | 2 +- binutils-2.25/gold/testsuite/test.h | 2 +- binutils-2.25/gold/testsuite/testfile.cc | 2 +- binutils-2.25/gold/testsuite/testfile.h | 2 +- binutils-2.25/gold/testsuite/testmain.cc | 2 +- .../gold/testsuite/text_section_grouping.cc | 2 +- .../gold/testsuite/text_section_grouping.sh | 2 +- binutils-2.25/gold/testsuite/thin_archive_main.cc | 2 +- .../gold/testsuite/thin_archive_test_1.cc | 2 +- .../gold/testsuite/thin_archive_test_2.cc | 2 +- .../gold/testsuite/thin_archive_test_3.cc | 2 +- .../gold/testsuite/thin_archive_test_4.cc | 2 +- binutils-2.25/gold/testsuite/thumb2_branch_range.t | 2 +- binutils-2.25/gold/testsuite/thumb_branch_range.t | 2 +- binutils-2.25/gold/testsuite/tls_test.cc | 2 +- binutils-2.25/gold/testsuite/tls_test.h | 2 +- binutils-2.25/gold/testsuite/tls_test_c.c | 2 +- binutils-2.25/gold/testsuite/tls_test_file2.cc | 2 +- binutils-2.25/gold/testsuite/tls_test_main.cc | 2 +- binutils-2.25/gold/testsuite/two_file_shared.sh | 2 +- binutils-2.25/gold/testsuite/two_file_test.h | 2 +- binutils-2.25/gold/testsuite/two_file_test_1.cc | 2 +- binutils-2.25/gold/testsuite/two_file_test_1_v1.cc | 2 +- binutils-2.25/gold/testsuite/two_file_test_1b.cc | 2 +- .../gold/testsuite/two_file_test_1b_v1.cc | 2 +- binutils-2.25/gold/testsuite/two_file_test_2.cc | 2 +- .../gold/testsuite/two_file_test_2_tls.cc | 2 +- binutils-2.25/gold/testsuite/two_file_test_2_v1.cc | 2 +- binutils-2.25/gold/testsuite/two_file_test_main.cc | 2 +- binutils-2.25/gold/testsuite/two_file_test_tls.cc | 2 +- binutils-2.25/gold/testsuite/undef_symbol.cc | 2 +- binutils-2.25/gold/testsuite/undef_symbol.sh | 2 +- binutils-2.25/gold/testsuite/undef_symbol_main.cc | 2 +- binutils-2.25/gold/testsuite/ver_matching_def.cc | 2 +- binutils-2.25/gold/testsuite/ver_matching_test.sh | 2 +- binutils-2.25/gold/testsuite/ver_test.h | 2 +- binutils-2.25/gold/testsuite/ver_test_1.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_1.sh | 2 +- binutils-2.25/gold/testsuite/ver_test_10.script | 2 +- binutils-2.25/gold/testsuite/ver_test_10.sh | 2 +- binutils-2.25/gold/testsuite/ver_test_2.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_2.script | 2 +- binutils-2.25/gold/testsuite/ver_test_2.sh | 2 +- binutils-2.25/gold/testsuite/ver_test_3.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_4.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_4.script | 2 +- binutils-2.25/gold/testsuite/ver_test_4.sh | 2 +- binutils-2.25/gold/testsuite/ver_test_5.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_5.script | 2 +- binutils-2.25/gold/testsuite/ver_test_5.sh | 2 +- binutils-2.25/gold/testsuite/ver_test_6.c | 2 +- binutils-2.25/gold/testsuite/ver_test_7.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_7.sh | 2 +- binutils-2.25/gold/testsuite/ver_test_8.script | 2 +- binutils-2.25/gold/testsuite/ver_test_9.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_main.cc | 2 +- binutils-2.25/gold/testsuite/ver_test_main_2.cc | 2 +- binutils-2.25/gold/testsuite/weak_alias_test_1.cc | 2 +- binutils-2.25/gold/testsuite/weak_alias_test_2.cc | 2 +- binutils-2.25/gold/testsuite/weak_alias_test_3.cc | 2 +- binutils-2.25/gold/testsuite/weak_alias_test_4.cc | 2 +- binutils-2.25/gold/testsuite/weak_alias_test_5.cc | 2 +- .../gold/testsuite/weak_alias_test_main.cc | 2 +- binutils-2.25/gold/testsuite/weak_plt.sh | 2 +- binutils-2.25/gold/testsuite/weak_plt_main.cc | 2 +- binutils-2.25/gold/testsuite/weak_plt_shared.cc | 2 +- binutils-2.25/gold/testsuite/weak_test.cc | 2 +- binutils-2.25/gold/testsuite/weak_undef.h | 2 +- binutils-2.25/gold/testsuite/weak_undef_file1.cc | 2 +- binutils-2.25/gold/testsuite/weak_undef_file2.cc | 2 +- binutils-2.25/gold/testsuite/weak_undef_file3.cc | 2 +- binutils-2.25/gold/testsuite/weak_undef_file4.cc | 2 +- binutils-2.25/gold/testsuite/weak_undef_test.cc | 2 +- binutils-2.25/gold/testsuite/weak_undef_test_2.cc | 2 +- binutils-2.25/gold/tilegx.cc | 2 +- binutils-2.25/gold/timer.cc | 2 +- binutils-2.25/gold/timer.h | 2 +- binutils-2.25/gold/tls.h | 2 +- binutils-2.25/gold/token.h | 2 +- binutils-2.25/gold/version.cc | 4 +- binutils-2.25/gold/workqueue-internal.h | 2 +- binutils-2.25/gold/workqueue-threads.cc | 2 +- binutils-2.25/gold/workqueue.cc | 2 +- binutils-2.25/gold/workqueue.h | 2 +- binutils-2.25/gold/x86_64.cc | 83 +- binutils-2.25/gold/yyscript.y | 2 +- 404 files changed, 5646 insertions(+), 1252 deletions(-) create mode 100755 binutils-2.25/gold/testsuite/plugin_test_11.sh create mode 100755 binutils-2.25/gold/testsuite/split_x32.sh create mode 100644 binutils-2.25/gold/testsuite/split_x32_1.s create mode 100644 binutils-2.25/gold/testsuite/split_x32_2.s create mode 100644 binutils-2.25/gold/testsuite/split_x32_3.s create mode 100644 binutils-2.25/gold/testsuite/split_x32_4.s create mode 100644 binutils-2.25/gold/testsuite/split_x32_n.s diff --git a/binutils-2.25/gold/ChangeLog b/binutils-2.25/gold/ChangeLog index 88dd58f5..b73da0a2 100644 --- a/binutils-2.25/gold/ChangeLog +++ b/binutils-2.25/gold/ChangeLog @@ -1,10 +1,562 @@ -2014-10-28 Alan Modra +2015-02-21 H.J. Lu + + * configure.ac (default_size): Set to 32 for x32. + * configure: Regenerated. + +2015-02-18 Alan Modra + + PR 17954 + * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default + visibility. + +2015-02-17 Rafael Ávila de Espíndola + + * gc.h (Garbage_collection::add_reference): Don't use find. + +2015-02-17 Rafael Ávila de Espíndola + + * object.cc (write_local_symbols): avoid std::vector copy. + +2015-02-17 Rafael Ávila de Espíndola + + * merge.cc (get_output_offset): Use upper_bound instead of lower_bound. + +2015-02-09 Mark Wielaard + + * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize + DW_LANG_Fortran03 and DW_LANG_Fortran08. + +2015-02-16 Cary Coutant + + PR gold/13577 + PR gold/16992 + * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or + DF_SYMBOLIC if --dynamic-list option is used. + * options.cc (General_options::finalize): --dynamic-list is not + mutually exclusive with -Bsymbolic. + * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not + listed in --dynamic-list. + * testsuite/Makefile.am (dynamic_list_lib2.so): Add + -Bsymbolic-functions. + * testsuite/Makefile.in: Regenerate. + +2015-02-16 Cary Coutant + + PR gold/17971 + * incremental.cc: Remove redundant include of "output.h". + +2015-02-12 Jing Yu + + * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1, + TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,): + New relocation. + * aarch64.cc (Target_aarch64::Scan::local): Add cases for new + TLSLE_MOVW_* relocations. + (Target_aarch64::Scan::global): Likewise. + (Target_aarch64::Relocate::relocate): Likewise. + (Target_aarch64::Relocate::relocate_tls): Add cases and handlings + for new TLSLE_MOVW_* relocations. + +2015-02-11 Will Newton + + PR gold/13321 + * arm.cc (Target_arm::make_plt_section): Create an ARM + state mapping symbol at the start of the PLT. + +2015-02-09 H.J. Lu + + * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES): + Replace two_file_shared_2.so with two_file_shared_1.so. + * testsuite/Makefile.in: Regenerated. + +2015-02-09 Alan Modra + + * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a, + plugin_test_thin.a and defsym_test. + * testsuite/Makefile.in: Regenerate. + +2015-02-04 Rafael Ávila de Espíndola + + * merge.cc (do_add_input_section): Combine loop epilogue into main loop + body. + +2015-02-04 Peter Collingbourne + + * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve + forwarding symbols when computing symbol resolution info for plugins. + * plugin.h (Plugin_manager::symtab): New method. + (Pluginobj::get_symbol_resolution_info): Add symtab parameter. + +2015-02-03 Cary Coutant + Peter Collingbourne + + PR gold/15660 + * archive.cc (Thin_archive_object_unlocker): New class. + (Archive::include_member): Unlock external members of thin archives. + * testsuite/Makefile.am (plugin_test_1): Rename .syms files. + (plugin_test_2): Likewise. + (plugin_test_3): Likewise. + (plugin_test_4): Likewise. + (plugin_test_5): Likewise. + (plugin_test_6): Likewise. + (plugin_test_7): Likewise. + (plugin_test_8): Likewise. + (plugin_test_9): Likewise. + (plugin_test_10): Likewise. + (plugin_test_11): New test case. + * testsuite/Makefile.in: Regenerate. + * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms + file to decide whether to claim file. + (all_symbols_read_hook): Likewise. + * testsuite/plugin_test_1.sh: Adjust expected output. + * testsuite/plugin_test_2.sh: Likewise. + * testsuite/plugin_test_3.sh: Likewise. + * testsuite/plugin_test_6.sh: Likewise. + * testsuite/plugin_test_tls.sh: Likewise. + * testsuite/plugin_test_11.sh: New testcase. + +2015-02-03 Cary Coutant + + * descriptors.cc (Descriptors::open): Set artificially-low limit for + file descriptors when debugging enabled. Add debug output. + (Descriptors::release): Add debug output. + (Descriptors::close_some_descriptor): Likewise. + (Descriptors::close_all): Likewise. + * fileread.cc (File_read::lock): Likewise. + (File_read::unlock): Likewise. + +2015-02-02 Cary Coutant + + * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for + executable output file. + +2015-01-22 Han Shen + + * arm.cc (Target_arm::Target_arm): Add initialization for new members. + (Target_arm::do_plt_address_for_global): New method. + (Target_arm::do_plt_address_for_local): New method. + (Target_arm::rel_irelative_section): New method. + (Target_arm::make_data_plt): Add more parameters for plt ctor. + (Target_arm::do_make_data_plt): Add more parameters for plt ctor. + (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support. + (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support. + (Target_arm::Scan::check_non_pic): Add ifunc support. + (Target_arm::Scan::local): Add ifunc support. + (Target_arm::Scan::global): Add ifunc support. + (Target_arm::make_plt_section): New method. + (Target_arm::make_plt_entry): Change to call to make_plt_section. + (Target_arm::make_local_ifunc_plt_entry): New method. + (Target_arm::got_irelative_): New member. + (Target_arm::rel_irelative_): New member. + (Target_arm::got_section): Add creation for got_irelative_. + (Target_arm::rel_dyn_section): Add creation for rel_irelative_. + (Target_arm::Relocate::relocate): Properly set local ifunc address. + (Target_arm::do_dynsym_value): Properly set global ifunc address. + (Target_arm::scan_reloc_for_stub): Properly set global ifunc address. + (Output_data_plt_arm::IRelative_data): New type. + (Output_data_plt_arm::Output_data_plt_arm): Add more parameters. + (Output_data_plt_arm::add_entry): Add more parameters. + (Output_data_plt_arm::add_relocation): New method. + (Output_data_plt_arm::add_local_ifunc_entry): New method. + (Output_data_plt_arm::rel_irelative): New method. + (Output_data_plt_arm::entry_count): Modified. + (Output_data_plt_arm::address_for_global): New method. + (Output_data_plt_arm::address_for_local): New method. +gold/ + (Output_data_plt_arm::set_final_data_size): Add irelative_count_. + (Output_data_plt_arm::insert_irelative_data): New method. + (Output_data_plt_arm::irelative_rel_): New member. + (Output_data_plt_arm::got_): New member. + (Output_data_plt_arm::got_irelative_): New member. + (Output_data_plt_arm::irelative_count_): New member. + (Output_data_plt_arm::IRelative_data_vec): New typedef. + (Output_data_plt_arm::irelative_data_vec_): New member. + (Output_data_plt_arm::do_write): Write out irelative entries. + (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add + more parameters to ctor. + (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add + more parameters to ctor. + * output.h (Output_data_reloc::add_local_relative): New method. + * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment. + +2015-01-29 Alan Modra + + * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD + and GOT_TLSGD to LE optimization. + +2015-01-28 Cary Coutant + + * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization + for undef TLS symbols. + (Target_x86_64::Relocate::relocate_tls): Likewise. + (Target_x86_64::Relocate::tls_ie_to_le): Likewise. + +2015-01-25 Cary Coutant + + * output.cc (Output_segment::set_section_addresses): Fix calculation + of size of relro segment. + +2015-01-22 Alan Modra + + * powerpc.cc (Target_powerpc::Scan::local ): Correct + condition for need of ifunc plt entry. + (Target_powerpc::Scan::global ): Likewise. + +2015-01-14 Sasa Stankovic + + * mips.cc (reloc_high): Add r_sym. + (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to + reloc_high constructor. + (Mips_relocate_functions::relgot16_local): Likewise. + (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and + r_type to decide whether LO16 matches HI16. + (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16, + rello16 and relgot16_local. + +2015-01-09 Cary Coutant + + * layout.cc (Layout::set_segment_offsets): Don't align start of segment + unless alignment is larger than page size. + +2015-01-06 H.J. Lu + Cary Coutant + + PR gold/17729 + * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32. + (DEFAULT_TARGET_X32): Set for x32. + * x86_64.cc (cmp_insn_32): New. + (lea_r10_insn_32): Likewise. + (lea_r11_insn_32): Likewise. + (cmp_insn_64): Likewise. + (lea_r10_insn_64): Likewise. + (lea_r11_insn_64): Likewise. + (Target_x86_64::do_calls_non_split): Handle x32. + * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh. + (check_DATA): Add split_x32 files. + (split_x32_[1234n].o): New targets. + (split_x32_[124]): New targets. + (split_x32_[1234r].stdout): New targets. + * testsuite/split_x32.sh: New file. + * testsuite/split_x32_1.s: Likewise. + * testsuite/split_x32_2.s: Likewise. + * testsuite/split_x32_3.s: Likewise. + * testsuite/split_x32_4.s: Likewise. + * testsuite/split_x32_n.s: Likewise. + * configure: Regenerated. + * testsuite/Makefile.in: Likewise. + +2015-01-06 H.J. Lu + + PR gold/17809 + * x86_64.cc (Target_x86_64::Relocate::tls_ie_to_le): Handle + x32. + +2015-01-02 Alan Modra + + * version.cc (print_version): Just print current year. + * dwp.cc (print_version): Likewise. + +2015-01-01 Alan Modra + + Update year range in copyright notice of all files. + +2014-12-25 Alan Modra + + * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on + new enums. + (Target_arm::merge_object_attributes, ): Likewise. + +2014-12-25 Thomas Preud'homme + + * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header + as hard float only when Tag_ABI_VFP_args is 1, using new enum value + AEABI_VFP_args_vfp to check that. + (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args + value and replace hardcoded values by enum values. + +2014-12-22 Cary Coutant + + * powerpc.cc (Target_powerpc::relocate): Fix overflow check. + +2014-12-20 H.J. Lu + + PR gold/14608 + * testsuite/debug_msg.cc (SometimesInlineFunction): Changed + to "return i * i * 3;". + +2014-12-16 Cary Coutant + + * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes. + (Mapfile::print_output_data): Use current_data_size() to avoid + assert for sections requiring postprocessing; if address is not valid, + print 0. + (Mapfile::print_output_section): Use current_data_size(); print note + that addresses and sizes are before compression. + +2014-12-14 H.J. Lu + + * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub): + Cast current_group_size to unsigned long when reporting error. + +2014-12-10 Jing Yu + + * aarch64.cc (Target_aarch64): Add new variable stub_group_size_. + (AArch64_relocate_functions::maybe_apply_stub): Add new parameter. + Update error message. + (Target_aarch64::do_relax): Use absolute value of option + stub_group_size. Replace local variable with class member + stub_group_size_. + +2014-12-04 Alan Modra + + * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore + addend of PLTREL24 reloc when not generating a plt stub. Make + max_branch_offset an "Address". + (Stub_table::can_reach_stub): Make max_branch_offset an "Address". + (Target_powerpc::Relocate::relocate): Likewise. + +2014-12-04 Alan Modra + + PR 17670 + * symtab.cc (Symbol::set_undefined): Remove assertion. + * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert + on symbols defined in discarded sections, instead return false. + Rearrange params, update all callers. + (Target_powerpc::Branch_info::make_stub): Don't make stubs for + branches to syms in discarded sections. + (Global_symbol_visitor_opd::operator()): Set discarded opd syms + undefined and flag as discarded. + (Target_powerpc::Relocate::relocate): Localize variable. + +2014-12-03 H.J. Lu + + PR gold/17675 + * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New. + * testsuite/Makefile.in: Regenerated. + +2014-12-03 Alan Modra + + PR 17566 + * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section + when adding dynamic relocations against section symbols. + +2014-12-01 Dimitry Ivanov + + * 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-12-01 Cary Coutant + + PR gold/17578 + * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack + is given. + (Layout::create_executable_stack_info): Warn when -z noexecstack is + given but some inputs require executable stack. + +2014-11-26 Cary Coutant + + * layout.cc (gdb_sections): Keep .debug_gdb_scripts and + .debug_str_offsets; strip .debug_gnu_pubnames and + .debug_gnu_pubtypes. + (lines_only_debug_sections): Strip all four new sections. + +2014-11-26 Jing Yu + + * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target + register to be x0 when to relax TLSDESC_LD64_LO12. + +2014-11-26 Alan Modra + + * powerpc.cc (struct Stub_table_owner): New. + (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an + unsigned int vector. Update all references. + (powerpc_relobj::set_stub_table): Take an unsigned int param + rather than a Stub_table. Update callers. + (Powerpc_relobj::clear_stub_table): New function. + (Target_powerpc): Add relax_failed_, relax_fail_count_ and + stub_group_size_ vars. + (Target_powerpc::new_stub_table): Delete. + (max_branch_delta): New function, extracted from.. + (Target_powerpc::Relocate::relocate): ..here.. + (Target_powerpc::Branch_info::make_stub): ..and here. Return + status on whether stub created successfully. + (Stub_control::Stub_control): Add "no_size_errors" param. Move + default sizing to.. + (Target_powerpc::do_relax): ..here. Init stub_group_size_ and + reduce on relax failure. + (Target_powerpc::group_sections): Add "no_size_errors" param. + Use stub_group_size_. Set up group info in a temp vector, + before building Stub_table vector. Account for input sections + possibly already converted to relaxed sections. + (Stub_table::init): Delete. Merge into.. + (Stub_table::Stub_table): ..here. + (Stub_table::can_reach_stub): New function. + (Stub_table::add_plt_call_entry): Add "from" parameter and + return true iff stub could be reached. + (Stub_table::add_long_branch_entry): Similarly. Add "r_type" + param too. + (Stub_table::clear_stubs): Add "all" param. + +2014-11-26 Alan Modra + + * powerpc.cc (Stub_control::set_output_and_owner): New function. + (Target_powerpc::group_sections): Use it. + +2014-11-25 Cary Coutant + + * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol. + (Binary_to_elf::write_symbol): Add st_size parameter. + * binary.h (Binary_to_elf::write_symbol): Add st_size parameter. + +2014-11-25 Cary Coutant + + PR gold/17639 + * object.cc (Sized_relobj_file): Initialize is_deferred_layout_. + (Sized_relobj_file::do_layout): Handle deferred sections properly + during GC pass 1. Don't add reloc sections to deferred list twice. + * object.h (Sized_relobj_file::is_deferred_layout): New function. + (Sized_relobj_file::is_deferred_layout_): New data member. + +2014-11-21 H.J. Lu + + PR gold/17619 + * x86_64.cc (Output_data_plt_x86_64_standard::do_fill_plt_entry): + Check PC-relative offset overflow in PLT entry. + +2014-11-21 Alan Modra + + * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test + for undefined weaks. + +2014-11-20 Alan Modra + + * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_ + from --stub-group-size parameter divided by 1024. + (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize + template parameter. Update all uses. + (Target_powerpc::Relocate::relocate): Rename has_plt_value to + has_stub_value. Set for long branches. Don't report overflow for + branch to undefined weak symbols. Print info message on + overflowing branch to stub. + +2014-11-20 Alan Modra + + * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters. + +2014-11-13 H.J. Lu + + * x86_64.cc (Target_x86_64::Scan::global): Don't make PLT + entry for R_X86_64_GOTPLT64. + (Target_x86_64::Relocate::relocate): Update comments for + R_X86_64_GOTPLT64. + +2014-11-06 Evgeniy Dushistov + + * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file + * plugin.h: add lock definition + +2014-10-29 Han Shen + Jing Yu + + * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21, + TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1, + TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to + Symbol::TLS_REF. + * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New + method. + (Target_aarch64::reloc_needs_plt_for_ifunc): New method. + (Target_aarch64::tls_ld_to_le): New method. + (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections + for 64bit targets. + (Output_data_plt_aarch64::irelative_rel_): New data member. + (Output_data_plt_aarch64::add_entry): Add irelative entries to plt. + (Output_data_plt_aarch64::add_local_ifunc_entry): New method. + (Output_data_plt_aarch64::add_relocation): New method. + (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative + offset. Add got_irelative size to got size. + (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long + type string with the new typename. + (AArch64_relocate_functions::update_adr): Replace parameter x with + immed. + (AArch64_relocate_functions::update_movnz): Correct wrong val mask. + (AArch64_relocate_functions::reloc_common): New method. + (AArch64_relocate_funcsions::rela_general): Extract common part out + into reloc_common method. + (AArch64_relocate_functions::rela_general): Likewise. + (AArch64_relocate_functions::pcrela_general): Likewise. + (AArch64_relocate_functions::adr): New method. + (AArch64_relocate_functions::adrp): Calculate immed before calling + update_adr. + (AArch64_relocate_functions::adrp): Likewise. + (AArch64_relocate_functions::movnz): Cast x to SignedW type when + comparing x to 0. Calculate immed from ~x when x < 0. + (Target_aarch64::optimize_tls_reloc): Add new cases for + TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1, + TLSLD_MOVW_DTPREL_G0_NC. + (Target_aarch64::possible_function_pointer_reloc): Implement this + method. + (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update + comment. + (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC + symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, + TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC. + (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC + symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, + TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC. + (Target_aarch64::make_plt_entry): Call add_entry with two more + parameters. + (Target_aarch64::make_local_ifunc_plt_entry): New method. + (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19, + ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, + TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC. + (Target_aarch64::Relocate::relocate_tls): Add cases for + TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1, + TLSLD_MOVW_DTPREL_G0_NC. + * testsuite/icf_safe_so_test.cc: Correct test comment. + * testsuite/icf_safe_test.sh: Add AArch64 arch. + +2014-10-22 Alan Modra - Apply trunk patches - 2014-10-22 Alan Modra * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to thread_starter. +2014-10-18 Andreas Schwab + + * configure.tgt (targ_extra_obj) [aarch64*-*]: Define. + +2014-10-17 Cary Coutant + + * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub): + Add "typename" keyword. + +2014-10-15 Han Shen + Jing Yu + + Patch for gold aarch64 backend to support relaxation. + * aarch64-reloc.def: Change format. + * aarch64.cc (class Reloc_stub): New class. + (class Stub_table): New class. + (class AArch64_relobj): New class. + (class AArch64_input_section): New class. + (class AArch64_output_section): New class. + (Target_aarch64::new_stub_table): New method. + (Target_aarch64::new_aarch64_input_section): New method. + (Target_aarch64::find_aarch64_input_section): New method. + (Target_aarch64::scan_section_for_stubs): New method. + (Target_aarch64::scan_reloc_section_for_stubs): New method. + (Target_aarch64::relocate_stub): New method. + (Target_aarch64::current_target): New method. + (Target_aarch64::do_make_elf_object): New method. + (Target_aarch64::do_may_relax): New method. + (Target_aarch64::do_relax): New method. + (Target_aarch64::group_sections): New method. + (Target_aarch64::scan_reloc_for_stub): New method. + (Target_aarch64::do_make_output_section): New method. + (Target_aarch64::stub_tables_): New data member. + (Target_aarch64::aarch64_input_section_map_): New data member. + (AArch64_relocate_functions::maybe_apply_stub): New method. + 2014-09-30 Cary Coutant PR gold/17432 @@ -16164,7 +16716,7 @@ * Added source code to GNU binutils. -Copyright (C) 2008-2014 Free Software Foundation, Inc. +Copyright (C) 2008-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/binutils-2.25/gold/Makefile.am b/binutils-2.25/gold/Makefile.am index df99f23c..fbf2081e 100644 --- a/binutils-2.25/gold/Makefile.am +++ b/binutils-2.25/gold/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to generate Makefile.in # -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/binutils-2.25/gold/Makefile.in b/binutils-2.25/gold/Makefile.in index 3e499575..02a45d90 100644 --- a/binutils-2.25/gold/Makefile.in +++ b/binutils-2.25/gold/Makefile.in @@ -16,7 +16,7 @@ @SET_MAKE@ # -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/binutils-2.25/gold/NEWS b/binutils-2.25/gold/NEWS index bb246f6d..f7173bb5 100644 --- a/binutils-2.25/gold/NEWS +++ b/binutils-2.25/gold/NEWS @@ -1,6 +1,6 @@ * gold added to GNU binutils. -Copyright (C) 2012-2014 Free Software Foundation, Inc. +Copyright (C) 2012-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/binutils-2.25/gold/README b/binutils-2.25/gold/README index b1b24f11..fb78f8fb 100644 --- a/binutils-2.25/gold/README +++ b/binutils-2.25/gold/README @@ -62,7 +62,7 @@ to fail. If you are building gold from an official binutils release, the bison output should already be included. -Copyright (C) 2012-2014 Free Software Foundation, Inc. +Copyright (C) 2012-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/binutils-2.25/gold/aarch64-reloc-property.cc b/binutils-2.25/gold/aarch64-reloc-property.cc index 16f84498..bc6aa731 100644 --- a/binutils-2.25/gold/aarch64-reloc-property.cc +++ b/binutils-2.25/gold/aarch64-reloc-property.cc @@ -1,6 +1,6 @@ // aarch64-reloc-property.cc -- AArch64 relocation properties -*- C++ -*- -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Han Shen and Jing Yu . // This file is part of gold. diff --git a/binutils-2.25/gold/aarch64-reloc-property.h b/binutils-2.25/gold/aarch64-reloc-property.h index d8d13017..a8431698 100644 --- a/binutils-2.25/gold/aarch64-reloc-property.h +++ b/binutils-2.25/gold/aarch64-reloc-property.h @@ -1,6 +1,6 @@ // aarch64-reloc-property.h -- AArch64 relocation properties -*- C++ -*- -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Han Shen and Jing Yu . // This file is part of gold. diff --git a/binutils-2.25/gold/aarch64-reloc.def b/binutils-2.25/gold/aarch64-reloc.def index b9ce49e1..d03d9b53 100644 --- a/binutils-2.25/gold/aarch64-reloc.def +++ b/binutils-2.25/gold/aarch64-reloc.def @@ -1,6 +1,6 @@ // aarch64-reloc.def -- AArch64 relocation definitions. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Han Shen and Jing Yu . // This file is part of gold. @@ -22,60 +22,78 @@ // // // -// Insn modified by relocation, see enum Reloc_inst -------------------------------------------------------------------------+ -// Symbol reference type -----------------------------------------------------------------------------+ | -// Portion off X to retrieve -------------------------------------------------------------------+ | | -// Checking function, see Note(A)---------------------------------------+ | | | -// Group index---------------------------------------------------+ | | | | -// Implemented----------------------------------------------+ | | | | | -// Class-------------------------------------+ | | | | | | -// Type----------------------------+ | | | | | | | -// Name | | | | | | | | -// | | | | | | | | | -ARD(ABS64 , STATIC , DATA , Y, -1, 0,0 , 0,0 , Symbol::ABSOLUTE_REF , DATA ) -ARD(ABS32 , STATIC , DATA , Y, -1, 31,32 , 0,0 , Symbol::ABSOLUTE_REF , DATA ) -ARD(ABS16 , STATIC , DATA , Y, -1, 15,16 , 0,0 , Symbol::ABSOLUTE_REF , DATA ) -ARD(PREL64 , STATIC , DATA , Y, -1, 0,0 , 0,0 , Symbol::RELATIVE_REF , DATA ) -ARD(PREL32 , STATIC , DATA , Y, -1, 31,32 , 0,0 , Symbol::RELATIVE_REF , DATA ) -ARD(PREL16 , STATIC , DATA , Y, -1, 15,16 , 0,0 , Symbol::RELATIVE_REF , DATA ) +// Insn modified by relocation, see enum Reloc_inst -------------------------------------------------------------------------------------------------+ +// Symbol reference type -----------------------------------------------------------------------------+ | +// Portion off X to retrieve -------------------------------------------------------------------+ | | +// Checking function, see Note(A)---------------------------------------+ | | | +// Group index---------------------------------------------------+ | | | | +// Implemented----------------------------------------------+ | | | | | +// Class-------------------------------------+ | | | | | | +// Type----------------------------+ | | | | | | | +// Name | | | | | | | | +// | | | | | | | | | +ARD(ABS64 , STATIC , DATA , Y, -1, 0,0 , 0,0 , Symbol::ABSOLUTE_REF , DATA ) +ARD(ABS32 , STATIC , DATA , Y, -1, 31,32 , 0,0 , Symbol::ABSOLUTE_REF , DATA ) +ARD(ABS16 , STATIC , DATA , Y, -1, 15,16 , 0,0 , Symbol::ABSOLUTE_REF , DATA ) +ARD(PREL64 , STATIC , DATA , Y, -1, 0,0 , 0,0 , Symbol::RELATIVE_REF , DATA ) +ARD(PREL32 , STATIC , DATA , Y, -1, 31,32 , 0,0 , Symbol::RELATIVE_REF , DATA ) +ARD(PREL16 , STATIC , DATA , Y, -1, 15,16 , 0,0 , Symbol::RELATIVE_REF , DATA ) // Above is from Table 4-6, Data relocations, 257-262. -ARD(ADR_PREL_PG_HI21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::RELATIVE_REF , ADRP ) -ARD(ADR_PREL_PG_HI21_NC , STATIC , AARCH64 , Y, -1, 0,0 , 12,32 , Symbol::RELATIVE_REF , ADRP ) -ARD(LDST8_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::ABSOLUTE_REF , LDST ) -ARD(LDST16_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN2 , 1,11 , Symbol::ABSOLUTE_REF , LDST ) -ARD(LDST32_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN4 , 2,11 , Symbol::ABSOLUTE_REF , LDST ) -ARD(LDST64_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::ABSOLUTE_REF , LDST ) -ARD(LDST128_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN16 , 4,11 , Symbol::ABSOLUTE_REF , LDST ) -ARD(ADD_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::ABSOLUTE_REF , ADD ) -ARD(ADR_GOT_PAGE , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::RELATIVE_REF , ADRP ) -ARD(LD64_GOT_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::ABSOLUTE_REF , LDST ) +ARD(LD_PREL_LO19 , STATIC , AARCH64 , Y, -1, 20,20 , 2,20 , Symbol::RELATIVE_REF , LDST ) +ARD(ADR_PREL_LO21 , STATIC , AARCH64 , Y, -1, 20,20 , 0,20 , Symbol::RELATIVE_REF , ADR ) +ARD(ADR_PREL_PG_HI21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::RELATIVE_REF , ADRP ) +ARD(ADR_PREL_PG_HI21_NC , STATIC , AARCH64 , Y, -1, 0,0 , 12,32 , Symbol::RELATIVE_REF , ADRP ) +ARD(ADD_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::ABSOLUTE_REF , ADD ) +ARD(LDST8_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::ABSOLUTE_REF , LDST ) +ARD(LDST16_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN2 , 1,11 , Symbol::ABSOLUTE_REF , LDST ) +ARD(LDST32_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN4 , 2,11 , Symbol::ABSOLUTE_REF , LDST ) +ARD(LDST64_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::ABSOLUTE_REF , LDST ) +ARD(LDST128_ABS_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN16 , 4,11 , Symbol::ABSOLUTE_REF , LDST ) +// Above 10 relocs are from Table 4-9, Relocations to generate 19, 21 and 33 bit PC-relative addresses. + +ARD(ADR_GOT_PAGE , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::RELATIVE_REF , ADRP ) +ARD(LD64_GOT_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::ABSOLUTE_REF , LDST ) +// Above 2 relocs are from Table 4-14, GOT-relative instruction relocations. (Some relocs in the table are not implemented yet.) + ARD(TSTBR14 , STATIC , CFLOW , N, -1, 15,15 , 2,15 , (Symbol::FUNCTION_CALL|Symbol::ABSOLUTE_REF) , TBZNZ ) ARD(CONDBR19 , STATIC , CFLOW , N, -1, 20,20 , 2,20 , (Symbol::FUNCTION_CALL|Symbol::ABSOLUTE_REF) , CONDB ) -ARD(CALL26 , STATIC , CFLOW , Y, -1, 27,27 , 2,27 , (Symbol::FUNCTION_CALL|Symbol::RELATIVE_REF) , CALL ) -ARD(JUMP26 , STATIC , CFLOW , Y, -1, 27,27 , 2,27 , (Symbol::FUNCTION_CALL|Symbol::RELATIVE_REF) , B ) +ARD(CALL26 , STATIC , CFLOW , Y, -1, 27,27 , 2,27 , (Symbol::FUNCTION_CALL|Symbol::RELATIVE_REF) , CALL ) +ARD(JUMP26 , STATIC , CFLOW , Y, -1, 27,27 , 2,27 , (Symbol::FUNCTION_CALL|Symbol::RELATIVE_REF) , B ) // Above is from Table 4-10, Relocations for control-flow instructions, // 279-283. -ARD(TLSGD_ADR_PAGE21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::ABSOLUTE_REF , ADRP ) -ARD(TLSGD_ADD_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::ABSOLUTE_REF , ADD ) +ARD(TLSGD_ADR_PAGE21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::TLS_REF , ADRP ) +ARD(TLSGD_ADD_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::TLS_REF , ADD ) +// Above is from Table 4-15, General Dynamic TLS relocations, 512-516. + +ARD(TLSLD_ADR_PAGE21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::TLS_REF , ADRP ) +ARD(TLSLD_ADD_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::TLS_REF , ADD ) +ARD(TLSLD_MOVW_DTPREL_G1 , STATIC , AARCH64 , Y, 1, 32,32 , 16,31 , Symbol::TLS_REF , ADRP ) +ARD(TLSLD_MOVW_DTPREL_G0_NC , STATIC , AARCH64 , Y, 0, 0,0 , 0,15 , Symbol::TLS_REF , MOVW ) +// Above is from Table 4-16, Local Dynamic TLS relocations, 517-573. -ARD(TLSIE_MOVW_GOTTPREL_G1 , STATIC , AARCH64 , N, -1, 0,0 , 16,31 , Symbol::ABSOLUTE_REF , MOVW ) -ARD(TLSIE_MOVW_GOTTPREL_G0_NC , STATIC , AARCH64 , N, -1, 0,0 , 0,15 , Symbol::ABSOLUTE_REF , MOVW ) -ARD(TLSIE_ADR_GOTTPREL_PAGE21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::ABSOLUTE_REF , ADRP ) -ARD(TLSIE_LD64_GOTTPREL_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::ABSOLUTE_REF , LDST ) -ARD(TLSIE_LD_GOTTPREL_PREL19 , STATIC , AARCH64 , N, -1, 20,20 , 2,20 , Symbol::ABSOLUTE_REF , LD ) +ARD(TLSIE_MOVW_GOTTPREL_G1 , STATIC , AARCH64 , N, -1, 32,32 , 16,31 , Symbol::TLS_REF , MOVW ) +ARD(TLSIE_MOVW_GOTTPREL_G0_NC , STATIC , AARCH64 , N, -1, 0,0 , 0,15 , Symbol::TLS_REF , MOVW ) +ARD(TLSIE_ADR_GOTTPREL_PAGE21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::TLS_REF , ADRP ) +ARD(TLSIE_LD64_GOTTPREL_LO12_NC , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::TLS_REF , LDST ) +ARD(TLSIE_LD_GOTTPREL_PREL19 , STATIC , AARCH64 , N, -1, 20,20 , 2,20 , Symbol::TLS_REF , LD ) // Above is from Table 4-17, Initial Exec TLS relocations, 539-543. -ARD(TLSLE_ADD_TPREL_HI12 , STATIC , AARCH64 , Y, -1, 0,24 , 12,23 , Symbol::ABSOLUTE_REF , ADD ) -ARD(TLSLE_ADD_TPREL_LO12 , STATIC , AARCH64 , Y, -1, 0,12 , 0,11 , Symbol::ABSOLUTE_REF , ADD ) -ARD(TLSLE_ADD_TPREL_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::ABSOLUTE_REF , ADD ) +ARD(TLSLE_MOVW_TPREL_G2 , STATIC , AARCH64 , Y, 2, 48,48 , 32,47 , Symbol::TLS_REF , MOVW ) +ARD(TLSLE_MOVW_TPREL_G1 , STATIC , AARCH64 , Y, 1, 32,32 , 16,31 , Symbol::TLS_REF , MOVW ) +ARD(TLSLE_MOVW_TPREL_G1_NC , STATIC , AARCH64 , Y, 1, 0,0 , 16,31 , Symbol::TLS_REF , MOVW ) +ARD(TLSLE_MOVW_TPREL_G0 , STATIC , AARCH64 , Y, 0, 16,16 , 0,15 , Symbol::TLS_REF , MOVW ) +ARD(TLSLE_MOVW_TPREL_G0_NC , STATIC , AARCH64 , Y, 0, 0,0 , 0,15 , Symbol::TLS_REF , MOVW ) +ARD(TLSLE_ADD_TPREL_HI12 , STATIC , AARCH64 , Y, -1, 0,24 , 12,23 , Symbol::TLS_REF , ADD ) +ARD(TLSLE_ADD_TPREL_LO12 , STATIC , AARCH64 , Y, -1, 0,12 , 0,11 , Symbol::TLS_REF , ADD ) +ARD(TLSLE_ADD_TPREL_LO12_NC , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::TLS_REF , ADD ) // Above is from Table 4-18, Local Exec TLS relocations, 544-571. -ARD(TLSDESC_ADR_PAGE21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::RELATIVE_REF , ADRP ) -ARD(TLSDESC_LD64_LO12 , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::ABSOLUTE_REF , LDST ) -ARD(TLSDESC_ADD_LO12 , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::ABSOLUTE_REF , ADD ) -ARD(TLSDESC_CALL , STATIC , CFLOW , Y, -1, 0,0 , 0,0 , (Symbol::FUNCTION_CALL|Symbol::ABSOLUTE_REF) , CALL ) +ARD(TLSDESC_ADR_PAGE21 , STATIC , AARCH64 , Y, -1, 32,32 , 12,32 , Symbol::TLS_REF , ADRP ) +ARD(TLSDESC_LD64_LO12 , STATIC , AARCH64 , Y, -1, 0,RL_CHECK_ALIGN8 , 3,11 , Symbol::TLS_REF , LDST ) +ARD(TLSDESC_ADD_LO12 , STATIC , AARCH64 , Y, -1, 0,0 , 0,11 , Symbol::TLS_REF , ADD ) +ARD(TLSDESC_CALL , STATIC , CFLOW , Y, -1, 0,0 , 0,0 , Symbol::TLS_REF , CALL ) // Above is from Table 4-19, TLS descriptor relocations, 560-569. // Note - diff --git a/binutils-2.25/gold/aarch64.cc b/binutils-2.25/gold/aarch64.cc index afb90243..31176a4b 100644 --- a/binutils-2.25/gold/aarch64.cc +++ b/binutils-2.25/gold/aarch64.cc @@ -1,6 +1,6 @@ // aarch64.cc -- aarch64 target support for gold. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Jing Yu and Han Shen . // This file is part of gold. @@ -47,6 +47,7 @@ // The first three .got.plt entries are reserved. const int32_t AARCH64_GOTPLT_RESERVE_COUNT = 3; + namespace { @@ -124,7 +125,7 @@ class Output_data_got_aarch64 : public Output_data_got gold_assert(tls_segment != NULL); AArch64_address aligned_tcb_address = - align_address(Target_aarch64::TCB_SIZE, + align_address(Target_aarch64::TCB_SIZE, tls_segment->maximum_alignment()); for (size_t i = 0; i < this->static_relocs_.size(); ++i) @@ -204,99 +205,1416 @@ class Output_data_got_aarch64 : public Output_data_got elfcpp::Swap::writeval(wv, x); } - of->write_output_view(offset, oview_size, oview); - } + of->write_output_view(offset, oview_size, oview); + } + + private: + // Symbol table of the output object. + Symbol_table* symbol_table_; + // A pointer to the Layout class, so that we can find the .dynamic + // section when we write out the GOT section. + Layout* layout_; + + // This class represent dynamic relocations that need to be applied by + // gold because we are using TLS relocations in a static link. + class Static_reloc + { + public: + Static_reloc(unsigned int got_offset, unsigned int r_type, Symbol* gsym) + : got_offset_(got_offset), r_type_(r_type), symbol_is_global_(true) + { this->u_.global.symbol = gsym; } + + Static_reloc(unsigned int got_offset, unsigned int r_type, + Sized_relobj_file* relobj, unsigned int index) + : got_offset_(got_offset), r_type_(r_type), symbol_is_global_(false) + { + this->u_.local.relobj = relobj; + this->u_.local.index = index; + } + + // Return the GOT offset. + unsigned int + got_offset() const + { return this->got_offset_; } + + // Relocation type. + unsigned int + r_type() const + { return this->r_type_; } + + // Whether the symbol is global or not. + bool + symbol_is_global() const + { return this->symbol_is_global_; } + + // For a relocation against a global symbol, the global symbol. + Symbol* + symbol() const + { + gold_assert(this->symbol_is_global_); + return this->u_.global.symbol; + } + + // For a relocation against a local symbol, the defining object. + Sized_relobj_file* + relobj() const + { + gold_assert(!this->symbol_is_global_); + return this->u_.local.relobj; + } + + // For a relocation against a local symbol, the local symbol index. + unsigned int + index() const + { + gold_assert(!this->symbol_is_global_); + return this->u_.local.index; + } + + private: + // GOT offset of the entry to which this relocation is applied. + unsigned int got_offset_; + // Type of relocation. + unsigned int r_type_; + // Whether this relocation is against a global symbol. + bool symbol_is_global_; + // A global or local symbol. + union + { + struct + { + // For a global symbol, the symbol itself. + Symbol* symbol; + } global; + struct + { + // For a local symbol, the object defining the symbol. + Sized_relobj_file* relobj; + // For a local symbol, the symbol index. + unsigned int index; + } local; + } u_; + }; // End of inner class Static_reloc + + std::vector static_relocs_; +}; // End of Output_data_got_aarch64 + + +template +class AArch64_input_section; + + +template +class AArch64_output_section; + + +// Reloc stub class. + +template +class Reloc_stub +{ + public: + typedef Reloc_stub This; + typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; + + // Do not change the value of the enums, they are used to index into + // stub_insns array. + typedef enum + { + ST_NONE = 0, + + // Using adrp/add pair, 4 insns (including alignment) without mem access, + // the fastest stub. This has a limited jump distance, which is tested by + // aarch64_valid_for_adrp_p. + ST_ADRP_BRANCH = 1, + + // Using ldr-absolute-address/br-register, 4 insns with 1 mem access, + // unlimited in jump distance. + ST_LONG_BRANCH_ABS = 2, + + // Using ldr/calculate-pcrel/jump, 8 insns (including alignment) with 1 mem + // access, slowest one. Only used in position independent executables. + ST_LONG_BRANCH_PCREL = 3, + + } Stub_type; + + // Branch range. This is used to calculate the section group size, as well as + // determine whether a stub is needed. + static const int MAX_BRANCH_OFFSET = ((1 << 25) - 1) << 2; + static const int MIN_BRANCH_OFFSET = -((1 << 25) << 2); + + // Constant used to determine if an offset fits in the adrp instruction + // encoding. + static const int MAX_ADRP_IMM = (1 << 20) - 1; + static const int MIN_ADRP_IMM = -(1 << 20); + + static const int BYTES_PER_INSN = 4; + static const int STUB_ADDR_ALIGN = 4; + + // Determine whether the offset fits in the jump/branch instruction. + static bool + aarch64_valid_branch_offset_p(int64_t offset) + { return offset >= MIN_BRANCH_OFFSET && offset <= MAX_BRANCH_OFFSET; } + + // Determine whether the offset fits in the adrp immediate field. + static bool + aarch64_valid_for_adrp_p(AArch64_address location, AArch64_address dest) + { + typedef AArch64_relocate_functions Reloc; + int64_t adrp_imm = (Reloc::Page(dest) - Reloc::Page(location)) >> 12; + return adrp_imm >= MIN_ADRP_IMM && adrp_imm <= MAX_ADRP_IMM; + } + + // Determine the stub type for a certain relocation or ST_NONE, if no stub is + // needed. + static Stub_type + stub_type_for_reloc(unsigned int r_type, AArch64_address address, + AArch64_address target); + + Reloc_stub(Stub_type stub_type) + : stub_type_(stub_type), offset_(invalid_offset), + destination_address_(invalid_address) + { } + + ~Reloc_stub() + { } + + // Return offset of code stub from beginning of its containing stub table. + section_offset_type + offset() const + { + gold_assert(this->offset_ != invalid_offset); + return this->offset_; + } + + // Set offset of code stub from beginning of its containing stub table. + void + set_offset(section_offset_type offset) + { this->offset_ = offset; } + + // Return destination address. + AArch64_address + destination_address() const + { + gold_assert(this->destination_address_ != this->invalid_address); + return this->destination_address_; + } + + // Set destination address. + void + set_destination_address(AArch64_address address) + { + gold_assert(address != this->invalid_address); + this->destination_address_ = address; + } + + // Reset the destination address. + void + reset_destination_address() + { this->destination_address_ = this->invalid_address; } + + // Return the stub type. + Stub_type + stub_type() const + { return stub_type_; } + + // Return the stub size. + uint32_t + stub_size() const + { return this->stub_insn_number() * BYTES_PER_INSN; } + + // Return the instruction number of this stub instance. + int + stub_insn_number() const + { return stub_insns_[this->stub_type_][0]; } + + // Note the first "insn" is the number of total insns in this array. + const uint32_t* + stub_insns() const + { return stub_insns_[this->stub_type_]; } + + // Write stub to output file. + void + write(unsigned char* view, section_size_type view_size) + { this->do_write(view, view_size); } + + // The key class used to index the stub instance in the stub table's stub map. + class Key + { + public: + Key(Stub_type stub_type, const Symbol* symbol, const Relobj* relobj, + unsigned int r_sym, int32_t addend) + : stub_type_(stub_type), addend_(addend) + { + if (symbol != NULL) + { + this->r_sym_ = Reloc_stub::invalid_index; + this->u_.symbol = symbol; + } + else + { + gold_assert(relobj != NULL && r_sym != invalid_index); + this->r_sym_ = r_sym; + this->u_.relobj = relobj; + } + } + + ~Key() + { } + + // Return stub type. + Stub_type + stub_type() const + { return this->stub_type_; } + + // Return the local symbol index or invalid_index. + unsigned int + r_sym() const + { return this->r_sym_; } + + // Return the symbol if there is one. + const Symbol* + symbol() const + { return this->r_sym_ == invalid_index ? this->u_.symbol : NULL; } + + // Return the relobj if there is one. + const Relobj* + relobj() const + { return this->r_sym_ != invalid_index ? this->u_.relobj : NULL; } + + // Whether this equals to another key k. + bool + eq(const Key& k) const + { + return ((this->stub_type_ == k.stub_type_) + && (this->r_sym_ == k.r_sym_) + && ((this->r_sym_ != Reloc_stub::invalid_index) + ? (this->u_.relobj == k.u_.relobj) + : (this->u_.symbol == k.u_.symbol)) + && (this->addend_ == k.addend_)); + } + + // Return a hash value. + size_t + hash_value() const + { + size_t name_hash_value = gold::string_hash( + (this->r_sym_ != Reloc_stub::invalid_index) + ? this->u_.relobj->name().c_str() + : this->u_.symbol->name()); + // We only have 4 stub types. + size_t stub_type_hash_value = 0x03 & this->stub_type_; + return (name_hash_value + ^ stub_type_hash_value + ^ ((this->r_sym_ & 0x3fff) << 2) + ^ ((this->addend_ & 0xffff) << 16)); + } + + // Functors for STL associative containers. + struct hash + { + size_t + operator()(const Key& k) const + { return k.hash_value(); } + }; + + struct equal_to + { + bool + operator()(const Key& k1, const Key& k2) const + { return k1.eq(k2); } + }; + + private: + // Stub type. + const Stub_type stub_type_; + // If this is a local symbol, this is the index in the defining object. + // Otherwise, it is invalid_index for a global symbol. + unsigned int r_sym_; + // If r_sym_ is an invalid index, this points to a global symbol. + // Otherwise, it points to a relobj. We used the unsized and target + // independent Symbol and Relobj classes instead of Sized_symbol<32> and + // Arm_relobj, in order to avoid making the stub class a template + // as most of the stub machinery is endianness-neutral. However, it + // may require a bit of casting done by users of this class. + union + { + const Symbol* symbol; + const Relobj* relobj; + } u_; + // Addend associated with a reloc. + int32_t addend_; + }; // End of inner class Reloc_stub::Key + + protected: + // This may be overridden in the child class. + virtual void + do_write(unsigned char*, section_size_type); + + private: + static const section_offset_type invalid_offset = + static_cast(-1); + static const unsigned int invalid_index = static_cast(-1); + static const AArch64_address invalid_address = + static_cast(-1); + + static const uint32_t stub_insns_[][10]; + + const Stub_type stub_type_; + section_offset_type offset_; + AArch64_address destination_address_; +}; // End of Reloc_stub + + +// Write data to output file. + +template +void +Reloc_stub:: +do_write(unsigned char* view, section_size_type) +{ + typedef typename elfcpp::Swap<32, big_endian>::Valtype Insntype; + const uint32_t* insns = this->stub_insns(); + uint32_t num_insns = this->stub_insn_number(); + Insntype* ip = reinterpret_cast(view); + for (uint32_t i = 1; i <= num_insns; ++i) + elfcpp::Swap<32, big_endian>::writeval(ip + i - 1, insns[i]); +} + + +// Stubs instructions definition. + +template +const uint32_t +Reloc_stub::stub_insns_[][10] = + { + // The first element of each group is the num of the insns. + + // ST_NONE + {0, 0}, + + // ST_ADRP_BRANCH + { + 4, + 0x90000010, /* adrp ip0, X */ + /* ADR_PREL_PG_HI21(X) */ + 0x91000210, /* add ip0, ip0, :lo12:X */ + /* ADD_ABS_LO12_NC(X) */ + 0xd61f0200, /* br ip0 */ + 0x00000000, /* alignment padding */ + }, + + // ST_LONG_BRANCH_ABS + { + 4, + 0x58000050, /* ldr ip0, 0x8 */ + 0xd61f0200, /* br ip0 */ + 0x00000000, /* address field */ + 0x00000000, /* address fields */ + }, + + // ST_LONG_BRANCH_PCREL + { + 8, + 0x58000090, /* ldr ip0, 0x10 */ + 0x10000011, /* adr ip1, #0 */ + 0x8b110210, /* add ip0, ip0, ip1 */ + 0xd61f0200, /* br ip0 */ + 0x00000000, /* address field */ + 0x00000000, /* address field */ + 0x00000000, /* alignment padding */ + 0x00000000, /* alignment padding */ + } + }; + + +// Determine the stub type for a certain relocation or ST_NONE, if no stub is +// needed. + +template +inline +typename Reloc_stub::Stub_type +Reloc_stub::stub_type_for_reloc( + unsigned int r_type, AArch64_address location, AArch64_address dest) +{ + int64_t branch_offset = 0; + switch(r_type) + { + case elfcpp::R_AARCH64_CALL26: + case elfcpp::R_AARCH64_JUMP26: + branch_offset = dest - location; + break; + default: + gold_unreachable(); + } + + if (aarch64_valid_branch_offset_p(branch_offset)) + return ST_NONE; + + if (aarch64_valid_for_adrp_p(location, dest)) + return ST_ADRP_BRANCH; + + if (parameters->options().output_is_position_independent() + && parameters->options().output_is_executable()) + return ST_LONG_BRANCH_PCREL; + + return ST_LONG_BRANCH_ABS; +} + +// A class to hold stubs for the ARM target. + +template +class Stub_table : public Output_data +{ + public: + typedef Target_aarch64 The_target_aarch64; + typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; + typedef AArch64_input_section The_aarch64_input_section; + typedef Reloc_stub The_reloc_stub; + typedef typename The_reloc_stub::Key The_reloc_stub_key; + typedef typename The_reloc_stub_key::hash The_reloc_stub_key_hash; + typedef typename The_reloc_stub_key::equal_to The_reloc_stub_key_equal_to; + typedef Stub_table The_stub_table; + typedef Unordered_map + Reloc_stub_map; + typedef typename Reloc_stub_map::const_iterator Reloc_stub_map_const_iter; + typedef Relocate_info The_relocate_info; + + Stub_table(The_aarch64_input_section* owner) + : Output_data(), owner_(owner), reloc_stubs_size_(0), prev_data_size_(0) + { } + + ~Stub_table() + { } + + The_aarch64_input_section* + owner() const + { return owner_; } + + // Whether this stub table is empty. + bool + empty() const + { return reloc_stubs_.empty(); } + + // Return the current data size. + off_t + current_data_size() const + { return this->current_data_size_for_child(); } + + // Add a STUB using KEY. The caller is responsible for avoiding addition + // if a STUB with the same key has already been added. + void + add_reloc_stub(The_reloc_stub* stub, const The_reloc_stub_key& key); + + // Finalize stubs. No-op here, just for completeness. + void + finalize_stubs() + { } + + // Look up a relocation stub using KEY. Return NULL if there is none. + The_reloc_stub* + find_reloc_stub(The_reloc_stub_key& key) + { + Reloc_stub_map_const_iter p = this->reloc_stubs_.find(key); + return (p != this->reloc_stubs_.end()) ? p->second : NULL; + } + + // Relocate stubs in this stub table. + void + relocate_stubs(const The_relocate_info*, + The_target_aarch64*, + Output_section*, + unsigned char*, + AArch64_address, + section_size_type); + + // Update data size at the end of a relaxation pass. Return true if data size + // is different from that of the previous relaxation pass. + bool + update_data_size_changed_p() + { + // No addralign changed here. + off_t s = this->reloc_stubs_size_; + bool changed = (s != this->prev_data_size_); + this->prev_data_size_ = s; + return changed; + } + + protected: + // Write out section contents. + void + do_write(Output_file*); + + // Return the required alignment. + uint64_t + do_addralign() const + { return The_reloc_stub::STUB_ADDR_ALIGN; } + + // Reset address and file offset. + void + do_reset_address_and_file_offset() + { this->set_current_data_size_for_child(this->prev_data_size_); } + + // Set final data size. + void + set_final_data_size() + { this->set_data_size(this->current_data_size()); } + + private: + // Relocate one stub. + void + relocate_stub(The_reloc_stub*, + const The_relocate_info*, + The_target_aarch64*, + Output_section*, + unsigned char*, + AArch64_address, + section_size_type); + + private: + // Owner of this stub table. + The_aarch64_input_section* owner_; + // The relocation stubs. + Reloc_stub_map reloc_stubs_; + // Size of reloc stubs. + off_t reloc_stubs_size_; + // data size of this in the previous pass. + off_t prev_data_size_; +}; // End of Stub_table + + +// Add a STUB using KEY. The caller is responsible for avoiding addition +// if a STUB with the same key has already been added. + +template +void +Stub_table::add_reloc_stub( + The_reloc_stub* stub, const The_reloc_stub_key& key) +{ + gold_assert(stub->stub_type() == key.stub_type()); + this->reloc_stubs_[key] = stub; + + // Assign stub offset early. We can do this because we never remove + // reloc stubs and they are in the beginning of the stub table. + this->reloc_stubs_size_ = align_address(this->reloc_stubs_size_, + The_reloc_stub::STUB_ADDR_ALIGN); + stub->set_offset(this->reloc_stubs_size_); + this->reloc_stubs_size_ += stub->stub_size(); +} + + +// Relocate all stubs in this stub table. + +template +void +Stub_table:: +relocate_stubs(const The_relocate_info* relinfo, + The_target_aarch64* target_aarch64, + Output_section* output_section, + unsigned char* view, + AArch64_address address, + section_size_type view_size) +{ + // "view_size" is the total size of the stub_table. + gold_assert(address == this->address() && + view_size == static_cast(this->data_size())); + for(Reloc_stub_map_const_iter p = this->reloc_stubs_.begin(); + p != this->reloc_stubs_.end(); ++p) + relocate_stub(p->second, relinfo, target_aarch64, output_section, + view, address, view_size); +} + + +// Relocate one stub. This is a helper for Stub_table::relocate_stubs(). + +template +void +Stub_table:: +relocate_stub(The_reloc_stub* stub, + const The_relocate_info* relinfo, + The_target_aarch64* target_aarch64, + Output_section* output_section, + unsigned char* view, + AArch64_address address, + section_size_type view_size) +{ + // "offset" is the offset from the beginning of the stub_table. + section_size_type offset = stub->offset(); + section_size_type stub_size = stub->stub_size(); + // "view_size" is the total size of the stub_table. + gold_assert(offset + stub_size <= view_size); + + target_aarch64->relocate_stub(stub, relinfo, output_section, + view + offset, address + offset, view_size); +} + + +// Write out the stubs to file. + +template +void +Stub_table::do_write(Output_file* of) +{ + off_t offset = this->offset(); + const section_size_type oview_size = + convert_to_section_size_type(this->data_size()); + unsigned char* const oview = of->get_output_view(offset, oview_size); + + // Write relocation stubs. + for (typename Reloc_stub_map::const_iterator p = this->reloc_stubs_.begin(); + p != this->reloc_stubs_.end(); ++p) + { + The_reloc_stub* stub = p->second; + AArch64_address address = this->address() + stub->offset(); + gold_assert(address == + align_address(address, The_reloc_stub::STUB_ADDR_ALIGN)); + stub->write(oview + stub->offset(), stub->stub_size()); + } + + of->write_output_view(this->offset(), oview_size, oview); +} + + +// AArch64_relobj class. + +template +class AArch64_relobj : public Sized_relobj_file +{ + public: + typedef AArch64_relobj This; + typedef Target_aarch64 The_target_aarch64; + typedef AArch64_input_section The_aarch64_input_section; + typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; + typedef Stub_table The_stub_table; + typedef std::vector Stub_table_list; + static const AArch64_address invalid_address = + static_cast(-1); + + AArch64_relobj(const std::string& name, Input_file* input_file, off_t offset, + const typename elfcpp::Ehdr& ehdr) + : Sized_relobj_file(name, input_file, offset, ehdr), + stub_tables_() + { } + + ~AArch64_relobj() + { } + + // Return the stub table of the SHNDX-th section if there is one. + The_stub_table* + stub_table(unsigned int shndx) const + { + gold_assert(shndx < this->stub_tables_.size()); + return this->stub_tables_[shndx]; + } + + // Set STUB_TABLE to be the stub_table of the SHNDX-th section. + void + set_stub_table(unsigned int shndx, The_stub_table* stub_table) + { + gold_assert(shndx < this->stub_tables_.size()); + this->stub_tables_[shndx] = stub_table; + } + + // Scan all relocation sections for stub generation. + void + scan_sections_for_stubs(The_target_aarch64*, const Symbol_table*, + const Layout*); + + // Whether a section is a scannable text section. + bool + text_section_is_scannable(const elfcpp::Shdr&, unsigned int, + const Output_section*, const Symbol_table*); + + // Convert regular input section with index SHNDX to a relaxed section. + void + convert_input_section_to_relaxed_section(unsigned /* shndx */) + { + // The stubs have relocations and we need to process them after writing + // out the stubs. So relocation now must follow section write. + this->set_relocs_must_follow_section_writes(); + } + + protected: + // Post constructor setup. + void + do_setup() + { + // Call parent's setup method. + Sized_relobj_file::do_setup(); + + // Initialize look-up tables. + this->stub_tables_.resize(this->shnum()); + } + + virtual void + do_relocate_sections( + const Symbol_table* symtab, const Layout* layout, + const unsigned char* pshdrs, Output_file* of, + typename Sized_relobj_file::Views* pviews); + + private: + // Whether a section needs to be scanned for relocation stubs. + bool + section_needs_reloc_stub_scanning(const elfcpp::Shdr&, + const Relobj::Output_sections&, + const Symbol_table*, const unsigned char*); + + // List of stub tables. + Stub_table_list stub_tables_; +}; // End of AArch64_relobj + + +// Relocate sections. + +template +void +AArch64_relobj::do_relocate_sections( + const Symbol_table* symtab, const Layout* layout, + const unsigned char* pshdrs, Output_file* of, + typename Sized_relobj_file::Views* pviews) +{ + // Call parent to relocate sections. + Sized_relobj_file::do_relocate_sections(symtab, layout, + pshdrs, of, pviews); + + // We do not generate stubs if doing a relocatable link. + if (parameters->options().relocatable()) + return; + + Relocate_info relinfo; + relinfo.symtab = symtab; + relinfo.layout = layout; + relinfo.object = this; + + // Relocate stub tables. + unsigned int shnum = this->shnum(); + The_target_aarch64* target = The_target_aarch64::current_target(); + + for (unsigned int i = 1; i < shnum; ++i) + { + The_aarch64_input_section* aarch64_input_section = + target->find_aarch64_input_section(this, i); + if (aarch64_input_section != NULL + && aarch64_input_section->is_stub_table_owner() + && !aarch64_input_section->stub_table()->empty()) + { + Output_section* os = this->output_section(i); + gold_assert(os != NULL); + + relinfo.reloc_shndx = elfcpp::SHN_UNDEF; + relinfo.reloc_shdr = NULL; + relinfo.data_shndx = i; + relinfo.data_shdr = pshdrs + i * elfcpp::Elf_sizes::shdr_size; + + typename Sized_relobj_file::View_size& + view_struct = (*pviews)[i]; + gold_assert(view_struct.view != NULL); + + The_stub_table* stub_table = aarch64_input_section->stub_table(); + off_t offset = stub_table->address() - view_struct.address; + unsigned char* view = view_struct.view + offset; + AArch64_address address = stub_table->address(); + section_size_type view_size = stub_table->data_size(); + stub_table->relocate_stubs(&relinfo, target, os, view, address, + view_size); + } + } +} + + +// Determine if an input section is scannable for stub processing. SHDR is +// the header of the section and SHNDX is the section index. OS is the output +// section for the input section and SYMTAB is the global symbol table used to +// look up ICF information. + +template +bool +AArch64_relobj::text_section_is_scannable( + const elfcpp::Shdr& text_shdr, + unsigned int text_shndx, + const Output_section* os, + const Symbol_table* symtab) +{ + // Skip any empty sections, unallocated sections or sections whose + // type are not SHT_PROGBITS. + if (text_shdr.get_sh_size() == 0 + || (text_shdr.get_sh_flags() & elfcpp::SHF_ALLOC) == 0 + || text_shdr.get_sh_type() != elfcpp::SHT_PROGBITS) + return false; + + // Skip any discarded or ICF'ed sections. + if (os == NULL || symtab->is_section_folded(this, text_shndx)) + return false; + + // Skip exception frame. + if (strcmp(os->name(), ".eh_frame") == 0) + return false ; + + gold_assert(!this->is_output_section_offset_invalid(text_shndx) || + os->find_relaxed_input_section(this, text_shndx) != NULL); + + return true; +} + + +// Determine if we want to scan the SHNDX-th section for relocation stubs. +// This is a helper for AArch64_relobj::scan_sections_for_stubs(). + +template +bool +AArch64_relobj::section_needs_reloc_stub_scanning( + const elfcpp::Shdr& shdr, + const Relobj::Output_sections& out_sections, + const Symbol_table* symtab, + const unsigned char* pshdrs) +{ + unsigned int sh_type = shdr.get_sh_type(); + if (sh_type != elfcpp::SHT_RELA) + return false; + + // Ignore empty section. + off_t sh_size = shdr.get_sh_size(); + if (sh_size == 0) + return false; + + // Ignore reloc section with unexpected symbol table. The + // error will be reported in the final link. + if (this->adjust_shndx(shdr.get_sh_link()) != this->symtab_shndx()) + return false; + + gold_assert(sh_type == elfcpp::SHT_RELA); + unsigned int reloc_size = elfcpp::Elf_sizes::rela_size; + + // Ignore reloc section with unexpected entsize or uneven size. + // The error will be reported in the final link. + if (reloc_size != shdr.get_sh_entsize() || sh_size % reloc_size != 0) + return false; + + // Ignore reloc section with bad info. This error will be + // reported in the final link. + unsigned int text_shndx = this->adjust_shndx(shdr.get_sh_info()); + if (text_shndx >= this->shnum()) + return false; + + const unsigned int shdr_size = elfcpp::Elf_sizes::shdr_size; + const elfcpp::Shdr text_shdr(pshdrs + + text_shndx * shdr_size); + return this->text_section_is_scannable(text_shdr, text_shndx, + out_sections[text_shndx], symtab); +} + + +// Scan relocations for stub generation. + +template +void +AArch64_relobj::scan_sections_for_stubs( + The_target_aarch64* target, + const Symbol_table* symtab, + const Layout* layout) +{ + unsigned int shnum = this->shnum(); + const unsigned int shdr_size = elfcpp::Elf_sizes::shdr_size; + + // Read the section headers. + const unsigned char* pshdrs = this->get_view(this->elf_file()->shoff(), + shnum * shdr_size, + true, true); + + // To speed up processing, we set up hash tables for fast lookup of + // input offsets to output addresses. + this->initialize_input_to_output_maps(); + + const Relobj::Output_sections& out_sections(this->output_sections()); + + Relocate_info relinfo; + relinfo.symtab = symtab; + relinfo.layout = layout; + relinfo.object = this; + + // Do relocation stubs scanning. + const unsigned char* p = pshdrs + shdr_size; + for (unsigned int i = 1; i < shnum; ++i, p += shdr_size) + { + const elfcpp::Shdr shdr(p); + if (this->section_needs_reloc_stub_scanning(shdr, out_sections, symtab, + pshdrs)) + { + unsigned int index = this->adjust_shndx(shdr.get_sh_info()); + AArch64_address output_offset = + this->get_output_section_offset(index); + AArch64_address output_address; + if (output_offset != invalid_address) + { + output_address = out_sections[index]->address() + output_offset; + } + else + { + // Currently this only happens for a relaxed section. + const Output_relaxed_input_section* poris = + out_sections[index]->find_relaxed_input_section(this, index); + gold_assert(poris != NULL); + output_address = poris->address(); + } + + // Get the relocations. + const unsigned char* prelocs = this->get_view(shdr.get_sh_offset(), + shdr.get_sh_size(), + true, false); + + // Get the section contents. + section_size_type input_view_size = 0; + const unsigned char* input_view = + this->section_contents(index, &input_view_size, false); + + relinfo.reloc_shndx = i; + relinfo.data_shndx = index; + unsigned int sh_type = shdr.get_sh_type(); + unsigned int reloc_size; + gold_assert (sh_type == elfcpp::SHT_RELA); + reloc_size = elfcpp::Elf_sizes::rela_size; + + Output_section* os = out_sections[index]; + target->scan_section_for_stubs(&relinfo, sh_type, prelocs, + shdr.get_sh_size() / reloc_size, + os, + output_offset == invalid_address, + input_view, output_address, + input_view_size); + } + } +} + + +// A class to wrap an ordinary input section containing executable code. + +template +class AArch64_input_section : public Output_relaxed_input_section +{ + public: + typedef Stub_table The_stub_table; + + AArch64_input_section(Relobj* relobj, unsigned int shndx) + : Output_relaxed_input_section(relobj, shndx, 1), + stub_table_(NULL), + original_contents_(NULL), original_size_(0), + original_addralign_(1) + { } + + ~AArch64_input_section() + { delete[] this->original_contents_; } + + // Initialize. + void + init(); + + // Set the stub_table. + void + set_stub_table(The_stub_table* st) + { this->stub_table_ = st; } + + // Whether this is a stub table owner. + bool + is_stub_table_owner() const + { return this->stub_table_ != NULL && this->stub_table_->owner() == this; } + + // Return the original size of the section. + uint32_t + original_size() const + { return this->original_size_; } + + // Return the stub table. + The_stub_table* + stub_table() + { return stub_table_; } + + protected: + // Write out this input section. + void + do_write(Output_file*); + + // Return required alignment of this. + uint64_t + do_addralign() const + { + if (this->is_stub_table_owner()) + return std::max(this->stub_table_->addralign(), + static_cast(this->original_addralign_)); + else + return this->original_addralign_; + } + + // Finalize data size. + void + set_final_data_size(); + + // Reset address and file offset. + void + do_reset_address_and_file_offset(); + + // Output offset. + bool + do_output_offset(const Relobj* object, unsigned int shndx, + section_offset_type offset, + section_offset_type* poutput) const + { + if ((object == this->relobj()) + && (shndx == this->shndx()) + && (offset >= 0) + && (offset <= + convert_types(this->original_size_))) + { + *poutput = offset; + return true; + } + else + return false; + } + + private: + // Copying is not allowed. + AArch64_input_section(const AArch64_input_section&); + AArch64_input_section& operator=(const AArch64_input_section&); + + // The relocation stubs. + The_stub_table* stub_table_; + // Original section contents. We have to make a copy here since the file + // containing the original section may not be locked when we need to access + // the contents. + unsigned char* original_contents_; + // Section size of the original input section. + uint32_t original_size_; + // Address alignment of the original input section. + uint32_t original_addralign_; +}; // End of AArch64_input_section + + +// Finalize data size. + +template +void +AArch64_input_section::set_final_data_size() +{ + off_t off = convert_types(this->original_size_); + + if (this->is_stub_table_owner()) + { + this->stub_table_->finalize_data_size(); + off = align_address(off, this->stub_table_->addralign()); + off += this->stub_table_->data_size(); + } + this->set_data_size(off); +} + + +// Reset address and file offset. + +template +void +AArch64_input_section::do_reset_address_and_file_offset() +{ + // Size of the original input section contents. + off_t off = convert_types(this->original_size_); + + // If this is a stub table owner, account for the stub table size. + if (this->is_stub_table_owner()) + { + The_stub_table* stub_table = this->stub_table_; + + // Reset the stub table's address and file offset. The + // current data size for child will be updated after that. + stub_table_->reset_address_and_file_offset(); + off = align_address(off, stub_table_->addralign()); + off += stub_table->current_data_size(); + } + + this->set_current_data_size(off); +} + + +// Initialize an Arm_input_section. + +template +void +AArch64_input_section::init() +{ + Relobj* relobj = this->relobj(); + unsigned int shndx = this->shndx(); + + // We have to cache original size, alignment and contents to avoid locking + // the original file. + this->original_addralign_ = + convert_types(relobj->section_addralign(shndx)); + + // This is not efficient but we expect only a small number of relaxed + // input sections for stubs. + section_size_type section_size; + const unsigned char* section_contents = + relobj->section_contents(shndx, §ion_size, false); + this->original_size_ = + convert_types(relobj->section_size(shndx)); + + gold_assert(this->original_contents_ == NULL); + this->original_contents_ = new unsigned char[section_size]; + memcpy(this->original_contents_, section_contents, section_size); + + // We want to make this look like the original input section after + // output sections are finalized. + Output_section* os = relobj->output_section(shndx); + off_t offset = relobj->output_section_offset(shndx); + gold_assert(os != NULL && !relobj->is_output_section_offset_invalid(shndx)); + this->set_address(os->address() + offset); + this->set_file_offset(os->offset() + offset); + this->set_current_data_size(this->original_size_); + this->finalize_data_size(); +} + + +// Write data to output file. + +template +void +AArch64_input_section::do_write(Output_file* of) +{ + // We have to write out the original section content. + gold_assert(this->original_contents_ != NULL); + of->write(this->offset(), this->original_contents_, + this->original_size_); + + // If this owns a stub table and it is not empty, write it. + if (this->is_stub_table_owner() && !this->stub_table_->empty()) + this->stub_table_->write(of); +} + + +// Arm output section class. This is defined mainly to add a number of stub +// generation methods. - private: - // Symbol table of the output object. - Symbol_table* symbol_table_; - // A pointer to the Layout class, so that we can find the .dynamic - // section when we write out the GOT section. - Layout* layout_; +template +class AArch64_output_section : public Output_section +{ + public: + typedef Target_aarch64 The_target_aarch64; + typedef AArch64_relobj The_aarch64_relobj; + typedef Stub_table The_stub_table; + typedef AArch64_input_section The_aarch64_input_section; - // This class represent dynamic relocations that need to be applied by - // gold because we are using TLS relocations in a static link. - class Static_reloc - { - public: - Static_reloc(unsigned int got_offset, unsigned int r_type, Symbol* gsym) - : got_offset_(got_offset), r_type_(r_type), symbol_is_global_(true) - { this->u_.global.symbol = gsym; } + public: + AArch64_output_section(const char* name, elfcpp::Elf_Word type, + elfcpp::Elf_Xword flags) + : Output_section(name, type, flags) + { } - Static_reloc(unsigned int got_offset, unsigned int r_type, - Sized_relobj_file* relobj, unsigned int index) - : got_offset_(got_offset), r_type_(r_type), symbol_is_global_(false) + ~AArch64_output_section() {} + + // Group input sections for stub generation. + void + group_sections(section_size_type, bool, Target_aarch64*, + const Task*); + + private: + typedef Output_section::Input_section Input_section; + typedef Output_section::Input_section_list Input_section_list; + + // Create a stub group. + void + create_stub_group(Input_section_list::const_iterator, + Input_section_list::const_iterator, + Input_section_list::const_iterator, + The_target_aarch64*, + std::vector&, + const Task*); +}; // End of AArch64_output_section + + +// Create a stub group for input sections from FIRST to LAST. OWNER points to +// the input section that will be the owner of the stub table. + +template void +AArch64_output_section::create_stub_group( + Input_section_list::const_iterator first, + Input_section_list::const_iterator last, + Input_section_list::const_iterator owner, + The_target_aarch64* target, + std::vector& new_relaxed_sections, + const Task* task) +{ + // Currently we convert ordinary input sections into relaxed sections only + // at this point. + The_aarch64_input_section* input_section; + if (owner->is_relaxed_input_section()) + gold_unreachable(); + else { - this->u_.local.relobj = relobj; - this->u_.local.index = index; + gold_assert(owner->is_input_section()); + // Create a new relaxed input section. We need to lock the original + // file. + Task_lock_obj tl(task, owner->relobj()); + input_section = + target->new_aarch64_input_section(owner->relobj(), owner->shndx()); + new_relaxed_sections.push_back(input_section); } - // Return the GOT offset. - unsigned int - got_offset() const - { return this->got_offset_; } - - // Relocation type. - unsigned int - r_type() const - { return this->r_type_; } + // Create a stub table. + The_stub_table* stub_table = + target->new_stub_table(input_section); - // Whether the symbol is global or not. - bool - symbol_is_global() const - { return this->symbol_is_global_; } + input_section->set_stub_table(stub_table); - // For a relocation against a global symbol, the global symbol. - Symbol* - symbol() const + Input_section_list::const_iterator p = first; + // Look for input sections or relaxed input sections in [first ... last]. + do { - gold_assert(this->symbol_is_global_); - return this->u_.global.symbol; + if (p->is_input_section() || p->is_relaxed_input_section()) + { + // The stub table information for input sections live + // in their objects. + The_aarch64_relobj* aarch64_relobj = + static_cast(p->relobj()); + aarch64_relobj->set_stub_table(p->shndx(), stub_table); + } } + while (p++ != last); +} - // For a relocation against a local symbol, the defining object. - Sized_relobj_file* - relobj() const + +// Group input sections for stub generation. GROUP_SIZE is roughly the limit of +// stub groups. We grow a stub group by adding input section until the size is +// just below GROUP_SIZE. The last input section will be converted into a stub +// table owner. If STUB_ALWAYS_AFTER_BRANCH is false, we also add input sectiond +// after the stub table, effectively doubling the group size. +// +// This is similar to the group_sections() function in elf32-arm.c but is +// implemented differently. + +template +void AArch64_output_section::group_sections( + section_size_type group_size, + bool stubs_always_after_branch, + Target_aarch64* target, + const Task* task) +{ + typedef enum + { + NO_GROUP, + FINDING_STUB_SECTION, + HAS_STUB_SECTION + } State; + + std::vector new_relaxed_sections; + + State state = NO_GROUP; + section_size_type off = 0; + section_size_type group_begin_offset = 0; + section_size_type group_end_offset = 0; + section_size_type stub_table_end_offset = 0; + Input_section_list::const_iterator group_begin = + this->input_sections().end(); + Input_section_list::const_iterator stub_table = + this->input_sections().end(); + Input_section_list::const_iterator group_end = this->input_sections().end(); + for (Input_section_list::const_iterator p = this->input_sections().begin(); + p != this->input_sections().end(); + ++p) { - gold_assert(!this->symbol_is_global_); - return this->u_.local.relobj; + section_size_type section_begin_offset = + align_address(off, p->addralign()); + section_size_type section_end_offset = + section_begin_offset + p->data_size(); + + // Check to see if we should group the previously seen sections. + switch (state) + { + case NO_GROUP: + break; + + case FINDING_STUB_SECTION: + // Adding this section makes the group larger than GROUP_SIZE. + if (section_end_offset - group_begin_offset >= group_size) + { + if (stubs_always_after_branch) + { + gold_assert(group_end != this->input_sections().end()); + this->create_stub_group(group_begin, group_end, group_end, + target, new_relaxed_sections, + task); + state = NO_GROUP; + } + else + { + // Input sections up to stub_group_size bytes after the stub + // table can be handled by it too. + state = HAS_STUB_SECTION; + stub_table = group_end; + stub_table_end_offset = group_end_offset; + } + } + break; + + case HAS_STUB_SECTION: + // Adding this section makes the post stub-section group larger + // than GROUP_SIZE. + gold_unreachable(); + // NOT SUPPORTED YET. For completeness only. + if (section_end_offset - stub_table_end_offset >= group_size) + { + gold_assert(group_end != this->input_sections().end()); + this->create_stub_group(group_begin, group_end, stub_table, + target, new_relaxed_sections, task); + state = NO_GROUP; + } + break; + + default: + gold_unreachable(); + } + + // If we see an input section and currently there is no group, start + // a new one. Skip any empty sections. We look at the data size + // instead of calling p->relobj()->section_size() to avoid locking. + if ((p->is_input_section() || p->is_relaxed_input_section()) + && (p->data_size() != 0)) + { + if (state == NO_GROUP) + { + state = FINDING_STUB_SECTION; + group_begin = p; + group_begin_offset = section_begin_offset; + } + + // Keep track of the last input section seen. + group_end = p; + group_end_offset = section_end_offset; + } + + off = section_end_offset; } - // For a relocation against a local symbol, the local symbol index. - unsigned int - index() const + // Create a stub group for any ungrouped sections. + if (state == FINDING_STUB_SECTION || state == HAS_STUB_SECTION) { - gold_assert(!this->symbol_is_global_); - return this->u_.local.index; + gold_assert(group_end != this->input_sections().end()); + this->create_stub_group(group_begin, group_end, + (state == FINDING_STUB_SECTION + ? group_end + : stub_table), + target, new_relaxed_sections, task); } - private: - // GOT offset of the entry to which this relocation is applied. - unsigned int got_offset_; - // Type of relocation. - unsigned int r_type_; - // Whether this relocation is against a global symbol. - bool symbol_is_global_; - // A global or local symbol. - union - { - struct - { - // For a global symbol, the symbol itself. - Symbol* symbol; - } global; - struct - { - // For a local symbol, the object defining object. - Sized_relobj_file* relobj; - // For a local symbol, the symbol index. - unsigned int index; - } local; - } u_; - }; // End of inner class Static_reloc + if (!new_relaxed_sections.empty()) + this->convert_input_sections_to_relaxed_sections(new_relaxed_sections); - std::vector static_relocs_; -}; // End of Output_data_got_aarch64 + // Update the section offsets + for (size_t i = 0; i < new_relaxed_sections.size(); ++i) + { + The_aarch64_relobj* relobj = static_cast( + new_relaxed_sections[i]->relobj()); + unsigned int shndx = new_relaxed_sections[i]->shndx(); + // Tell AArch64_relobj that this input section is converted. + relobj->convert_input_section_to_relaxed_section(shndx); + } +} // End of AArch64_output_section::group_sections AArch64_reloc_property_table* aarch64_reloc_property_table = NULL; @@ -309,10 +1627,23 @@ template class Target_aarch64 : public Sized_target { public: - typedef Target_aarch64 This; + typedef Target_aarch64 This; typedef Output_data_reloc Reloc_section; + typedef Relocate_info The_relocate_info; typedef typename elfcpp::Elf_types::Elf_Addr Address; + typedef AArch64_relobj The_aarch64_relobj; + typedef Reloc_stub The_reloc_stub; + typedef typename The_reloc_stub::Stub_type The_reloc_stub_type; + typedef typename Reloc_stub::Key The_reloc_stub_key; + typedef Stub_table The_stub_table; + typedef std::vector Stub_table_list; + typedef typename Stub_table_list::iterator Stub_table_iterator; + typedef AArch64_input_section The_aarch64_input_section; + typedef AArch64_output_section The_aarch64_output_section; + typedef Unordered_map*, + Section_id_hash> AArch64_input_section_map; const static int TCB_SIZE = size / 8 * 2; Target_aarch64(const Target::Target_info* info = &aarch64_info) @@ -320,8 +1651,9 @@ class Target_aarch64 : public Sized_target got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL), got_tlsdesc_(NULL), global_offset_table_(NULL), rela_dyn_(NULL), rela_irelative_(NULL), copy_relocs_(elfcpp::R_AARCH64_COPY), - got_mod_index_offset_(-1U), tlsdesc_reloc_info_(), - tls_base_symbol_defined_(false) + got_mod_index_offset_(-1U), + tlsdesc_reloc_info_(), tls_base_symbol_defined_(false), + stub_tables_(), stub_group_size_(0), aarch64_input_section_map_() { } // Scan the relocations to determine unreferenced sections for @@ -430,6 +1762,15 @@ class Target_aarch64 : public Sized_target do_plt_address_for_local(const Relobj* relobj, unsigned int symndx) const { return this->plt_section()->address_for_local(relobj, symndx); } + // This function should be defined in targets that can use relocation + // types to determine (implemented in local_reloc_may_be_function_pointer + // and global_reloc_may_be_function_pointer) + // if a function's pointer is taken. ICF uses this in safe mode to only + // fold those functions whose pointer is defintely not taken. + bool + do_can_check_for_function_pointers() const + { return true; } + // Return the number of entries in the PLT. unsigned int plt_entry_count() const; @@ -442,9 +1783,59 @@ class Target_aarch64 : public Sized_target unsigned int plt_entry_size() const; + // Create a stub table. + The_stub_table* + new_stub_table(The_aarch64_input_section*); + + // Create an aarch64 input section. + The_aarch64_input_section* + new_aarch64_input_section(Relobj*, unsigned int); + + // Find an aarch64 input section instance for a given OBJ and SHNDX. + The_aarch64_input_section* + find_aarch64_input_section(Relobj*, unsigned int) const; + + // Return the thread control block size. unsigned int tcb_size() const { return This::TCB_SIZE; } + // Scan a section for stub generation. + void + scan_section_for_stubs(const Relocate_info*, unsigned int, + const unsigned char*, size_t, Output_section*, + bool, const unsigned char*, + Address, + section_size_type); + + // Scan a relocation section for stub. + template + void + scan_reloc_section_for_stubs( + const The_relocate_info* relinfo, + const unsigned char* prelocs, + size_t reloc_count, + Output_section* output_section, + bool needs_special_offset_handling, + const unsigned char* view, + Address view_address, + section_size_type); + + // Relocate a single stub. + void + relocate_stub(The_reloc_stub*, const Relocate_info*, + Output_section*, unsigned char*, Address, + section_size_type); + + // Get the default AArch64 target. + static This* + current_target() + { + gold_assert(parameters->target().machine_code() == elfcpp::EM_AARCH64 + && parameters->target().get_size() == size + && parameters->target().is_big_endian() == big_endian); + return static_cast(parameters->sized_target()); + } + protected: void do_select_as_default_target() @@ -472,6 +1863,12 @@ class Target_aarch64 : public Sized_target layout, got, got_plt, got_irelative); } + + // do_make_elf_object to override the same function in the base class. + Object* + do_make_elf_object(const std::string&, Input_file*, off_t, + const elfcpp::Ehdr&); + Output_data_plt_aarch64* make_data_plt(Layout* layout, Output_data_got_aarch64* got, @@ -481,6 +1878,35 @@ class Target_aarch64 : public Sized_target return this->do_make_data_plt(layout, got, got_plt, got_irelative); } + // We only need to generate stubs, and hence perform relaxation if we are + // not doing relocatable linking. + virtual bool + do_may_relax() const + { return !parameters->options().relocatable(); } + + // Relaxation hook. This is where we do stub generation. + virtual bool + do_relax(int, const Input_objects*, Symbol_table*, Layout*, const Task*); + + void + group_sections(Layout* layout, + section_size_type group_size, + bool stubs_always_after_branch, + const Task* task); + + void + scan_reloc_for_stub(const The_relocate_info*, unsigned int, + const Sized_symbol*, unsigned int, + const Symbol_value*, + typename elfcpp::Elf_types::Elf_Swxword, + Address Elf_Addr); + + // Make an output section. + Output_section* + do_make_output_section(const char* name, elfcpp::Elf_Word type, + elfcpp::Elf_Xword flags) + { return new The_aarch64_output_section(name, type, flags); } + private: // The class which scans relocations. class Scan @@ -542,6 +1968,10 @@ class Target_aarch64 : public Sized_target void check_non_pic(Relobj*, unsigned int r_type); + bool + reloc_needs_plt_for_ifunc(Sized_relobj_file*, + unsigned int r_type); + // Whether we have issued an error about a non-PIC compilation. bool issued_non_pic_error_; }; @@ -569,8 +1999,8 @@ class Target_aarch64 : public Sized_target section_size_type); private: - inline typename AArch64_relocate_functions::Status - relocate_tls(const Relocate_info*, + inline typename AArch64_relocate_functions::Status + relocate_tls(const Relocate_info*, Target_aarch64*, size_t, const elfcpp::Rela&, @@ -579,36 +2009,45 @@ class Target_aarch64 : public Sized_target unsigned char*, typename elfcpp::Elf_types::Elf_Addr); - inline typename AArch64_relocate_functions::Status + inline typename AArch64_relocate_functions::Status tls_gd_to_le( - const Relocate_info*, + const Relocate_info*, + Target_aarch64*, + const elfcpp::Rela&, + unsigned int, + unsigned char*, + const Symbol_value*); + + inline typename AArch64_relocate_functions::Status + tls_ld_to_le( + const Relocate_info*, Target_aarch64*, const elfcpp::Rela&, unsigned int, unsigned char*, const Symbol_value*); - inline typename AArch64_relocate_functions::Status + inline typename AArch64_relocate_functions::Status tls_ie_to_le( - const Relocate_info*, + const Relocate_info*, Target_aarch64*, const elfcpp::Rela&, unsigned int, unsigned char*, const Symbol_value*); - inline typename AArch64_relocate_functions::Status + inline typename AArch64_relocate_functions::Status tls_desc_gd_to_le( - const Relocate_info*, + const Relocate_info*, Target_aarch64*, const elfcpp::Rela&, unsigned int, unsigned char*, const Symbol_value*); - inline typename AArch64_relocate_functions::Status + inline typename AArch64_relocate_functions::Status tls_desc_gd_to_ie( - const Relocate_info*, + const Relocate_info*, Target_aarch64*, const elfcpp::Rela&, unsigned int, @@ -773,6 +2212,11 @@ class Target_aarch64 : public Sized_target std::vector tlsdesc_reloc_info_; // True if the _TLS_MODULE_BASE_ symbol has been defined. bool tls_base_symbol_defined_; + // List of stub_tables + Stub_table_list stub_tables_; + // Actual stub group size + section_size_type stub_group_size_; + AArch64_input_section_map aarch64_input_section_map_; }; // End of Target_aarch64 @@ -786,7 +2230,7 @@ const Target::Target_info Target_aarch64<64, false>::aarch64_info = false, // has_resolve false, // has_code_fill true, // is_default_stack_executable - false, // can_icf_inline_merge_sections + true, // can_icf_inline_merge_sections '\0', // wrap_char "/lib/ld.so.1", // program interpreter 0x400000, // default_text_segment_address @@ -840,7 +2284,7 @@ const Target::Target_info Target_aarch64<64, true>::aarch64_info = false, // has_resolve false, // has_code_fill true, // is_default_stack_executable - false, // can_icf_inline_merge_sections + true, // can_icf_inline_merge_sections '\0', // wrap_char "/lib/ld.so.1", // program interpreter 0x400000, // default_text_segment_address @@ -997,28 +2441,429 @@ Target_aarch64::rela_dyn_section(Layout* layout) return this->rela_dyn_; } -// Get the section to use for IRELATIVE relocs, creating it if -// necessary. These go in .rela.dyn, but only after all other dynamic -// relocations. They need to follow the other dynamic relocations so -// that they can refer to global variables initialized by those -// relocs. +// Get the section to use for IRELATIVE relocs, creating it if +// necessary. These go in .rela.dyn, but only after all other dynamic +// relocations. They need to follow the other dynamic relocations so +// that they can refer to global variables initialized by those +// relocs. + +template +typename Target_aarch64::Reloc_section* +Target_aarch64::rela_irelative_section(Layout* layout) +{ + if (this->rela_irelative_ == NULL) + { + // Make sure we have already created the dynamic reloc section. + this->rela_dyn_section(layout); + this->rela_irelative_ = new Reloc_section(false); + layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA, + elfcpp::SHF_ALLOC, this->rela_irelative_, + ORDER_DYNAMIC_RELOCS, false); + gold_assert(this->rela_dyn_->output_section() + == this->rela_irelative_->output_section()); + } + return this->rela_irelative_; +} + + +// do_make_elf_object to override the same function in the base class. We need +// to use a target-specific sub-class of Sized_relobj_file to +// store backend specific information. Hence we need to have our own ELF object +// creation. + +template +Object* +Target_aarch64::do_make_elf_object( + const std::string& name, + Input_file* input_file, + off_t offset, const elfcpp::Ehdr& ehdr) +{ + int et = ehdr.get_e_type(); + // ET_EXEC files are valid input for --just-symbols/-R, + // and we treat them as relocatable objects. + if (et == elfcpp::ET_EXEC && input_file->just_symbols()) + return Sized_target::do_make_elf_object( + name, input_file, offset, ehdr); + else if (et == elfcpp::ET_REL) + { + AArch64_relobj* obj = + new AArch64_relobj(name, input_file, offset, ehdr); + obj->setup(); + return obj; + } + else if (et == elfcpp::ET_DYN) + { + // Keep base implementation. + Sized_dynobj* obj = + new Sized_dynobj(name, input_file, offset, ehdr); + obj->setup(); + return obj; + } + else + { + gold_error(_("%s: unsupported ELF file type %d"), + name.c_str(), et); + return NULL; + } +} + + +// Scan a relocation for stub generation. + +template +void +Target_aarch64::scan_reloc_for_stub( + const Relocate_info* relinfo, + unsigned int r_type, + const Sized_symbol* gsym, + unsigned int r_sym, + const Symbol_value* psymval, + typename elfcpp::Elf_types::Elf_Swxword addend, + Address address) +{ + const AArch64_relobj* aarch64_relobj = + static_cast*>(relinfo->object); + + Symbol_value symval; + if (gsym != NULL) + { + const AArch64_reloc_property* arp = aarch64_reloc_property_table-> + get_reloc_property(r_type); + if (gsym->use_plt_offset(arp->reference_flags())) + { + // This uses a PLT, change the symbol value. + symval.set_output_value(this->plt_section()->address() + + gsym->plt_offset()); + psymval = &symval; + } + else if (gsym->is_undefined()) + // There is no need to generate a stub symbol is undefined. + return; + } + + // Get the symbol value. + typename Symbol_value::Value value = psymval->value(aarch64_relobj, 0); + + // Owing to pipelining, the PC relative branches below actually skip + // two instructions when the branch offset is 0. + Address destination = static_cast
(-1); + switch (r_type) + { + case elfcpp::R_AARCH64_CALL26: + case elfcpp::R_AARCH64_JUMP26: + destination = value + addend; + break; + default: + gold_unreachable(); + } + + typename The_reloc_stub::Stub_type stub_type = The_reloc_stub:: + stub_type_for_reloc(r_type, address, destination); + if (stub_type == The_reloc_stub::ST_NONE) + return ; + + The_stub_table* stub_table = aarch64_relobj->stub_table(relinfo->data_shndx); + gold_assert(stub_table != NULL); + + The_reloc_stub_key key(stub_type, gsym, aarch64_relobj, r_sym, addend); + The_reloc_stub* stub = stub_table->find_reloc_stub(key); + if (stub == NULL) + { + stub = new The_reloc_stub(stub_type); + stub_table->add_reloc_stub(stub, key); + } + stub->set_destination_address(destination); +} // End of Target_aarch64::scan_reloc_for_stub + + +// This function scans a relocation section for stub generation. +// The template parameter Relocate must be a class type which provides +// a single function, relocate(), which implements the machine +// specific part of a relocation. + +// BIG_ENDIAN is the endianness of the data. SH_TYPE is the section type: +// SHT_REL or SHT_RELA. + +// PRELOCS points to the relocation data. RELOC_COUNT is the number +// of relocs. OUTPUT_SECTION is the output section. +// NEEDS_SPECIAL_OFFSET_HANDLING is true if input offsets need to be +// mapped to output offsets. + +// VIEW is the section data, VIEW_ADDRESS is its memory address, and +// VIEW_SIZE is the size. These refer to the input section, unless +// NEEDS_SPECIAL_OFFSET_HANDLING is true, in which case they refer to +// the output section. + +template +template +void inline +Target_aarch64::scan_reloc_section_for_stubs( + const Relocate_info* relinfo, + const unsigned char* prelocs, + size_t reloc_count, + Output_section* /*output_section*/, + bool /*needs_special_offset_handling*/, + const unsigned char* /*view*/, + Address view_address, + section_size_type) +{ + typedef typename Reloc_types::Reloc Reltype; + + const int reloc_size = + Reloc_types::reloc_size; + AArch64_relobj* object = + static_cast*>(relinfo->object); + unsigned int local_count = object->local_symbol_count(); + + gold::Default_comdat_behavior default_comdat_behavior; + Comdat_behavior comdat_behavior = CB_UNDETERMINED; + + for (size_t i = 0; i < reloc_count; ++i, prelocs += reloc_size) + { + Reltype reloc(prelocs); + typename elfcpp::Elf_types::Elf_WXword r_info = reloc.get_r_info(); + unsigned int r_sym = elfcpp::elf_r_sym(r_info); + unsigned int r_type = elfcpp::elf_r_type(r_info); + if (r_type != elfcpp::R_AARCH64_CALL26 + && r_type != elfcpp::R_AARCH64_JUMP26) + continue; + + section_offset_type offset = + convert_to_section_size_type(reloc.get_r_offset()); + + // Get the addend. + typename elfcpp::Elf_types::Elf_Swxword addend = + reloc.get_r_addend(); + + const Sized_symbol* sym; + Symbol_value symval; + const Symbol_value *psymval; + bool is_defined_in_discarded_section; + unsigned int shndx; + if (r_sym < local_count) + { + sym = NULL; + psymval = object->local_symbol(r_sym); + + // If the local symbol belongs to a section we are discarding, + // and that section is a debug section, try to find the + // corresponding kept section and map this symbol to its + // counterpart in the kept section. The symbol must not + // correspond to a section we are folding. + bool is_ordinary; + shndx = psymval->input_shndx(&is_ordinary); + is_defined_in_discarded_section = + (is_ordinary + && shndx != elfcpp::SHN_UNDEF + && !object->is_section_included(shndx) + && !relinfo->symtab->is_section_folded(object, shndx)); + + // We need to compute the would-be final value of this local + // symbol. + if (!is_defined_in_discarded_section) + { + typedef Sized_relobj_file ObjType; + typename ObjType::Compute_final_local_value_status status = + object->compute_final_local_value(r_sym, psymval, &symval, + relinfo->symtab); + if (status == ObjType::CFLV_OK) + { + // Currently we cannot handle a branch to a target in + // a merged section. If this is the case, issue an error + // and also free the merge symbol value. + if (!symval.has_output_value()) + { + const std::string& section_name = + object->section_name(shndx); + object->error(_("cannot handle branch to local %u " + "in a merged section %s"), + r_sym, section_name.c_str()); + } + psymval = &symval; + } + else + { + // We cannot determine the final value. + continue; + } + } + } + else + { + const Symbol* gsym; + gsym = object->global_symbol(r_sym); + gold_assert(gsym != NULL); + if (gsym->is_forwarder()) + gsym = relinfo->symtab->resolve_forwards(gsym); + + sym = static_cast*>(gsym); + if (sym->has_symtab_index() && sym->symtab_index() != -1U) + symval.set_output_symtab_index(sym->symtab_index()); + else + symval.set_no_output_symtab_entry(); + + // We need to compute the would-be final value of this global + // symbol. + const Symbol_table* symtab = relinfo->symtab; + const Sized_symbol* sized_symbol = + symtab->get_sized_symbol(gsym); + Symbol_table::Compute_final_value_status status; + typename elfcpp::Elf_types::Elf_Addr value = + symtab->compute_final_value(sized_symbol, &status); + + // Skip this if the symbol has not output section. + if (status == Symbol_table::CFVS_NO_OUTPUT_SECTION) + continue; + symval.set_output_value(value); + + if (gsym->type() == elfcpp::STT_TLS) + symval.set_is_tls_symbol(); + else if (gsym->type() == elfcpp::STT_GNU_IFUNC) + symval.set_is_ifunc_symbol(); + psymval = &symval; + + is_defined_in_discarded_section = + (gsym->is_defined_in_discarded_section() + && gsym->is_undefined()); + shndx = 0; + } + + Symbol_value symval2; + if (is_defined_in_discarded_section) + { + if (comdat_behavior == CB_UNDETERMINED) + { + std::string name = object->section_name(relinfo->data_shndx); + comdat_behavior = default_comdat_behavior.get(name.c_str()); + } + if (comdat_behavior == CB_PRETEND) + { + bool found; + typename elfcpp::Elf_types::Elf_Addr value = + object->map_to_kept_section(shndx, &found); + if (found) + symval2.set_output_value(value + psymval->input_value()); + else + symval2.set_output_value(0); + } + else + { + if (comdat_behavior == CB_WARNING) + gold_warning_at_location(relinfo, i, offset, + _("relocation refers to discarded " + "section")); + symval2.set_output_value(0); + } + symval2.set_no_output_symtab_entry(); + psymval = &symval2; + } + + // If symbol is a section symbol, we don't know the actual type of + // destination. Give up. + if (psymval->is_section_symbol()) + continue; + + this->scan_reloc_for_stub(relinfo, r_type, sym, r_sym, psymval, + addend, view_address + offset); + } // End of iterating relocs in a section +} // End of Target_aarch64::scan_reloc_section_for_stubs + + +// Scan an input section for stub generation. + +template +void +Target_aarch64::scan_section_for_stubs( + const Relocate_info* relinfo, + unsigned int sh_type, + const unsigned char* prelocs, + size_t reloc_count, + Output_section* output_section, + bool needs_special_offset_handling, + const unsigned char* view, + Address view_address, + section_size_type view_size) +{ + gold_assert(sh_type == elfcpp::SHT_RELA); + this->scan_reloc_section_for_stubs( + relinfo, + prelocs, + reloc_count, + output_section, + needs_special_offset_handling, + view, + view_address, + view_size); +} + + +// Relocate a single stub. template -typename Target_aarch64::Reloc_section* -Target_aarch64::rela_irelative_section(Layout* layout) +void Target_aarch64:: +relocate_stub(The_reloc_stub* stub, + const The_relocate_info*, + Output_section*, + unsigned char* view, + Address address, + section_size_type) { - if (this->rela_irelative_ == NULL) + typedef AArch64_relocate_functions The_reloc_functions; + typedef typename The_reloc_functions::Status The_reloc_functions_status; + typedef typename elfcpp::Swap<32,big_endian>::Valtype Insntype; + + Insntype* ip = reinterpret_cast(view); + int insn_number = stub->stub_insn_number(); + const uint32_t* insns = stub->stub_insns(); + // Check the insns are really those stub insns. + for (int i = 0; i < insn_number; ++i) { - // Make sure we have already created the dynamic reloc section. - this->rela_dyn_section(layout); - this->rela_irelative_ = new Reloc_section(false); - layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA, - elfcpp::SHF_ALLOC, this->rela_irelative_, - ORDER_DYNAMIC_RELOCS, false); - gold_assert(this->rela_dyn_->output_section() - == this->rela_irelative_->output_section()); + Insntype insn = elfcpp::Swap<32,big_endian>::readval(ip + i); + gold_assert(((uint32_t)insn == insns[i+1])); + } + + Address dest = stub->destination_address(); + + switch(stub->stub_type()) + { + case The_reloc_stub::ST_ADRP_BRANCH: + { + // 1st reloc is ADR_PREL_PG_HI21 + The_reloc_functions_status status = + The_reloc_functions::adrp(view, dest, address); + // An error should never arise in the above step. If so, please + // check 'aarch64_valid_for_adrp_p'. + gold_assert(status == The_reloc_functions::STATUS_OKAY); + + // 2nd reloc is ADD_ABS_LO12_NC + const AArch64_reloc_property* arp = + aarch64_reloc_property_table->get_reloc_property( + elfcpp::R_AARCH64_ADD_ABS_LO12_NC); + gold_assert(arp != NULL); + status = The_reloc_functions::template + rela_general<32>(view + 4, dest, 0, arp); + // An error should never arise, it is an "_NC" relocation. + gold_assert(status == The_reloc_functions::STATUS_OKAY); + } + break; + + case The_reloc_stub::ST_LONG_BRANCH_ABS: + // 1st reloc is R_AARCH64_PREL64, at offset 8 + elfcpp::Swap<64,big_endian>::writeval(view + 8, dest); + break; + + case The_reloc_stub::ST_LONG_BRANCH_PCREL: + { + // "PC" calculation is the 2nd insn in the stub. + uint64_t offset = dest - (address + 4); + // Offset is placed at offset 4 and 5. + elfcpp::Swap<64,big_endian>::writeval(view + 16, offset); + } + break; + + default: + gold_unreachable(); } - return this->rela_irelative_; } @@ -1040,7 +2885,7 @@ class Output_data_plt_aarch64 : public Output_section_data Output_data_got_aarch64* got, Output_data_space* got_plt, Output_data_space* got_irelative) - : Output_section_data(addralign), tlsdesc_rel_(NULL), + : Output_section_data(addralign), tlsdesc_rel_(NULL), irelative_rel_(NULL), got_(got), got_plt_(got_plt), got_irelative_(got_irelative), count_(0), irelative_count_(0), tlsdesc_got_offset_(-1U) { this->init(layout); } @@ -1051,7 +2896,18 @@ class Output_data_plt_aarch64 : public Output_section_data // Add an entry to the PLT. void - add_entry(Symbol* gsym); + add_entry(Symbol_table*, Layout*, Symbol* gsym); + + // Add an entry to the PLT for a local STT_GNU_IFUNC symbol. + unsigned int + add_local_ifunc_entry(Symbol_table* symtab, Layout*, + Sized_relobj_file* relobj, + unsigned int local_sym_index); + + // Add the relocation for a PLT entry. + void + add_relocation(Symbol_table*, Layout*, Symbol* gsym, + unsigned int got_offset); // Add the reserved TLSDESC_PLT entry to the PLT. void @@ -1226,7 +3082,7 @@ class Output_data_plt_aarch64 : public Output_section_data // The number of PLT entries. unsigned int count_; - // Number of PLT entries with R_X86_64_IRELATIVE relocs. These + // Number of PLT entries with R_AARCH64_IRELATIVE relocs. These // follow the regular PLT entries. unsigned int irelative_count_; @@ -1260,32 +3116,100 @@ Output_data_plt_aarch64::do_adjust_output_section( template void -Output_data_plt_aarch64::add_entry(Symbol* gsym) +Output_data_plt_aarch64::add_entry(Symbol_table* symtab, + Layout* layout, Symbol* gsym) { gold_assert(!gsym->has_plt_offset()); - gsym->set_plt_offset((this->count_) * this->get_plt_entry_size() - + this->first_plt_entry_offset()); + unsigned int* pcount; + unsigned int plt_reserved; + Output_section_data_build* got; + + if (gsym->type() == elfcpp::STT_GNU_IFUNC + && gsym->can_use_relative_reloc(false)) + { + pcount = &this->irelative_count_; + plt_reserved = 0; + got = this->got_irelative_; + } + else + { + pcount = &this->count_; + plt_reserved = this->first_plt_entry_offset(); + got = this->got_plt_; + } + + gsym->set_plt_offset((*pcount) * this->get_plt_entry_size() + + plt_reserved); - ++this->count_; + ++*pcount; - section_offset_type got_offset = this->got_plt_->current_data_size(); + section_offset_type got_offset = got->current_data_size(); // Every PLT entry needs a GOT entry which points back to the PLT // entry (this will be changed by the dynamic linker, normally // lazily when the function is called). - this->got_plt_->set_current_data_size(got_offset + size / 8); + got->set_current_data_size(got_offset + size / 8); // Every PLT entry needs a reloc. - gsym->set_needs_dynsym_entry(); - this->rel_->add_global(gsym, elfcpp::R_AARCH64_JUMP_SLOT, - this->got_plt_, got_offset, 0); + this->add_relocation(symtab, layout, gsym, got_offset); // Note that we don't need to save the symbol. The contents of the // PLT are independent of which symbols are used. The symbols only // appear in the relocations. } +// Add an entry to the PLT for a local STT_GNU_IFUNC symbol. Return +// the PLT offset. + +template +unsigned int +Output_data_plt_aarch64::add_local_ifunc_entry( + Symbol_table* symtab, + Layout* layout, + Sized_relobj_file* relobj, + unsigned int local_sym_index) +{ + unsigned int plt_offset = this->irelative_count_ * this->get_plt_entry_size(); + ++this->irelative_count_; + + section_offset_type got_offset = this->got_irelative_->current_data_size(); + + // Every PLT entry needs a GOT entry which points back to the PLT + // entry. + this->got_irelative_->set_current_data_size(got_offset + size / 8); + + // Every PLT entry needs a reloc. + Reloc_section* rela = this->rela_irelative(symtab, layout); + rela->add_symbolless_local_addend(relobj, local_sym_index, + elfcpp::R_AARCH64_IRELATIVE, + this->got_irelative_, got_offset, 0); + + return plt_offset; +} + +// Add the relocation for a PLT entry. + +template +void +Output_data_plt_aarch64::add_relocation( + Symbol_table* symtab, Layout* layout, Symbol* gsym, unsigned int got_offset) +{ + if (gsym->type() == elfcpp::STT_GNU_IFUNC + && gsym->can_use_relative_reloc(false)) + { + Reloc_section* rela = this->rela_irelative(symtab, layout); + rela->add_symbolless_global_addend(gsym, elfcpp::R_AARCH64_IRELATIVE, + this->got_irelative_, got_offset, 0); + } + else + { + gsym->set_needs_dynsym_entry(); + this->rel_->add_global(gsym, elfcpp::R_AARCH64_JUMP_SLOT, this->got_plt_, + got_offset, 0); + } +} + // Return where the TLSDESC relocations should go, creating it if // necessary. These follow the JUMP_SLOT relocations. @@ -1477,6 +3401,7 @@ Output_data_plt_aarch64_standard<32, false>:: 0xd503201f, /* nop */ }; + template<> const uint32_t Output_data_plt_aarch64_standard<32, true>:: @@ -1492,6 +3417,7 @@ Output_data_plt_aarch64_standard<32, true>:: 0xd503201f, /* nop */ }; + template<> const uint32_t Output_data_plt_aarch64_standard<64, false>:: @@ -1507,6 +3433,7 @@ Output_data_plt_aarch64_standard<64, false>:: 0xd503201f, /* nop */ }; + template<> const uint32_t Output_data_plt_aarch64_standard<64, true>:: @@ -1522,6 +3449,7 @@ Output_data_plt_aarch64_standard<64, true>:: 0xd503201f, /* nop */ }; + template<> const uint32_t Output_data_plt_aarch64_standard<32, false>:: @@ -1533,6 +3461,7 @@ Output_data_plt_aarch64_standard<32, false>:: 0xd61f0220, /* br x17. */ }; + template<> const uint32_t Output_data_plt_aarch64_standard<32, true>:: @@ -1544,6 +3473,7 @@ Output_data_plt_aarch64_standard<32, true>:: 0xd61f0220, /* br x17. */ }; + template<> const uint32_t Output_data_plt_aarch64_standard<64, false>:: @@ -1555,6 +3485,7 @@ Output_data_plt_aarch64_standard<64, false>:: 0xd61f0220, /* br x17. */ }; + template<> const uint32_t Output_data_plt_aarch64_standard<64, true>:: @@ -1566,6 +3497,7 @@ Output_data_plt_aarch64_standard<64, true>:: 0xd61f0220, /* br x17. */ }; + template void Output_data_plt_aarch64_standard::do_fill_first_plt_entry( @@ -1605,6 +3537,7 @@ Output_data_plt_aarch64_standard::do_fill_first_plt_entry( | ((gotplt_2nd_ent & 0xfff) << 10))); } + // Subsequent entries in the PLT for an executable. // FIXME: This only works for 64bit @@ -1758,8 +3691,12 @@ Output_data_plt_aarch64::do_write(Output_file* of) unsigned char* const oview = of->get_output_view(offset, oview_size); const off_t got_file_offset = this->got_plt_->offset(); + gold_assert(got_file_offset + this->got_plt_->data_size() + == this->got_irelative_->offset()); + const section_size_type got_size = - convert_to_section_size_type(this->got_plt_->data_size()); + convert_to_section_size_type(this->got_plt_->data_size() + + this->got_irelative_->data_size()); unsigned char* const got_view = of->get_output_view(got_file_offset, got_size); @@ -1859,26 +3796,33 @@ class AArch64_relocate_functions STATUS_BAD_RELOC, // Relocation cannot be applied. } Status; - private: typedef AArch64_relocate_functions This; typedef typename elfcpp::Elf_types::Elf_Addr Address; + typedef Relocate_info The_relocate_info; + typedef AArch64_relobj The_aarch64_relobj; + typedef Reloc_stub The_reloc_stub; + typedef typename The_reloc_stub::Stub_type The_reloc_stub_type; + typedef Stub_table The_stub_table; + typedef elfcpp::Rela The_rela; + typedef typename elfcpp::Swap::Valtype AArch64_valtype; // Return the page address of the address. // Page(address) = address & ~0xFFF - static inline typename elfcpp::Swap::Valtype + static inline AArch64_valtype Page(Address address) { return (address & (~static_cast
(0xFFF))); } + private: // Update instruction (pointed by view) with selected bits (immed). // val = (val & ~dst_mask) | (immed << doffset) template static inline void update_view(unsigned char* view, - typename elfcpp::Swap::Valtype immed, + AArch64_valtype immed, elfcpp::Elf_Xword doffset, elfcpp::Elf_Xword dst_mask) { @@ -1900,8 +3844,8 @@ class AArch64_relocate_functions static inline void update_view_two_parts( unsigned char* view, - typename elfcpp::Swap::Valtype immed1, - typename elfcpp::Swap::Valtype immed2, + AArch64_valtype immed1, + AArch64_valtype immed2, elfcpp::Elf_Xword doffset1, elfcpp::Elf_Xword doffset2, elfcpp::Elf_Xword dst_mask) @@ -1915,17 +3859,13 @@ class AArch64_relocate_functions (immed2 << doffset2))); } - // Update adr or adrp instruction with [32:12] of X. + // Update adr or adrp instruction with immed. // In adr and adrp: [30:29] immlo [23:5] immhi static inline void - update_adr(unsigned char* view, - typename elfcpp::Swap::Valtype x, - const AArch64_reloc_property* /* reloc_property */) + update_adr(unsigned char* view, AArch64_valtype immed) { elfcpp::Elf_Xword dst_mask = (0x3 << 29) | (0x7ffff << 5); - typename elfcpp::Swap<32, big_endian>::Valtype immed = - (x >> 12) & 0x1fffff; This::template update_view_two_parts<32>( view, immed & 0x3, @@ -1938,9 +3878,10 @@ class AArch64_relocate_functions // Update movz/movn instruction with bits immed. // Set instruction to movz if is_movz is true, otherwise set instruction // to movn. + static inline void update_movnz(unsigned char* view, - typename elfcpp::Swap::Valtype immed, + AArch64_valtype immed, bool is_movz) { typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype; @@ -1953,17 +3894,44 @@ class AArch64_relocate_functions aarch64_howto[AArch64_reloc_property::INST_MOVW].dst_mask; // Clear immediate fields and opc code. - val &= ~(dst_mask | (0x11 << 29)); + val &= ~(dst_mask | (0x3 << 29)); // Set instruction to movz or movn. // movz: [30:29] is 10 movn: [30:29] is 00 if (is_movz) - val |= (0x10 << 29); + val |= (0x2 << 29); elfcpp::Swap<32, big_endian>::writeval(wv, static_cast(val | (immed << doffset))); } + // Update selected bits in text. + + template + static inline typename This::Status + reloc_common(unsigned char* view, Address x, + const AArch64_reloc_property* reloc_property) + { + // Select bits from X. + Address immed = reloc_property->select_x_value(x); + + // Update view. + const AArch64_reloc_property::Reloc_inst inst = + reloc_property->reloc_inst(); + // If it is a data relocation or instruction has 2 parts of immediate + // fields, you should not call pcrela_general. + gold_assert(aarch64_howto[inst].doffset2 == -1 && + aarch64_howto[inst].doffset != -1); + This::template update_view(view, immed, + aarch64_howto[inst].doffset, + aarch64_howto[inst].dst_mask); + + // Do check overflow or alignment if needed. + return (reloc_property->checkup_x_value(x) + ? This::STATUS_OKAY + : This::STATUS_OVERFLOW); + } + public: // Do a simple rela relocation at unaligned addresses. @@ -1973,7 +3941,7 @@ class AArch64_relocate_functions rela_ua(unsigned char* view, const Sized_relobj_file* object, const Symbol_value* psymval, - typename elfcpp::Swap::Valtype addend, + AArch64_valtype addend, const AArch64_reloc_property* reloc_property) { typedef typename elfcpp::Swap_unaligned::Valtype @@ -1994,7 +3962,7 @@ class AArch64_relocate_functions pcrela_ua(unsigned char* view, const Sized_relobj_file* object, const Symbol_value* psymval, - typename elfcpp::Swap::Valtype addend, + AArch64_valtype addend, Address address, const AArch64_reloc_property* reloc_property) { @@ -2016,15 +3984,13 @@ class AArch64_relocate_functions unsigned char* view, const Sized_relobj_file* object, const Symbol_value* psymval, - typename elfcpp::Swap::Valtype addend, + AArch64_valtype addend, const AArch64_reloc_property* reloc_property) { - typedef typename elfcpp::Swap::Valtype - Valtype; + typedef typename elfcpp::Swap::Valtype Valtype; Valtype* wv = reinterpret_cast(view); Address x = psymval->value(object, addend); - elfcpp::Swap::writeval(wv, - static_cast(x)); + elfcpp::Swap::writeval(wv,static_cast(x)); return (reloc_property->checkup_x_value(x) ? This::STATUS_OKAY : This::STATUS_OVERFLOW); @@ -2038,30 +4004,12 @@ class AArch64_relocate_functions rela_general(unsigned char* view, const Sized_relobj_file* object, const Symbol_value* psymval, - typename elfcpp::Swap::Valtype addend, + AArch64_valtype addend, const AArch64_reloc_property* reloc_property) { // Calculate relocation. - Address x = psymval->value(object, addend); - - // Select bits from X. - Address immed = reloc_property->select_x_value(x); - - // Update view. - const AArch64_reloc_property::Reloc_inst inst = - reloc_property->reloc_inst(); - // If it is a data relocation or instruction has 2 parts of immediate - // fields, you should not call rela_general. - gold_assert(aarch64_howto[inst].doffset2 == -1 && - aarch64_howto[inst].doffset != -1); - This::template update_view(view, immed, - aarch64_howto[inst].doffset, - aarch64_howto[inst].dst_mask); - - // Do check overflow or alignment if needed. - return (reloc_property->checkup_x_value(x) - ? This::STATUS_OKAY - : This::STATUS_OVERFLOW); + Address x = psymval->value(object, addend); + return This::template reloc_common(view, x, reloc_property); } // Do relocate. Update selected bits in text. @@ -2071,31 +4019,13 @@ class AArch64_relocate_functions static inline typename This::Status rela_general( unsigned char* view, - typename elfcpp::Swap::Valtype s, - typename elfcpp::Swap::Valtype addend, + AArch64_valtype s, + AArch64_valtype addend, const AArch64_reloc_property* reloc_property) { // Calculate relocation. Address x = s + addend; - - // Select bits from X. - Address immed = reloc_property->select_x_value(x); - - // Update view. - const AArch64_reloc_property::Reloc_inst inst = - reloc_property->reloc_inst(); - // If it is a data relocation or instruction has 2 parts of immediate - // fields, you should not call rela_general. - gold_assert(aarch64_howto[inst].doffset2 == -1 && - aarch64_howto[inst].doffset != -1); - This::template update_view(view, immed, - aarch64_howto[inst].doffset, - aarch64_howto[inst].dst_mask); - - // Do check overflow or alignment if needed. - return (reloc_property->checkup_x_value(x) - ? This::STATUS_OKAY - : This::STATUS_OVERFLOW); + return This::template reloc_common(view, x, reloc_property); } // Do address relative relocate. Update selected bits in text. @@ -2107,31 +4037,34 @@ class AArch64_relocate_functions unsigned char* view, const Sized_relobj_file* object, const Symbol_value* psymval, - typename elfcpp::Swap::Valtype addend, + AArch64_valtype addend, Address address, const AArch64_reloc_property* reloc_property) { // Calculate relocation. Address x = psymval->value(object, addend) - address; + return This::template reloc_common(view, x, reloc_property); + } - // Select bits from X. - Address immed = reloc_property->select_x_value(x); - // Update view. - const AArch64_reloc_property::Reloc_inst inst = - reloc_property->reloc_inst(); - // If it is a data relocation or instruction has 2 parts of immediate - // fields, you should not call pcrela_general. - gold_assert(aarch64_howto[inst].doffset2 == -1 && - aarch64_howto[inst].doffset != -1); - This::template update_view(view, immed, - aarch64_howto[inst].doffset, - aarch64_howto[inst].dst_mask); + // Calculate (S + A) - address, update adr instruction. - // Do check overflow or alignment if needed. - return (reloc_property->checkup_x_value(x) - ? This::STATUS_OKAY - : This::STATUS_OVERFLOW); + static inline typename This::Status + adr(unsigned char* view, + const Sized_relobj_file* object, + const Symbol_value* psymval, + Address addend, + Address address, + const AArch64_reloc_property* /* reloc_property */) + { + AArch64_valtype x = psymval->value(object, addend) - address; + // Pick bits [20:0] of X. + AArch64_valtype immed = x & 0x1fffff; + update_adr(view, immed); + // Check -2^20 <= X < 2^20 + return (size == 64 && Bits<21>::has_overflow((x)) + ? This::STATUS_OVERFLOW + : This::STATUS_OKAY); } // Calculate PG(S+A) - PG(address), update adrp instruction. @@ -2143,10 +4076,12 @@ class AArch64_relocate_functions Address sa, Address address) { - typename elfcpp::Swap::Valtype x = - This::Page(sa) - This::Page(address); - update_adr(view, x, NULL); - return (size == 64 && Bits<32>::has_overflow(x) + AArch64_valtype x = This::Page(sa) - This::Page(address); + // Pick [32:12] of X. + AArch64_valtype immed = (x >> 12) & 0x1fffff; + update_adr(view, immed); + // Check -2^32 <= X < 2^32 + return (size == 64 && Bits<33>::has_overflow((x)) ? This::STATUS_OVERFLOW : This::STATUS_OKAY); } @@ -2163,9 +4098,10 @@ class AArch64_relocate_functions const AArch64_reloc_property* reloc_property) { Address sa = psymval->value(object, addend); - typename elfcpp::Swap::Valtype x = - This::Page(sa) - This::Page(address); - update_adr(view, x, reloc_property); + AArch64_valtype x = This::Page(sa) - This::Page(address); + // Pick [32:12] of X. + AArch64_valtype immed = (x >> 12) & 0x1fffff; + update_adr(view, immed); return (reloc_property->checkup_x_value(x) ? This::STATUS_OKAY : This::STATUS_OVERFLOW); @@ -2179,15 +4115,21 @@ class AArch64_relocate_functions static inline typename This::Status movnz(unsigned char* view, - typename elfcpp::Swap::Valtype x, + AArch64_valtype x, const AArch64_reloc_property* reloc_property) { // Select bits from X. - Address immed = reloc_property->select_x_value(x); - bool is_movz = true; - if (static_cast(x) < 0) + Address immed; + bool is_movz; + typedef typename elfcpp::Elf_types::Elf_Swxword SignedW; + if (static_cast(x) >= 0) + { + immed = reloc_property->select_x_value(x); + is_movz = true; + } + else { - immed = ~immed; + immed = reloc_property->select_x_value(~x);; is_movz = false; } @@ -2200,7 +4142,250 @@ class AArch64_relocate_functions : This::STATUS_OVERFLOW); } -}; // End of AArch64_relocate_functions + static inline bool + maybe_apply_stub(unsigned int, + const The_relocate_info*, + const The_rela&, + unsigned char*, + Address, + const Sized_symbol*, + const Symbol_value*, + const Sized_relobj_file*, + section_size_type); + +}; // End of AArch64_relocate_functions + + +// For a certain relocation type (usually jump/branch), test to see if the +// destination needs a stub to fulfil. If so, re-route the destination of the +// original instruction to the stub, note, at this time, the stub has already +// been generated. + +template +bool +AArch64_relocate_functions:: +maybe_apply_stub(unsigned int r_type, + const The_relocate_info* relinfo, + const The_rela& rela, + unsigned char* view, + Address address, + const Sized_symbol* gsym, + const Symbol_value* psymval, + const Sized_relobj_file* object, + section_size_type current_group_size) +{ + if (parameters->options().relocatable()) + return false; + + typename elfcpp::Elf_types::Elf_Swxword addend = rela.get_r_addend(); + Address branch_target = psymval->value(object, 0) + addend; + The_reloc_stub_type stub_type = The_reloc_stub:: + stub_type_for_reloc(r_type, address, branch_target); + if (stub_type == The_reloc_stub::ST_NONE) + return false; + + const The_aarch64_relobj* aarch64_relobj = + static_cast(object); + The_stub_table* stub_table = aarch64_relobj->stub_table(relinfo->data_shndx); + gold_assert(stub_table != NULL); + + unsigned int r_sym = elfcpp::elf_r_sym(rela.get_r_info()); + typename The_reloc_stub::Key stub_key(stub_type, gsym, object, r_sym, addend); + The_reloc_stub* stub = stub_table->find_reloc_stub(stub_key); + gold_assert(stub != NULL); + + Address new_branch_target = stub_table->address() + stub->offset(); + typename elfcpp::Swap::Valtype branch_offset = + new_branch_target - address; + const AArch64_reloc_property* arp = + aarch64_reloc_property_table->get_reloc_property(r_type); + gold_assert(arp != NULL); + typename This::Status status = This::template + rela_general<32>(view, branch_offset, 0, arp); + if (status != This::STATUS_OKAY) + gold_error(_("Stub is too far away, try a smaller value " + "for '--stub-group-size'. The current value is 0x%lx."), + static_cast(current_group_size)); + return true; +} + + +// Group input sections for stub generation. +// +// We group input sections in an output section so that the total size, +// including any padding space due to alignment is smaller than GROUP_SIZE +// unless the only input section in group is bigger than GROUP_SIZE already. +// Then an ARM stub table is created to follow the last input section +// in group. For each group an ARM stub table is created an is placed +// after the last group. If STUB_ALWAYS_AFTER_BRANCH is false, we further +// extend the group after the stub table. + +template +void +Target_aarch64::group_sections( + Layout* layout, + section_size_type group_size, + bool stubs_always_after_branch, + const Task* task) +{ + // Group input sections and insert stub table + Layout::Section_list section_list; + layout->get_executable_sections(§ion_list); + for (Layout::Section_list::const_iterator p = section_list.begin(); + p != section_list.end(); + ++p) + { + AArch64_output_section* output_section = + static_cast*>(*p); + output_section->group_sections(group_size, stubs_always_after_branch, + this, task); + } +} + + +// Find the AArch64_input_section object corresponding to the SHNDX-th input +// section of RELOBJ. + +template +AArch64_input_section* +Target_aarch64::find_aarch64_input_section( + Relobj* relobj, unsigned int shndx) const +{ + Section_id sid(relobj, shndx); + typename AArch64_input_section_map::const_iterator p = + this->aarch64_input_section_map_.find(sid); + return (p != this->aarch64_input_section_map_.end()) ? p->second : NULL; +} + + +// Make a new AArch64_input_section object. + +template +AArch64_input_section* +Target_aarch64::new_aarch64_input_section( + Relobj* relobj, unsigned int shndx) +{ + Section_id sid(relobj, shndx); + + AArch64_input_section* input_section = + new AArch64_input_section(relobj, shndx); + input_section->init(); + + // Register new AArch64_input_section in map for look-up. + std::pair ins = + this->aarch64_input_section_map_.insert( + std::make_pair(sid, input_section)); + + // Make sure that it we have not created another AArch64_input_section + // for this input section already. + gold_assert(ins.second); + + return input_section; +} + + +// Relaxation hook. This is where we do stub generation. + +template +bool +Target_aarch64::do_relax( + int pass, + const Input_objects* input_objects, + Symbol_table* symtab, + Layout* layout , + const Task* task) +{ + gold_assert(!parameters->options().relocatable()); + if (pass == 1) + { + // We don't handle negative stub_group_size right now. + this->stub_group_size_ = abs(parameters->options().stub_group_size()); + if (this->stub_group_size_ == 1) + { + // Leave room for 4096 4-byte stub entries. If we exceed that, then we + // will fail to link. The user will have to relink with an explicit + // group size option. + this->stub_group_size_ = The_reloc_stub::MAX_BRANCH_OFFSET - + 4096 * 4; + } + group_sections(layout, this->stub_group_size_, true, task); + } + else + { + // If this is not the first pass, addresses and file offsets have + // been reset at this point, set them here. + for (Stub_table_iterator sp = this->stub_tables_.begin(); + sp != this->stub_tables_.end(); ++sp) + { + The_stub_table* stt = *sp; + The_aarch64_input_section* owner = stt->owner(); + off_t off = align_address(owner->original_size(), + stt->addralign()); + stt->set_address_and_file_offset(owner->address() + off, + owner->offset() + off); + } + } + + // Scan relocs for relocation stubs + for (Input_objects::Relobj_iterator op = input_objects->relobj_begin(); + op != input_objects->relobj_end(); + ++op) + { + The_aarch64_relobj* aarch64_relobj = + static_cast(*op); + // Lock the object so we can read from it. This is only called + // single-threaded from Layout::finalize, so it is OK to lock. + Task_lock_obj tl(task, aarch64_relobj); + aarch64_relobj->scan_sections_for_stubs(this, symtab, layout); + } + + bool any_stub_table_changed = false; + for (Stub_table_iterator siter = this->stub_tables_.begin(); + siter != this->stub_tables_.end() && !any_stub_table_changed; ++siter) + { + The_stub_table* stub_table = *siter; + if (stub_table->update_data_size_changed_p()) + { + The_aarch64_input_section* owner = stub_table->owner(); + uint64_t address = owner->address(); + off_t offset = owner->offset(); + owner->reset_address_and_file_offset(); + owner->set_address_and_file_offset(address, offset); + + any_stub_table_changed = true; + } + } + + // Do not continue relaxation. + bool continue_relaxation = any_stub_table_changed; + if (!continue_relaxation) + for (Stub_table_iterator sp = this->stub_tables_.begin(); + (sp != this->stub_tables_.end()); + ++sp) + (*sp)->finalize_stubs(); + + return continue_relaxation; +} + + +// Make a new Stub_table. + +template +Stub_table* +Target_aarch64::new_stub_table( + AArch64_input_section* owner) +{ + Stub_table* stub_table = + new Stub_table(owner); + stub_table->set_address(align_address( + owner->address() + owner->data_size(), 8)); + stub_table->set_file_offset(owner->offset() + owner->data_size()); + stub_table->finalize_data_size(); + + this->stub_tables_.push_back(stub_table); + + return stub_table; +} template @@ -2357,6 +4542,15 @@ Target_aarch64::optimize_tls_reloc(bool is_final, return tls::TLSOPT_TO_LE; return tls::TLSOPT_TO_IE; + case elfcpp::R_AARCH64_TLSLD_ADR_PAGE21: + case elfcpp::R_AARCH64_TLSLD_ADD_LO12_NC: + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G1: + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: + // These are Local-Dynamic, which refer to local symbols in the + // dynamic TLS block. Since we know that we generating an + // executable, we can switch to Local-Exec. + return tls::TLSOPT_TO_LE; + case elfcpp::R_AARCH64_TLSIE_MOVW_GOTTPREL_G1: case elfcpp::R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: case elfcpp::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: @@ -2396,8 +4590,11 @@ Target_aarch64::Scan::possible_function_pointer_reloc( { switch (r_type) { - case elfcpp::R_AARCH64_ABS64: - //TODO + case elfcpp::R_AARCH64_ADR_PREL_PG_HI21: + case elfcpp::R_AARCH64_ADR_PREL_PG_HI21_NC: + case elfcpp::R_AARCH64_ADD_ABS_LO12_NC: + case elfcpp::R_AARCH64_ADR_GOT_PAGE: + case elfcpp::R_AARCH64_LD64_GOT_LO12_NC: { return true; } @@ -2422,9 +4619,7 @@ Target_aarch64::Scan::local_reloc_may_be_function_pointer( unsigned int r_type, const elfcpp::Sym&) { - // When building a shared library, do not fold any local symbols as it is - // not possible to distinguish pointer taken versus a call by looking at - // the relocation types. + // When building a shared library, do not fold any local symbols. return (parameters->options().shared() || possible_function_pointer_reloc(r_type)); } @@ -2510,6 +4705,29 @@ Target_aarch64::Scan::check_non_pic(Relobj* object, return; } +// Return whether we need to make a PLT entry for a relocation of the +// given type against a STT_GNU_IFUNC symbol. + +template +bool +Target_aarch64::Scan::reloc_needs_plt_for_ifunc( + Sized_relobj_file* object, + unsigned int r_type) +{ + const AArch64_reloc_property* arp = + aarch64_reloc_property_table->get_reloc_property(r_type); + gold_assert(arp != NULL); + + int flags = arp->reference_flags(); + if (flags & Symbol::TLS_REF) + { + gold_error(_("%s: unsupported TLS reloc %s for IFUNC symbol"), + object->name().c_str(), arp->name().c_str()); + return false; + } + return flags != 0; +} + // Scan a relocation for a local symbol. template @@ -2523,7 +4741,7 @@ Target_aarch64::Scan::local( Output_section* output_section, const elfcpp::Rela& rela, unsigned int r_type, - const elfcpp::Sym& /* lsym */, + const elfcpp::Sym& lsym, bool is_discarded) { if (is_discarded) @@ -2535,6 +4753,11 @@ Target_aarch64::Scan::local( target->got_section(symtab, layout); unsigned int r_sym = elfcpp::elf_r_sym(rela.get_r_info()); + // A local STT_GNU_IFUNC symbol may require a PLT entry. + bool is_ifunc = lsym.get_st_type() == elfcpp::STT_GNU_IFUNC; + if (is_ifunc && this->reloc_needs_plt_for_ifunc(object, r_type)) + target->make_local_ifunc_plt_entry(symtab, layout, object, r_sym); + switch (r_type) { case elfcpp::R_AARCH64_ABS32: @@ -2558,7 +4781,7 @@ Target_aarch64::Scan::local( data_shndx, rela.get_r_offset(), rela.get_r_addend(), - false /* is ifunc */); + is_ifunc); } break; @@ -2637,6 +4860,11 @@ Target_aarch64::Scan::local( } break; + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G2: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1_NC: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: @@ -2649,6 +4877,25 @@ Target_aarch64::Scan::local( } break; + case elfcpp::R_AARCH64_TLSLD_ADR_PAGE21: + case elfcpp::R_AARCH64_TLSLD_ADD_LO12_NC: + { + tls::Tls_optimization tlsopt = Target_aarch64:: + optimize_tls_reloc(!parameters->options().shared(), r_type); + if (tlsopt == tls::TLSOPT_NONE) + { + // Create a GOT entry for the module index. + target->got_mod_index_entry(symtab, layout, object); + } + else if (tlsopt != tls::TLSOPT_TO_LE) + unsupported_reloc_local(object, r_type); + } + break; + + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G1: + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: + break; + case elfcpp::R_AARCH64_TLSDESC_ADR_PAGE21: case elfcpp::R_AARCH64_TLSDESC_LD64_LO12: case elfcpp::R_AARCH64_TLSDESC_ADD_LO12: @@ -2725,6 +4972,11 @@ Target_aarch64::Scan::global( unsigned int r_type, Symbol* gsym) { + // A STT_GNU_IFUNC symbol may require a PLT entry. + if (gsym->type() == elfcpp::STT_GNU_IFUNC + && this->reloc_needs_plt_for_ifunc(object, r_type)) + target->make_plt_entry(symtab, layout, gsym); + typedef Output_data_reloc Reloc_section; const AArch64_reloc_property* arp = @@ -2757,6 +5009,25 @@ Target_aarch64::Scan::global( target->copy_reloc(symtab, layout, object, data_shndx, output_section, gsym, rela); } + else if (r_type == elfcpp::R_AARCH64_ABS64 + && gsym->type() == elfcpp::STT_GNU_IFUNC + && gsym->can_use_relative_reloc(false) + && !gsym->is_from_dynobj() + && !gsym->is_undefined() + && !gsym->is_preemptible()) + { + // Use an IRELATIVE reloc for a locally defined STT_GNU_IFUNC + // symbol. This makes a function address in a PIE executable + // match the address in a shared library that it links against. + Reloc_section* rela_dyn = + target->rela_irelative_section(layout); + unsigned int r_type = elfcpp::R_AARCH64_IRELATIVE; + rela_dyn->add_symbolless_global_addend(gsym, r_type, + output_section, object, + data_shndx, + rela.get_r_offset(), + rela.get_r_addend()); + } else if (r_type == elfcpp::R_AARCH64_ABS64 && gsym->can_use_relative_reloc(false)) { @@ -2829,21 +5100,54 @@ Target_aarch64::Scan::global( target->got_section(symtab, layout); if (gsym->final_value_is_known()) { - got->add_global(gsym, GOT_TYPE_STANDARD); + // For a STT_GNU_IFUNC symbol we want the PLT address. + if (gsym->type() == elfcpp::STT_GNU_IFUNC) + got->add_global_plt(gsym, GOT_TYPE_STANDARD); + else + got->add_global(gsym, GOT_TYPE_STANDARD); } else { + // If this symbol is not fully resolved, we need to add a dynamic + // relocation for it. Reloc_section* rela_dyn = target->rela_dyn_section(layout); + + // Use a GLOB_DAT rather than a RELATIVE reloc if: + // + // 1) The symbol may be defined in some other module. + // 2) We are building a shared library and this is a protected + // symbol; using GLOB_DAT means that the dynamic linker can use + // the address of the PLT in the main executable when appropriate + // so that function address comparisons work. + // 3) This is a STT_GNU_IFUNC symbol in position dependent code, + // again so that function address comparisons work. if (gsym->is_from_dynobj() || gsym->is_undefined() || gsym->is_preemptible() || (gsym->visibility() == elfcpp::STV_PROTECTED - && parameters->options().shared())) + && parameters->options().shared()) + || (gsym->type() == elfcpp::STT_GNU_IFUNC + && parameters->options().output_is_position_independent())) got->add_global_with_rel(gsym, GOT_TYPE_STANDARD, rela_dyn, elfcpp::R_AARCH64_GLOB_DAT); else { - if (got->add_global(gsym, GOT_TYPE_STANDARD)) + // For a STT_GNU_IFUNC symbol we want to write the PLT + // offset into the GOT, so that function pointer + // comparisons work correctly. + bool is_new; + if (gsym->type() != elfcpp::STT_GNU_IFUNC) + is_new = got->add_global(gsym, GOT_TYPE_STANDARD); + else + { + is_new = got->add_global_plt(gsym, GOT_TYPE_STANDARD); + // Tell the dynamic linker to use the PLT address + // when resolving relocations. + if (gsym->is_from_dynobj() + && !parameters->options().shared()) + gsym->set_needs_dynsym_value(); + } + if (is_new) { rela_dyn->add_global_relative( gsym, elfcpp::R_AARCH64_RELATIVE, @@ -2898,10 +5202,29 @@ Target_aarch64::Scan::global( } break; + case elfcpp::R_AARCH64_TLSLD_ADR_PAGE21: + case elfcpp::R_AARCH64_TLSLD_ADD_LO12_NC: // Local dynamic + { + tls::Tls_optimization tlsopt = Target_aarch64:: + optimize_tls_reloc(!parameters->options().shared(), r_type); + if (tlsopt == tls::TLSOPT_NONE) + { + // Create a GOT entry for the module index. + target->got_mod_index_entry(symtab, layout, object); + } + else if (tlsopt != tls::TLSOPT_TO_LE) + unsupported_reloc_local(object, r_type); + } + break; + + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G1: + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: // Other local dynamic + break; + case elfcpp::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: case elfcpp::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: // Initial executable { - tls::Tls_optimization tlsopt =Target_aarch64:: + tls::Tls_optimization tlsopt = Target_aarch64:: optimize_tls_reloc(gsym->final_value_is_known(), r_type); if (tlsopt == tls::TLSOPT_TO_LE) break; @@ -2930,6 +5253,11 @@ Target_aarch64::Scan::global( } break; + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G2: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1_NC: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: // Local executable @@ -3037,7 +5365,26 @@ Target_aarch64::make_plt_entry( if (this->plt_ == NULL) this->make_plt_section(symtab, layout); - this->plt_->add_entry(gsym); + this->plt_->add_entry(symtab, layout, gsym); +} + +// Make a PLT entry for a local STT_GNU_IFUNC symbol. + +template +void +Target_aarch64::make_local_ifunc_plt_entry( + Symbol_table* symtab, Layout* layout, + Sized_relobj_file* relobj, + unsigned int local_sym_index) +{ + if (relobj->local_has_plt_offset(local_sym_index)) + return; + if (this->plt_ == NULL) + this->make_plt_section(symtab, layout); + unsigned int plt_offset = this->plt_->add_local_ifunc_entry(symtab, layout, + relobj, + local_sym_index); + relobj->set_local_plt_offset(local_sym_index, plt_offset); } template @@ -3121,14 +5468,15 @@ Target_aarch64::scan_relocs( // pointers across shared library boundaries, as described in the // processor specific ABI supplement. -template +template uint64_t -Target_aarch64::do_dynsym_value(const Symbol* gsym) const +Target_aarch64::do_dynsym_value(const Symbol* gsym) const { gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset()); return this->plt_address_for_global(gsym); } + // Finalize the sections. template @@ -3352,14 +5700,27 @@ Target_aarch64::Relocate::relocate( case elfcpp::R_AARCH64_PREL64: reloc_status = Reloc::template pcrela_ua<64>( view, object, psymval, addend, address, reloc_property); + break; case elfcpp::R_AARCH64_PREL32: reloc_status = Reloc::template pcrela_ua<32>( view, object, psymval, addend, address, reloc_property); + break; case elfcpp::R_AARCH64_PREL16: reloc_status = Reloc::template pcrela_ua<16>( view, object, psymval, addend, address, reloc_property); + break; + + case elfcpp::R_AARCH64_LD_PREL_LO19: + reloc_status = Reloc::template pcrela_general<32>( + view, object, psymval, addend, address, reloc_property); + break; + + case elfcpp::R_AARCH64_ADR_PREL_LO21: + reloc_status = Reloc::adr(view, object, psymval, addend, + address, reloc_property); + break; case elfcpp::R_AARCH64_ADR_PREL_PG_HI21_NC: case elfcpp::R_AARCH64_ADR_PREL_PG_HI21: @@ -3391,10 +5752,15 @@ Target_aarch64::Relocate::relocate( // Return false to stop further processing this reloc. return false; } - // Continue. + // Fallthrough + case elfcpp::R_AARCH64_JUMP26: + if (Reloc::maybe_apply_stub(r_type, relinfo, rela, view, address, + gsym, psymval, object, + target->stub_group_size_)) + break; + // Fallthrough case elfcpp::R_AARCH64_TSTBR14: case elfcpp::R_AARCH64_CONDBR19: - case elfcpp::R_AARCH64_JUMP26: reloc_status = Reloc::template pcrela_general<32>( view, object, psymval, addend, address, reloc_property); break; @@ -3414,8 +5780,17 @@ Target_aarch64::Relocate::relocate( case elfcpp::R_AARCH64_TLSGD_ADR_PAGE21: case elfcpp::R_AARCH64_TLSGD_ADD_LO12_NC: + case elfcpp::R_AARCH64_TLSLD_ADR_PAGE21: + case elfcpp::R_AARCH64_TLSLD_ADD_LO12_NC: + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G1: + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: case elfcpp::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: case elfcpp::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G2: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1_NC: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: @@ -3477,9 +5852,9 @@ Target_aarch64::Relocate::relocate( template inline -typename AArch64_relocate_functions::Status +typename AArch64_relocate_functions::Status Target_aarch64::Relocate::relocate_tls( - const Relocate_info* relinfo, + const Relocate_info* relinfo, Target_aarch64* target, size_t relnum, const elfcpp::Rela& rela, @@ -3488,7 +5863,7 @@ Target_aarch64::Relocate::relocate_tls( unsigned char* view, typename elfcpp::Elf_types::Elf_Addr address) { - typedef AArch64_relocate_functions aarch64_reloc_funcs; + typedef AArch64_relocate_functions aarch64_reloc_funcs; typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; Output_segment* tls_segment = relinfo->layout->tls_segment(); @@ -3503,7 +5878,7 @@ Target_aarch64::Relocate::relocate_tls( tls::Tls_optimization tlsopt = Target_aarch64:: optimize_tls_reloc(is_final, r_type); - Sized_relobj_file* object = relinfo->object; + Sized_relobj_file* object = relinfo->object; int tls_got_offset_type; switch (r_type) { @@ -3556,7 +5931,7 @@ Target_aarch64::Relocate::relocate_tls( break; default: - gold_assert(false); + gold_unreachable(); } } gold_error_at_location(relinfo, relnum, rela.get_r_offset(), @@ -3565,6 +5940,81 @@ Target_aarch64::Relocate::relocate_tls( } break; + case elfcpp::R_AARCH64_TLSLD_ADR_PAGE21: + case elfcpp::R_AARCH64_TLSLD_ADD_LO12_NC: // Local-dynamic + { + if (tlsopt == tls::TLSOPT_TO_LE) + { + if (tls_segment == NULL) + { + gold_assert(parameters->errors()->error_count() > 0 + || issue_undefined_symbol_error(gsym)); + return aarch64_reloc_funcs::STATUS_BAD_RELOC; + } + return this->tls_ld_to_le(relinfo, target, rela, r_type, view, + psymval); + } + + gold_assert(tlsopt == tls::TLSOPT_NONE); + // Relocate the field with the offset of the GOT entry for + // the module index. + typename elfcpp::Elf_types::Elf_Addr got_entry_address; + got_entry_address = (target->got_mod_index_entry(NULL, NULL, NULL) + + target->got_->address()); + + switch (r_type) + { + case elfcpp::R_AARCH64_TLSLD_ADR_PAGE21: + return aarch64_reloc_funcs::adrp( + view, got_entry_address + addend, address); + break; + + case elfcpp::R_AARCH64_TLSLD_ADD_LO12_NC: + return aarch64_reloc_funcs::template rela_general<32>( + view, got_entry_address, addend, reloc_property); + break; + + default: + gold_unreachable(); + } + } + break; + + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G1: + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: // Other local-dynamic + { + AArch64_address value = psymval->value(object, 0); + if (tlsopt == tls::TLSOPT_TO_LE) + { + if (tls_segment == NULL) + { + gold_assert(parameters->errors()->error_count() > 0 + || issue_undefined_symbol_error(gsym)); + return aarch64_reloc_funcs::STATUS_BAD_RELOC; + } + // If building executable, _TLS_MODULE_BASE_ points to segment + // end. Thus we must subtract it from value. + value -= tls_segment->memsz(); + } + switch (r_type) + { + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G1: + return aarch64_reloc_funcs::movnz(view, value + addend, + reloc_property); + break; + + case elfcpp::R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: + return aarch64_reloc_funcs::template rela_general<32>( + view, value, addend, reloc_property); + break; + + default: + gold_unreachable(); + } + // We should never reach here. + } + break; + case elfcpp::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: case elfcpp::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: // Initial-exec { @@ -3608,12 +6058,17 @@ Target_aarch64::Relocate::relocate_tls( return aarch64_reloc_funcs::template rela_general<32>( view, got_entry_address, addend, reloc_property); default: - gold_assert(false); + gold_unreachable(); } } // We shall never reach here. break; + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G2: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1_NC: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12: case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: @@ -3626,11 +6081,21 @@ Target_aarch64::Relocate::relocate_tls( AArch64_address aligned_tcb_size = align_address(target->tcb_size(), tls_segment->maximum_alignment()); - return aarch64_reloc_funcs::template - rela_general<32>(view, - value + aligned_tcb_size, - addend, - reloc_property); + value += aligned_tcb_size; + switch (r_type) + { + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G2: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G1: + case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0: + return aarch64_reloc_funcs::movnz(view, value + addend, + reloc_property); + default: + return aarch64_reloc_funcs::template + rela_general<32>(view, + value, + addend, + reloc_property); + } } else gold_error(_("%s: unsupported reloc %u " @@ -3733,16 +6198,16 @@ Target_aarch64::Relocate::relocate_tls( template inline -typename AArch64_relocate_functions::Status +typename AArch64_relocate_functions::Status Target_aarch64::Relocate::tls_gd_to_le( - const Relocate_info* relinfo, + const Relocate_info* relinfo, Target_aarch64* target, const elfcpp::Rela& rela, unsigned int r_type, unsigned char* view, const Symbol_value* psymval) { - typedef AArch64_relocate_functions aarch64_reloc_funcs; + typedef AArch64_relocate_functions aarch64_reloc_funcs; typedef typename elfcpp::Swap<32, big_endian>::Valtype Insntype; typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; @@ -3833,9 +6298,109 @@ Target_aarch64::Relocate::tls_gd_to_le( template inline -typename AArch64_relocate_functions::Status +typename AArch64_relocate_functions::Status +Target_aarch64::Relocate::tls_ld_to_le( + const Relocate_info* relinfo, + Target_aarch64* target, + const elfcpp::Rela& rela, + unsigned int r_type, + unsigned char* view, + const Symbol_value* psymval) +{ + typedef AArch64_relocate_functions aarch64_reloc_funcs; + typedef typename elfcpp::Swap<32, big_endian>::Valtype Insntype; + typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; + + Insntype* ip = reinterpret_cast(view); + Insntype insn1 = elfcpp::Swap<32, big_endian>::readval(ip); + Insntype insn2 = elfcpp::Swap<32, big_endian>::readval(ip + 1); + Insntype insn3 = elfcpp::Swap<32, big_endian>::readval(ip + 2); + + if (r_type == elfcpp::R_AARCH64_TLSLD_ADD_LO12_NC) + { + // This is the 2nd relocs, optimization should already have been + // done. + gold_assert((insn1 & 0xfff00000) == 0x91400000); + return aarch64_reloc_funcs::STATUS_OKAY; + } + + // The original sequence is - + // 90000000 adrp x0, 0
+ // 91000000 add x0, x0, #0x0 + // 94000000 bl 0 <__tls_get_addr> + // optimized to sequence - + // d53bd040 mrs x0, tpidr_el0 + // 91400000 add x0, x0, #0x0, lsl #12 + // 91000000 add x0, x0, #0x0 + + // Unlike tls_ie_to_le, we change the 3 insns in one function call when we + // encounter the first relocation "R_AARCH64_TLSLD_ADR_PAGE21". Because we + // have to change "bl tls_get_addr", which does not have a corresponding tls + // relocation type. So before proceeding, we need to make sure compiler + // does not change the sequence. + if(!(insn1 == 0x90000000 // adrp x0,0 + && insn2 == 0x91000000 // add x0, x0, #0x0 + && insn3 == 0x94000000)) // bl 0 + { + // Ideally we should give up gd_to_le relaxation and do gd access. + // However the gd_to_le relaxation decision has been made early + // in the scan stage, where we did not allocate any GOT entry for + // this symbol. Therefore we have to exit and report error now. + gold_error(_("unexpected reloc insn sequence while relaxing " + "tls gd to le for reloc %u."), r_type); + return aarch64_reloc_funcs::STATUS_BAD_RELOC; + } + + // Write new insns. + insn1 = 0xd53bd040; // mrs x0, tpidr_el0 + insn2 = 0x91400000; // add x0, x0, #0x0, lsl #12 + insn3 = 0x91000000; // add x0, x0, #0x0 + elfcpp::Swap<32, big_endian>::writeval(ip, insn1); + elfcpp::Swap<32, big_endian>::writeval(ip + 1, insn2); + elfcpp::Swap<32, big_endian>::writeval(ip + 2, insn3); + + // Calculate tprel value. + Output_segment* tls_segment = relinfo->layout->tls_segment(); + gold_assert(tls_segment != NULL); + AArch64_address value = psymval->value(relinfo->object, 0); + const elfcpp::Elf_Xword addend = rela.get_r_addend(); + AArch64_address aligned_tcb_size = + align_address(target->tcb_size(), tls_segment->maximum_alignment()); + AArch64_address x = value + aligned_tcb_size; + + // After new insns are written, apply TLSLE relocs. + const AArch64_reloc_property* rp1 = + aarch64_reloc_property_table->get_reloc_property( + elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12); + const AArch64_reloc_property* rp2 = + aarch64_reloc_property_table->get_reloc_property( + elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12); + gold_assert(rp1 != NULL && rp2 != NULL); + + typename aarch64_reloc_funcs::Status s1 = + aarch64_reloc_funcs::template rela_general<32>(view + 4, + x, + addend, + rp1); + if (s1 != aarch64_reloc_funcs::STATUS_OKAY) + return s1; + + typename aarch64_reloc_funcs::Status s2 = + aarch64_reloc_funcs::template rela_general<32>(view + 8, + x, + addend, + rp2); + + this->skip_call_tls_get_addr_ = true; + return s2; + +} // End of tls_ld_to_le + +template +inline +typename AArch64_relocate_functions::Status Target_aarch64::Relocate::tls_ie_to_le( - const Relocate_info* relinfo, + const Relocate_info* relinfo, Target_aarch64* target, const elfcpp::Rela& rela, unsigned int r_type, @@ -3844,7 +6409,7 @@ Target_aarch64::Relocate::tls_ie_to_le( { typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; typedef typename elfcpp::Swap<32, big_endian>::Valtype Insntype; - typedef AArch64_relocate_functions aarch64_reloc_funcs; + typedef AArch64_relocate_functions aarch64_reloc_funcs; AArch64_address value = psymval->value(relinfo->object, 0); Output_segment* tls_segment = relinfo->layout->tls_segment(); @@ -3879,7 +6444,7 @@ Target_aarch64::Relocate::tls_ie_to_le( newinsn = (0xf2800000 | regno) | ((x & 0xffff) << 5); } else - gold_assert(false); + gold_unreachable(); elfcpp::Swap<32, big_endian>::writeval(ip, newinsn); return aarch64_reloc_funcs::STATUS_OKAY; @@ -3888,9 +6453,9 @@ Target_aarch64::Relocate::tls_ie_to_le( template inline -typename AArch64_relocate_functions::Status +typename AArch64_relocate_functions::Status Target_aarch64::Relocate::tls_desc_gd_to_le( - const Relocate_info* relinfo, + const Relocate_info* relinfo, Target_aarch64* target, const elfcpp::Rela& rela, unsigned int r_type, @@ -3899,7 +6464,7 @@ Target_aarch64::Relocate::tls_desc_gd_to_le( { typedef typename elfcpp::Elf_types::Elf_Addr AArch64_address; typedef typename elfcpp::Swap<32, big_endian>::Valtype Insntype; - typedef AArch64_relocate_functions aarch64_reloc_funcs; + typedef AArch64_relocate_functions aarch64_reloc_funcs; // TLSDESC-GD sequence is like: // adrp x0, :tlsdesc:v1 @@ -3961,9 +6526,9 @@ Target_aarch64::Relocate::tls_desc_gd_to_le( template inline -typename AArch64_relocate_functions::Status +typename AArch64_relocate_functions::Status Target_aarch64::Relocate::tls_desc_gd_to_ie( - const Relocate_info* /* relinfo */, + const Relocate_info* /* relinfo */, Target_aarch64* /* target */, const elfcpp::Rela& rela, unsigned int r_type, @@ -3973,7 +6538,7 @@ Target_aarch64::Relocate::tls_desc_gd_to_ie( typename elfcpp::Elf_types::Elf_Addr address) { typedef typename elfcpp::Swap<32, big_endian>::Valtype Insntype; - typedef AArch64_relocate_functions aarch64_reloc_funcs; + typedef AArch64_relocate_functions aarch64_reloc_funcs; // TLSDESC-GD sequence is like: // adrp x0, :tlsdesc:v1 @@ -4008,6 +6573,11 @@ Target_aarch64::Relocate::tls_desc_gd_to_ie( case elfcpp::R_AARCH64_TLSDESC_LD64_LO12: { + // Set ldr target register to be x0. + Insntype insn = elfcpp::Swap<32, big_endian>::readval(ip); + insn &= 0xffffffe0; + elfcpp::Swap<32, big_endian>::writeval(ip, insn); + // Do relocation. const AArch64_reloc_property* reloc_property = aarch64_reloc_property_table->get_reloc_property( elfcpp::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC); @@ -4143,6 +6713,7 @@ Target_aarch64::relocate_relocs( reloc_view_size); } + // The selector for aarch64 object files. template diff --git a/binutils-2.25/gold/archive.cc b/binutils-2.25/gold/archive.cc index 23cb0be3..6d259803 100644 --- a/binutils-2.25/gold/archive.cc +++ b/binutils-2.25/gold/archive.cc @@ -1,6 +1,6 @@ // archive.cc -- archive support for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -930,6 +930,32 @@ Archive::count_members() return ret; } +// RAII class to ensure we unlock the object if it's a member of a +// thin archive. We can't use Task_lock_obj in Archive::include_member +// because the object file is already locked when it's opened by +// get_elf_object_for_member. + +class Thin_archive_object_unlocker +{ + public: + Thin_archive_object_unlocker(const Task *task, Object* obj) + : task_(task), obj_(obj) + { } + + ~Thin_archive_object_unlocker() + { + if (this->obj_->offset() == 0) + this->obj_->unlock(this->task_); + } + + private: + Thin_archive_object_unlocker(const Thin_archive_object_unlocker&); + Thin_archive_object_unlocker& operator=(const Thin_archive_object_unlocker&); + + const Task* task_; + Object* obj_; +}; + // Include an archive member in the link. OFF is the file offset of // the member header. WHY is the reason we are including this member. // Return true if we added the member or if we had an error, return @@ -978,6 +1004,10 @@ Archive::include_member(Symbol_table* symtab, Layout* layout, return unconfigured ? false : true; } + // If the object is an external member of a thin archive, + // unlock it when we're done here. + Thin_archive_object_unlocker unlocker(this->task_, obj); + if (mapfile != NULL) mapfile->report_include_archive_member(obj->name(), sym, why); @@ -991,31 +1021,21 @@ Archive::include_member(Symbol_table* symtab, Layout* layout, if (!input_objects->add_object(obj)) { - // If this is an external member of a thin archive, unlock the - // file. - if (obj->offset() == 0) - obj->unlock(this->task_); delete obj; + return true; } - else - { - { - if (layout->incremental_inputs() != NULL) - layout->incremental_inputs()->report_object(obj, 0, this, NULL); - Read_symbols_data sd; - obj->read_symbols(&sd); - obj->layout(symtab, layout, &sd); - obj->add_symbols(symtab, &sd, layout); - } - - // If this is an external member of a thin archive, unlock the file - // for the next task. - if (obj->offset() == 0) - obj->unlock(this->task_); - this->included_member_ = true; - } + if (layout->incremental_inputs() != NULL) + layout->incremental_inputs()->report_object(obj, 0, this, NULL); + + { + Read_symbols_data sd; + obj->read_symbols(&sd); + obj->layout(symtab, layout, &sd); + obj->add_symbols(symtab, &sd, layout); + } + this->included_member_ = true; return true; } diff --git a/binutils-2.25/gold/archive.h b/binutils-2.25/gold/archive.h index e0315593..18cd899e 100644 --- a/binutils-2.25/gold/archive.h +++ b/binutils-2.25/gold/archive.h @@ -1,6 +1,6 @@ // archive.h -- archive support for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/arm-reloc-property.cc b/binutils-2.25/gold/arm-reloc-property.cc index dfc2fe11..33ac9ce7 100644 --- a/binutils-2.25/gold/arm-reloc-property.cc +++ b/binutils-2.25/gold/arm-reloc-property.cc @@ -1,6 +1,6 @@ // arm-reloc-property.cc -- ARM relocation property. -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/arm-reloc-property.h b/binutils-2.25/gold/arm-reloc-property.h index d98f6446..145755ad 100644 --- a/binutils-2.25/gold/arm-reloc-property.h +++ b/binutils-2.25/gold/arm-reloc-property.h @@ -1,6 +1,6 @@ // arm-reloc-property.h -- ARM relocation properties -*- C++ -*- -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/arm-reloc.def b/binutils-2.25/gold/arm-reloc.def index 9bccdfac..04105ecf 100644 --- a/binutils-2.25/gold/arm-reloc.def +++ b/binutils-2.25/gold/arm-reloc.def @@ -1,6 +1,6 @@ // arm-reloc.def -- ARM relocation definitions. -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/arm.cc b/binutils-2.25/gold/arm.cc index 6c472bb4..f1d4fe93 100644 --- a/binutils-2.25/gold/arm.cc +++ b/binutils-2.25/gold/arm.cc @@ -1,6 +1,6 @@ // arm.cc -- arm target support for gold. -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Doug Kwan based on the i386 code // by Ian Lance Taylor . // This file also contains borrowed and adapted code from @@ -2119,8 +2119,8 @@ class Target_arm : public Sized_target<32, big_endian> Target_arm(const Target::Target_info* info = &arm_info) : Sized_target<32, big_endian>(info), - got_(NULL), plt_(NULL), got_plt_(NULL), rel_dyn_(NULL), - copy_relocs_(elfcpp::R_ARM_COPY), + got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL), + rel_dyn_(NULL), rel_irelative_(NULL), copy_relocs_(elfcpp::R_ARM_COPY), got_mod_index_offset_(-1U), tls_base_symbol_defined_(false), stub_tables_(), stub_factory_(Stub_factory::get_instance()), should_force_pic_veneer_(false), @@ -2258,6 +2258,18 @@ class Target_arm : public Sized_target<32, big_endian> uint64_t do_dynsym_value(const Symbol*) const; + // Return the plt address for globals. Since we have irelative plt entries, + // address calculation is not as straightforward as plt_address + plt_offset. + uint64_t + do_plt_address_for_global(const Symbol* gsym) const + { return this->plt_section()->address_for_global(gsym); } + + // Return the plt address for locals. Since we have irelative plt entries, + // address calculation is not as straightforward as plt_address + plt_offset. + uint64_t + do_plt_address_for_local(const Relobj* relobj, unsigned int symndx) const + { return this->plt_section()->address_for_local(relobj, symndx); } + // Relocate a section. void relocate_section(const Relocate_info<32, big_endian>*, @@ -2357,6 +2369,10 @@ class Target_arm : public Sized_target<32, big_endian> unsigned int plt_entry_size() const; + // Get the section to use for IRELATIVE relocations, create it if necessary. + Reloc_section* + rel_irelative_section(Layout*); + // Map platform-specific reloc types static unsigned int get_real_reloc_type(unsigned int r_type); @@ -2448,8 +2464,11 @@ class Target_arm : public Sized_target<32, big_endian> protected: // Make the PLT-generator object. Output_data_plt_arm* - make_data_plt(Layout* layout, Output_data_space* got_plt) - { return this->do_make_data_plt(layout, got_plt); } + make_data_plt(Layout* layout, + Arm_output_data_got* got, + Output_data_space* got_plt, + Output_data_space* got_irelative) + { return this->do_make_data_plt(layout, got, got_plt, got_irelative); } // Make an ELF object. Object* @@ -2530,9 +2549,14 @@ class Target_arm : public Sized_target<32, big_endian> do_define_standard_symbols(Symbol_table*, Layout*); virtual Output_data_plt_arm* - do_make_data_plt(Layout* layout, Output_data_space* got_plt) + do_make_data_plt(Layout* layout, + Arm_output_data_got* got, + Output_data_space* got_plt, + Output_data_space* got_irelative) { - return new Output_data_plt_arm_standard(layout, got_plt); + gold_assert(got_plt != NULL && got_irelative != NULL); + return new Output_data_plt_arm_standard( + layout, got, got_plt, got_irelative); } private: @@ -2602,6 +2626,9 @@ class Target_arm : public Sized_target<32, big_endian> if (sym->is_undefined() && !parameters->options().shared()) return false; + if (sym->type() == elfcpp::STT_GNU_IFUNC) + return true; + return (!parameters->doing_static_link() && (sym->type() == elfcpp::STT_FUNC || sym->type() == elfcpp::STT_ARM_TFUNC) @@ -2613,6 +2640,11 @@ class Target_arm : public Sized_target<32, big_endian> inline bool possible_function_pointer_reloc(unsigned int r_type); + // Whether a plt entry is needed for ifunc. + bool + reloc_needs_plt_for_ifunc(Sized_relobj_file<32, big_endian>*, + unsigned int r_type); + // Whether we have issued an error about a non-PIC compilation. bool issued_non_pic_error_; }; @@ -2718,10 +2750,20 @@ class Target_arm : public Sized_target<32, big_endian> return this->got_plt_; } + // Create the PLT section. + void + make_plt_section(Symbol_table* symtab, Layout* layout); + // Create a PLT entry for a global symbol. void make_plt_entry(Symbol_table*, Layout*, Symbol*); + // Create a PLT entry for a local STT_GNU_IFUNC symbol. + void + make_local_ifunc_plt_entry(Symbol_table*, Layout*, + Sized_relobj_file<32, big_endian>* relobj, + unsigned int local_sym_index); + // Define the _TLS_MODULE_BASE_ symbol in the TLS segment. void define_tls_base_symbol(Symbol_table*, Layout*); @@ -2903,8 +2945,12 @@ class Target_arm : public Sized_target<32, big_endian> Output_data_plt_arm* plt_; // The GOT PLT section. Output_data_space* got_plt_; + // The GOT section for IRELATIVE relocations. + Output_data_space* got_irelative_; // The dynamic reloc section. Reloc_section* rel_dyn_; + // The section to use for IRELATIVE relocs. + Reloc_section* rel_irelative_; // Relocs saved to avoid a COPY reloc. Copy_relocs copy_relocs_; // Offset of the GOT entry for the TLS module index. @@ -4244,6 +4290,15 @@ Target_arm::got_section(Symbol_table* symtab, Layout* layout) elfcpp::STB_LOCAL, elfcpp::STV_HIDDEN, 0, false, false); + + // If there are any IRELATIVE relocations, they get GOT entries + // in .got.plt after the jump slot entries. + this->got_irelative_ = new Output_data_space(4, "** GOT IRELATIVE PLT"); + layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS, + (elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE), + this->got_irelative_, + got_order, is_got_relro); + } return this->got_; } @@ -4257,14 +4312,43 @@ Target_arm::rel_dyn_section(Layout* layout) if (this->rel_dyn_ == NULL) { gold_assert(layout != NULL); + // Create both relocation sections in the same place, so as to ensure + // their relative order in the output section. this->rel_dyn_ = new Reloc_section(parameters->options().combreloc()); + this->rel_irelative_ = new Reloc_section(false); layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL, elfcpp::SHF_ALLOC, this->rel_dyn_, ORDER_DYNAMIC_RELOCS, false); + layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL, + elfcpp::SHF_ALLOC, this->rel_irelative_, + ORDER_DYNAMIC_RELOCS, false); } return this->rel_dyn_; } + +// Get the section to use for IRELATIVE relocs, creating it if necessary. These +// go in .rela.dyn, but only after all other dynamic relocations. They need to +// follow the other dynamic relocations so that they can refer to global +// variables initialized by those relocs. + +template +typename Target_arm::Reloc_section* +Target_arm::rel_irelative_section(Layout* layout) +{ + if (this->rel_irelative_ == NULL) + { + // Delegate the creation to rel_dyn_section so as to ensure their order in + // the output section. + this->rel_dyn_section(layout); + gold_assert(this->rel_irelative_ != NULL + && (this->rel_dyn_->output_section() + == this->rel_irelative_->output_section())); + } + return this->rel_irelative_; +} + + // Insn_template methods. // Return byte size of an instruction template. @@ -7221,24 +7305,80 @@ template class Output_data_plt_arm : public Output_section_data { public: + // Unlike aarch64, which records symbol value in "addend" field of relocations + // and could be done at the same time an IRelative reloc is created for the + // symbol, arm puts the symbol value into "GOT" table, which, however, is + // issued later in Output_data_plt_arm::do_write(). So we have a struct here + // to keep necessary symbol information for later use in do_write. We usually + // have only a very limited number of ifuncs, so the extra data required here + // is also limited. + + struct IRelative_data + { + IRelative_data(Sized_symbol<32>* sized_symbol) + : symbol_is_global_(true) + { + u_.global = sized_symbol; + } + + IRelative_data(Sized_relobj_file<32, big_endian>* relobj, + unsigned int index) + : symbol_is_global_(false) + { + u_.local.relobj = relobj; + u_.local.index = index; + } + + union + { + Sized_symbol<32>* global; + + struct + { + Sized_relobj_file<32, big_endian>* relobj; + unsigned int index; + } local; + } u_; + + bool symbol_is_global_; + }; + typedef Output_data_reloc Reloc_section; - Output_data_plt_arm(Layout*, uint64_t addralign, Output_data_space*); + Output_data_plt_arm(Layout* layout, uint64_t addralign, + Arm_output_data_got* got, + Output_data_space* got_plt, + Output_data_space* got_irelative); // Add an entry to the PLT. void - add_entry(Symbol* gsym); + add_entry(Symbol_table* symtab, Layout* layout, Symbol* gsym); + + // Add the relocation for a plt entry. + void + add_relocation(Symbol_table* symtab, Layout* layout, + Symbol* gsym, unsigned int got_offset); + + // Add an entry to the PLT for a local STT_GNU_IFUNC symbol. + unsigned int + add_local_ifunc_entry(Symbol_table* symtab, Layout*, + Sized_relobj_file<32, big_endian>* relobj, + unsigned int local_sym_index); // Return the .rel.plt section data. const Reloc_section* rel_plt() const { return this->rel_; } + // Return the PLT relocation container for IRELATIVE. + Reloc_section* + rel_irelative(Symbol_table*, Layout*); + // Return the number of PLT entries. unsigned int entry_count() const - { return this->count_; } + { return this->count_ + this->irelative_count_; } // Return the offset of the first non-reserved PLT entry. unsigned int @@ -7250,6 +7390,14 @@ class Output_data_plt_arm : public Output_section_data get_plt_entry_size() const { return this->do_get_plt_entry_size(); } + // Return the PLT address for globals. + uint32_t + address_for_global(const Symbol*) const; + + // Return the PLT address for locals. + uint32_t + address_for_local(const Relobj*, unsigned int symndx) const; + protected: // Fill in the first PLT entry. void @@ -7298,19 +7446,37 @@ class Output_data_plt_arm : public Output_section_data set_final_data_size() { this->set_data_size(this->first_plt_entry_offset() - + this->count_ * this->get_plt_entry_size()); + + ((this->count_ + this->irelative_count_) + * this->get_plt_entry_size())); } // Write out the PLT data. void do_write(Output_file*); + // Record irelative symbol data. + void insert_irelative_data(const IRelative_data& idata) + { irelative_data_vec_.push_back(idata); } + // The reloc section. Reloc_section* rel_; + // The IRELATIVE relocs, if necessary. These must follow the + // regular PLT relocations. + Reloc_section* irelative_rel_; + // The .got section. + Arm_output_data_got* got_; // The .got.plt section. Output_data_space* got_plt_; + // The part of the .got.plt section used for IRELATIVE relocs. + Output_data_space* got_irelative_; // The number of PLT entries. unsigned int count_; + // Number of PLT entries with R_ARM_IRELATIVE relocs. These + // follow the regular PLT entries. + unsigned int irelative_count_; + // Vector for irelative data. + typedef std::vector IRelative_data_vec; + IRelative_data_vec irelative_data_vec_; }; // Create the PLT section. The ordinary .got section is an argument, @@ -7318,10 +7484,14 @@ class Output_data_plt_arm : public Output_section_data // section just for PLT entries. template -Output_data_plt_arm::Output_data_plt_arm(Layout* layout, - uint64_t addralign, - Output_data_space* got_plt) - : Output_section_data(addralign), got_plt_(got_plt), count_(0) +Output_data_plt_arm::Output_data_plt_arm( + Layout* layout, uint64_t addralign, + Arm_output_data_got* got, + Output_data_space* got_plt, + Output_data_space* got_irelative) + : Output_section_data(addralign), irelative_rel_(NULL), + got_(got), got_plt_(got_plt), got_irelative_(got_irelative), + count_(0), irelative_count_(0) { this->rel_ = new Reloc_section(false); layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL, @@ -7340,40 +7510,210 @@ Output_data_plt_arm::do_adjust_output_section(Output_section* os) template void -Output_data_plt_arm::add_entry(Symbol* gsym) +Output_data_plt_arm::add_entry(Symbol_table* symtab, + Layout* layout, + Symbol* gsym) { gold_assert(!gsym->has_plt_offset()); - // Note that when setting the PLT offset we skip the initial - // reserved PLT entry. - gsym->set_plt_offset((this->count_) * this->get_plt_entry_size() - + this->first_plt_entry_offset()); + unsigned int* entry_count; + Output_section_data_build* got; + + // We have 2 different types of plt entry here, normal and ifunc. + + // For normal plt, the offset begins with first_plt_entry_offset(20), and the + // 1st entry offset would be 20, the second 32, third 44 ... etc. + + // For ifunc plt, the offset begins with 0. So the first offset would 0, + // second 12, third 24 ... etc. + + // IFunc plt entries *always* come after *normal* plt entries. + + // Notice, when computing the plt address of a certain symbol, "plt_address + + // plt_offset" is no longer correct. Use target->plt_address_for_global() or + // target->plt_address_for_local() instead. + + int begin_offset = 0; + if (gsym->type() == elfcpp::STT_GNU_IFUNC + && gsym->can_use_relative_reloc(false)) + { + entry_count = &this->irelative_count_; + got = this->got_irelative_; + // For irelative plt entries, offset is relative to the end of normal plt + // entries, so it starts from 0. + begin_offset = 0; + // Record symbol information. + this->insert_irelative_data( + IRelative_data(symtab->get_sized_symbol<32>(gsym))); + } + else + { + entry_count = &this->count_; + got = this->got_plt_; + // Note that for normal plt entries, when setting the PLT offset we skip + // the initial reserved PLT entry. + begin_offset = this->first_plt_entry_offset(); + } + + gsym->set_plt_offset(begin_offset + + (*entry_count) * this->get_plt_entry_size()); - ++this->count_; + ++(*entry_count); - section_offset_type got_offset = this->got_plt_->current_data_size(); + section_offset_type got_offset = got->current_data_size(); // Every PLT entry needs a GOT entry which points back to the PLT // entry (this will be changed by the dynamic linker, normally // lazily when the function is called). - this->got_plt_->set_current_data_size(got_offset + 4); + got->set_current_data_size(got_offset + 4); // Every PLT entry needs a reloc. - gsym->set_needs_dynsym_entry(); - this->rel_->add_global(gsym, elfcpp::R_ARM_JUMP_SLOT, this->got_plt_, - got_offset); + this->add_relocation(symtab, layout, gsym, got_offset); // Note that we don't need to save the symbol. The contents of the // PLT are independent of which symbols are used. The symbols only // appear in the relocations. } +// Add an entry to the PLT for a local STT_GNU_IFUNC symbol. Return +// the PLT offset. + +template +unsigned int +Output_data_plt_arm::add_local_ifunc_entry( + Symbol_table* symtab, + Layout* layout, + Sized_relobj_file<32, big_endian>* relobj, + unsigned int local_sym_index) +{ + this->insert_irelative_data(IRelative_data(relobj, local_sym_index)); + + // Notice, when computingthe plt entry address, "plt_address + plt_offset" is + // no longer correct. Use target->plt_address_for_local() instead. + unsigned int plt_offset = this->irelative_count_ * this->get_plt_entry_size(); + ++this->irelative_count_; + + section_offset_type got_offset = this->got_irelative_->current_data_size(); + + // Every PLT entry needs a GOT entry which points back to the PLT + // entry. + this->got_irelative_->set_current_data_size(got_offset + 4); + + + // Every PLT entry needs a reloc. + Reloc_section* rel = this->rel_irelative(symtab, layout); + rel->add_symbolless_local_addend(relobj, local_sym_index, + elfcpp::R_ARM_IRELATIVE, + this->got_irelative_, got_offset); + return plt_offset; +} + + +// Add the relocation for a PLT entry. + +template +void +Output_data_plt_arm::add_relocation( + Symbol_table* symtab, Layout* layout, Symbol* gsym, unsigned int got_offset) +{ + if (gsym->type() == elfcpp::STT_GNU_IFUNC + && gsym->can_use_relative_reloc(false)) + { + Reloc_section* rel = this->rel_irelative(symtab, layout); + rel->add_symbolless_global_addend(gsym, elfcpp::R_ARM_IRELATIVE, + this->got_irelative_, got_offset); + } + else + { + gsym->set_needs_dynsym_entry(); + this->rel_->add_global(gsym, elfcpp::R_ARM_JUMP_SLOT, this->got_plt_, + got_offset); + } +} + + +// Create the irelative relocation data. + +template +typename Output_data_plt_arm::Reloc_section* +Output_data_plt_arm::rel_irelative(Symbol_table* symtab, + Layout* layout) +{ + if (this->irelative_rel_ == NULL) + { + // Since irelative relocations goes into 'rel.dyn', we delegate the + // creation of irelative_rel_ to where rel_dyn section gets created. + Target_arm* arm_target = + Target_arm::default_target(); + this->irelative_rel_ = arm_target->rel_irelative_section(layout); + + // Make sure we have a place for the TLSDESC relocations, in + // case we see any later on. + // this->rel_tlsdesc(layout); + if (parameters->doing_static_link()) + { + // A statically linked executable will only have a .rel.plt section to + // hold R_ARM_IRELATIVE relocs for STT_GNU_IFUNC symbols. The library + // will use these symbols to locate the IRELATIVE relocs at program + // startup time. + symtab->define_in_output_data("__rel_iplt_start", NULL, + Symbol_table::PREDEFINED, + this->irelative_rel_, 0, 0, + elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL, + elfcpp::STV_HIDDEN, 0, false, true); + symtab->define_in_output_data("__rel_iplt_end", NULL, + Symbol_table::PREDEFINED, + this->irelative_rel_, 0, 0, + elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL, + elfcpp::STV_HIDDEN, 0, true, true); + } + } + return this->irelative_rel_; +} + + +// Return the PLT address for a global symbol. + +template +uint32_t +Output_data_plt_arm::address_for_global(const Symbol* gsym) const +{ + uint64_t begin_offset = 0; + if (gsym->type() == elfcpp::STT_GNU_IFUNC + && gsym->can_use_relative_reloc(false)) + { + begin_offset = (this->first_plt_entry_offset() + + this->count_ * this->get_plt_entry_size()); + } + return this->address() + begin_offset + gsym->plt_offset(); +} + + +// Return the PLT address for a local symbol. These are always +// IRELATIVE relocs. + +template +uint32_t +Output_data_plt_arm::address_for_local( + const Relobj* object, + unsigned int r_sym) const +{ + return (this->address() + + this->first_plt_entry_offset() + + this->count_ * this->get_plt_entry_size() + + object->local_plt_offset(r_sym)); +} + + template class Output_data_plt_arm_standard : public Output_data_plt_arm { public: - Output_data_plt_arm_standard(Layout* layout, Output_data_space* got_plt) - : Output_data_plt_arm(layout, 4, got_plt) + Output_data_plt_arm_standard(Layout* layout, + Arm_output_data_got* got, + Output_data_space* got_plt, + Output_data_space* got_irelative) + : Output_data_plt_arm(layout, 4, got, got_plt, got_irelative) { } protected: @@ -7485,8 +7825,11 @@ Output_data_plt_arm::do_write(Output_file* of) unsigned char* const oview = of->get_output_view(offset, oview_size); const off_t got_file_offset = this->got_plt_->offset(); + gold_assert(got_file_offset + this->got_plt_->data_size() + == this->got_irelative_->offset()); const section_size_type got_size = - convert_to_section_size_type(this->got_plt_->data_size()); + convert_to_section_size_type(this->got_plt_->data_size() + + this->got_irelative_->data_size()); unsigned char* const got_view = of->get_output_view(got_file_offset, got_size); unsigned char* pov = oview; @@ -7505,7 +7848,8 @@ Output_data_plt_arm::do_write(Output_file* of) unsigned int plt_offset = this->first_plt_entry_offset(); unsigned int got_offset = 12; - const unsigned int count = this->count_; + const unsigned int count = this->count_ + this->irelative_count_; + gold_assert(this->irelative_count_ == this->irelative_data_vec_.size()); for (unsigned int i = 0; i < count; ++i, @@ -7518,8 +7862,33 @@ Output_data_plt_arm::do_write(Output_file* of) this->fill_plt_entry(pov, got_address, plt_address, got_offset, plt_offset); - // Set the entry in the GOT. - elfcpp::Swap<32, big_endian>::writeval(got_pov, plt_address); + Arm_address value; + if (i < this->count_) + { + // For non-irelative got entries, the value is the beginning of plt. + value = plt_address; + } + else + { + // For irelative got entries, the value is the (global/local) symbol + // address. + const IRelative_data& idata = + this->irelative_data_vec_[i - this->count_]; + if (idata.symbol_is_global_) + { + // Set the entry in the GOT for irelative symbols. The content is + // the address of the ifunc, not the address of plt start. + const Sized_symbol<32>* sized_symbol = idata.u_.global; + gold_assert(sized_symbol->type() == elfcpp::STT_GNU_IFUNC); + value = sized_symbol->value(); + } + else + { + value = idata.u_.local.relobj->local_symbol_value( + idata.u_.local.index, 0); + } + } + elfcpp::Swap<32, big_endian>::writeval(got_pov, value); } gold_assert(static_cast(pov - oview) == oview_size); @@ -7529,6 +7898,7 @@ Output_data_plt_arm::do_write(Output_file* of) of->write_output_view(got_file_offset, got_size, got_view); } + // Create a PLT entry for a global symbol. template @@ -7539,21 +7909,66 @@ Target_arm::make_plt_entry(Symbol_table* symtab, Layout* layout, if (gsym->has_plt_offset()) return; + if (this->plt_ == NULL) + this->make_plt_section(symtab, layout); + + this->plt_->add_entry(symtab, layout, gsym); +} + + +// Create the PLT section. +template +void +Target_arm::make_plt_section( + Symbol_table* symtab, Layout* layout) +{ if (this->plt_ == NULL) { - // Create the GOT sections first. + // Create the GOT section first. this->got_section(symtab, layout); - this->plt_ = this->make_data_plt(layout, this->got_plt_); + // GOT for irelatives is create along with got.plt. + gold_assert(this->got_ != NULL + && this->got_plt_ != NULL + && this->got_irelative_ != NULL); + this->plt_ = this->make_data_plt(layout, this->got_, this->got_plt_, + this->got_irelative_); layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS, (elfcpp::SHF_ALLOC | elfcpp::SHF_EXECINSTR), this->plt_, ORDER_PLT, false); + symtab->define_in_output_data("$a", NULL, + Symbol_table::PREDEFINED, + this->plt_, + 0, 0, elfcpp::STT_NOTYPE, + elfcpp::STB_LOCAL, + elfcpp::STV_DEFAULT, 0, + false, false); } - this->plt_->add_entry(gsym); } + +// Make a PLT entry for a local STT_GNU_IFUNC symbol. + +template +void +Target_arm::make_local_ifunc_plt_entry( + Symbol_table* symtab, Layout* layout, + Sized_relobj_file<32, big_endian>* relobj, + unsigned int local_sym_index) +{ + if (relobj->local_has_plt_offset(local_sym_index)) + return; + if (this->plt_ == NULL) + this->make_plt_section(symtab, layout); + unsigned int plt_offset = this->plt_->add_local_ifunc_entry(symtab, layout, + relobj, + local_sym_index); + relobj->set_local_plt_offset(local_sym_index, plt_offset); +} + + // Return the number of entries in the PLT. template @@ -7823,6 +8238,7 @@ Target_arm::Scan::check_non_pic(Relobj* object, case elfcpp::R_ARM_JUMP_SLOT: case elfcpp::R_ARM_ABS32: case elfcpp::R_ARM_ABS32_NOI: + case elfcpp::R_ARM_IRELATIVE: case elfcpp::R_ARM_PC24: // FIXME: The following 3 types are not supported by Android's dynamic // linker. @@ -7853,6 +8269,27 @@ Target_arm::Scan::check_non_pic(Relobj* object, } } + +// Return whether we need to make a PLT entry for a relocation of the +// given type against a STT_GNU_IFUNC symbol. + +template +bool +Target_arm::Scan::reloc_needs_plt_for_ifunc( + Sized_relobj_file<32, big_endian>* object, + unsigned int r_type) +{ + int flags = Scan::get_reference_flags(r_type); + if (flags & Symbol::TLS_REF) + { + gold_error(_("%s: unsupported TLS reloc %u for IFUNC symbol"), + object->name().c_str(), r_type); + return false; + } + return flags != 0; +} + + // Scan a relocation for a local symbol. // FIXME: This only handles a subset of relocation types used by Android // on ARM v5te devices. @@ -7874,6 +8311,15 @@ Target_arm::Scan::local(Symbol_table* symtab, return; r_type = get_real_reloc_type(r_type); + + // A local STT_GNU_IFUNC symbol may require a PLT entry. + bool is_ifunc = lsym.get_st_type() == elfcpp::STT_GNU_IFUNC; + if (is_ifunc && this->reloc_needs_plt_for_ifunc(object, r_type)) + { + unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info()); + target->make_local_ifunc_plt_entry(symtab, layout, object, r_sym); + } + switch (r_type) { case elfcpp::R_ARM_NONE: @@ -7898,7 +8344,7 @@ Target_arm::Scan::local(Symbol_table* symtab, // we need to add check_non_pic(object, r_type) here. rel_dyn->add_local_relative(object, r_sym, elfcpp::R_ARM_RELATIVE, output_section, data_shndx, - reloc.get_r_offset()); + reloc.get_r_offset(), is_ifunc); } break; @@ -8265,6 +8711,11 @@ Target_arm::Scan::global(Symbol_table* symtab, && strcmp(gsym->name(), "_GLOBAL_OFFSET_TABLE_") == 0) target->got_section(symtab, layout); + // A STT_GNU_IFUNC symbol may require a PLT entry. + if (gsym->type() == elfcpp::STT_GNU_IFUNC + && this->reloc_needs_plt_for_ifunc(object, r_type)) + target->make_plt_entry(symtab, layout, gsym); + r_type = get_real_reloc_type(r_type); switch (r_type) { @@ -8307,6 +8758,24 @@ Target_arm::Scan::global(Symbol_table* symtab, target->copy_reloc(symtab, layout, object, data_shndx, output_section, gsym, reloc); } + else if ((r_type == elfcpp::R_ARM_ABS32 + || r_type == elfcpp::R_ARM_ABS32_NOI) + && gsym->type() == elfcpp::STT_GNU_IFUNC + && gsym->can_use_relative_reloc(false) + && !gsym->is_from_dynobj() + && !gsym->is_undefined() + && !gsym->is_preemptible()) + { + // Use an IRELATIVE reloc for a locally defined STT_GNU_IFUNC + // symbol. This makes a function address in a PIE executable + // match the address in a shared library that it links against. + Reloc_section* rel_irelative = + target->rel_irelative_section(layout); + unsigned int r_type = elfcpp::R_ARM_IRELATIVE; + rel_irelative->add_symbolless_global_addend( + gsym, r_type, output_section, object, + data_shndx, reloc.get_r_offset()); + } else if ((r_type == elfcpp::R_ARM_ABS32 || r_type == elfcpp::R_ARM_ABS32_NOI) && gsym->can_use_relative_reloc(false)) @@ -8442,7 +8911,13 @@ Target_arm::Scan::global(Symbol_table* symtab, Arm_output_data_got* got = target->got_section(symtab, layout); if (gsym->final_value_is_known()) - got->add_global(gsym, GOT_TYPE_STANDARD); + { + // For a STT_GNU_IFUNC symbol we want the PLT address. + if (gsym->type() == elfcpp::STT_GNU_IFUNC) + got->add_global_plt(gsym, GOT_TYPE_STANDARD); + else + got->add_global(gsym, GOT_TYPE_STANDARD); + } else { // If this symbol is not fully resolved, we need to add a @@ -8452,12 +8927,29 @@ Target_arm::Scan::global(Symbol_table* symtab, || gsym->is_undefined() || gsym->is_preemptible() || (gsym->visibility() == elfcpp::STV_PROTECTED - && parameters->options().shared())) + && parameters->options().shared()) + || (gsym->type() == elfcpp::STT_GNU_IFUNC + && parameters->options().output_is_position_independent())) got->add_global_with_rel(gsym, GOT_TYPE_STANDARD, rel_dyn, elfcpp::R_ARM_GLOB_DAT); else { - if (got->add_global(gsym, GOT_TYPE_STANDARD)) + // For a STT_GNU_IFUNC symbol we want to write the PLT + // offset into the GOT, so that function pointer + // comparisons work correctly. + bool is_new; + if (gsym->type() != elfcpp::STT_GNU_IFUNC) + is_new = got->add_global(gsym, GOT_TYPE_STANDARD); + else + { + is_new = got->add_global_plt(gsym, GOT_TYPE_STANDARD); + // Tell the dynamic linker to use the PLT address + // when resolving relocations. + if (gsym->is_from_dynobj() + && !parameters->options().shared()) + gsym->set_needs_dynsym_value(); + } + if (is_new) rel_dyn->add_global_relative( gsym, elfcpp::R_ARM_RELATIVE, got, gsym->got_offset(GOT_TYPE_STANDARD)); @@ -8919,8 +9411,7 @@ Target_arm::Relocate::relocate( if (gsym->use_plt_offset(Scan::get_reference_flags(r_type))) { // This uses a PLT, change the symbol value. - symval.set_output_value(target->plt_section()->address() - + gsym->plt_offset()); + symval.set_output_value(target->plt_address_for_global(gsym)); psymval = &symval; } else if (gsym->is_weak_undefined()) @@ -8958,6 +9449,13 @@ Target_arm::Relocate::relocate( elfcpp::Elf_types<32>::Elf_WXword r_info = rel.get_r_info(); unsigned int r_sym = elfcpp::elf_r_sym<32>(r_info); thumb_bit = object->local_symbol_is_thumb_function(r_sym) ? 1 : 0; + + if (psymval->is_ifunc_symbol() && object->local_has_plt_offset(r_sym)) + { + symval.set_output_value( + target->plt_address_for_local(object, r_sym)); + psymval = &symval; + } } } else @@ -9936,7 +10434,7 @@ uint64_t Target_arm::do_dynsym_value(const Symbol* gsym) const { gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset()); - return this->plt_section()->address() + gsym->plt_offset(); + return this->plt_address_for_global(gsym); } // Map platform-specific relocs to real relocs @@ -10056,7 +10554,7 @@ Target_arm::do_adjust_elf_header( if (type == elfcpp::ET_EXEC || type == elfcpp::ET_DYN) { Object_attribute* attr = this->get_aeabi_object_attribute(elfcpp::Tag_ABI_VFP_args); - if (attr->int_value()) + if (attr->int_value() == elfcpp::AEABI_VFP_args_vfp) flags |= elfcpp::EF_ARM_ABI_FLOAT_HARD; else flags |= elfcpp::EF_ARM_ABI_FLOAT_SOFT; @@ -10493,10 +10991,18 @@ Target_arm::merge_object_attributes( != out_attr[elfcpp::Tag_ABI_VFP_args].int_value()) { // Ignore mismatches if the object doesn't use floating point. */ - if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value() == 0) + if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value() + == elfcpp::AEABI_FP_number_model_none + || (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() + != elfcpp::AEABI_FP_number_model_none + && out_attr[elfcpp::Tag_ABI_VFP_args].int_value() + == elfcpp::AEABI_VFP_args_compatible)) out_attr[elfcpp::Tag_ABI_VFP_args].set_int_value( in_attr[elfcpp::Tag_ABI_VFP_args].int_value()); - else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() != 0 + else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() + != elfcpp::AEABI_FP_number_model_none + && in_attr[elfcpp::Tag_ABI_VFP_args].int_value() + != elfcpp::AEABI_VFP_args_compatible && parameters->options().warn_mismatch()) gold_error(_("%s uses VFP register arguments, output does not"), name); @@ -11083,8 +11589,7 @@ Target_arm::scan_reloc_for_stub( if (gsym->use_plt_offset(Scan::get_reference_flags(r_type))) { // This uses a PLT, change the symbol value. - symval.set_output_value(this->plt_section()->address() - + gsym->plt_offset()); + symval.set_output_value(this->plt_address_for_global(gsym)); psymval = &symval; target_is_thumb = false; } @@ -12187,8 +12692,13 @@ class Target_arm_nacl : public Target_arm protected: virtual Output_data_plt_arm* - do_make_data_plt(Layout* layout, Output_data_space* got_plt) - { return new Output_data_plt_arm_nacl(layout, got_plt); } + do_make_data_plt( + Layout* layout, + Arm_output_data_got* got, + Output_data_space* got_plt, + Output_data_space* got_irelative) + { return new Output_data_plt_arm_nacl( + layout, got, got_plt, got_irelative); } private: static const Target::Target_info arm_nacl_info; @@ -12225,8 +12735,12 @@ template class Output_data_plt_arm_nacl : public Output_data_plt_arm { public: - Output_data_plt_arm_nacl(Layout* layout, Output_data_space* got_plt) - : Output_data_plt_arm(layout, 16, got_plt) + Output_data_plt_arm_nacl( + Layout* layout, + Arm_output_data_got* got, + Output_data_space* got_plt, + Output_data_space* got_irelative) + : Output_data_plt_arm(layout, 16, got, got_plt, got_irelative) { } protected: diff --git a/binutils-2.25/gold/attributes.cc b/binutils-2.25/gold/attributes.cc index 8e2892cf..8ddcd72c 100644 --- a/binutils-2.25/gold/attributes.cc +++ b/binutils-2.25/gold/attributes.cc @@ -1,6 +1,6 @@ // attributes.cc -- object attributes for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file contains code adapted from BFD. diff --git a/binutils-2.25/gold/attributes.h b/binutils-2.25/gold/attributes.h index 2aa7a78a..c0b171f7 100644 --- a/binutils-2.25/gold/attributes.h +++ b/binutils-2.25/gold/attributes.h @@ -1,6 +1,6 @@ // attributes.h -- object attributes for gold -*- C++ -*- -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file contains code adapted from BFD. diff --git a/binutils-2.25/gold/binary.cc b/binutils-2.25/gold/binary.cc index 4dab52cd..12ca296e 100644 --- a/binutils-2.25/gold/binary.cc +++ b/binutils-2.25/gold/binary.cc @@ -1,6 +1,6 @@ // binary.cc -- binary input files for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -235,12 +235,12 @@ Binary_to_elf::sized_convert(const Task* task) pout += aligned_filesize - filesize; } - this->write_symbol("", &strtab, 0, 0, &pout); - this->write_symbol(start_symbol_name, &strtab, 0, 1, - &pout); - this->write_symbol(end_symbol_name, &strtab, filesize, 1, - &pout); - this->write_symbol(size_symbol_name, &strtab, filesize, + this->write_symbol("", &strtab, 0, 0, 0, &pout); + this->write_symbol(start_symbol_name, &strtab, 0, filesize, + 1, &pout); + this->write_symbol(end_symbol_name, &strtab, filesize, 0, + 1, &pout); + this->write_symbol(size_symbol_name, &strtab, filesize, 0, elfcpp::SHN_ABS, &pout); strtab.write_to_buffer(pout, strtab.get_strtab_size()); @@ -343,6 +343,7 @@ Binary_to_elf::write_symbol( const std::string& name, const Stringpool* strtab, section_size_type value, + typename elfcpp::Elf_types<32>::Elf_WXword st_size, unsigned int shndx, unsigned char** ppout) { @@ -351,7 +352,7 @@ Binary_to_elf::write_symbol( elfcpp::Sym_write osym(pout); osym.put_st_name(name.empty() ? 0 : strtab->get_offset(name.c_str())); osym.put_st_value(value); - osym.put_st_size(0); + osym.put_st_size(st_size); osym.put_st_info(name.empty() ? elfcpp::STB_LOCAL : elfcpp::STB_GLOBAL, elfcpp::STT_NOTYPE); osym.put_st_other(elfcpp::STV_DEFAULT, 0); diff --git a/binutils-2.25/gold/binary.h b/binutils-2.25/gold/binary.h index 3ce84c2e..6b8a9160 100644 --- a/binutils-2.25/gold/binary.h +++ b/binutils-2.25/gold/binary.h @@ -1,6 +1,6 @@ // binary.h -- binary input files for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -95,7 +95,8 @@ class Binary_to_elf template void write_symbol(const std::string&, const Stringpool_template*, - section_size_type, unsigned int, unsigned char**); + section_size_type, typename elfcpp::Elf_types<32>::Elf_WXword, + unsigned int, unsigned char**); // The ELF machine code of the file to create. elfcpp::EM elf_machine_; diff --git a/binutils-2.25/gold/common.cc b/binutils-2.25/gold/common.cc index 739c8901..5e8339c5 100644 --- a/binutils-2.25/gold/common.cc +++ b/binutils-2.25/gold/common.cc @@ -1,6 +1,6 @@ // common.cc -- handle common symbols for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/common.h b/binutils-2.25/gold/common.h index 20c37aba..dcd1403d 100644 --- a/binutils-2.25/gold/common.h +++ b/binutils-2.25/gold/common.h @@ -1,6 +1,6 @@ // common.h -- handle common symbols for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/compressed_output.cc b/binutils-2.25/gold/compressed_output.cc index 19a7f639..5a10329a 100644 --- a/binutils-2.25/gold/compressed_output.cc +++ b/binutils-2.25/gold/compressed_output.cc @@ -1,6 +1,6 @@ // compressed_output.cc -- manage compressed debug sections for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/compressed_output.h b/binutils-2.25/gold/compressed_output.h index 96a4bafc..b5fdbeb7 100644 --- a/binutils-2.25/gold/compressed_output.h +++ b/binutils-2.25/gold/compressed_output.h @@ -1,6 +1,6 @@ // compressed_output.h -- compressed output sections for gold -*- C++ -*- -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/configure b/binutils-2.25/gold/configure index 7d7b8493..34270746 100755 --- a/binutils-2.25/gold/configure +++ b/binutils-2.25/gold/configure @@ -688,6 +688,8 @@ DEFAULT_TARGET_MIPS_FALSE DEFAULT_TARGET_MIPS_TRUE DEFAULT_TARGET_TILEGX_FALSE DEFAULT_TARGET_TILEGX_TRUE +DEFAULT_TARGET_X32_FALSE +DEFAULT_TARGET_X32_TRUE DEFAULT_TARGET_X86_64_FALSE DEFAULT_TARGET_X86_64_TRUE DEFAULT_TARGET_SPARC_FALSE @@ -3475,7 +3477,20 @@ else DEFAULT_TARGET_SPARC_FALSE= fi - if test "$targ_obj" = "x86_64"; then + target_x86_64=no + target_x32=no + if test "$targ_obj" = "x86_64"; then + case "$target" in + x86_64*-linux-gnux32) + target_x32=yes + default_size=32 + ;; + *) + target_x86_64=yes + ;; + esac + fi + if test "$target_x86_64" = "yes"; then DEFAULT_TARGET_X86_64_TRUE= DEFAULT_TARGET_X86_64_FALSE='#' else @@ -3483,6 +3498,14 @@ else DEFAULT_TARGET_X86_64_FALSE= fi + if test "$target_x32" = "yes"; then + DEFAULT_TARGET_X32_TRUE= + DEFAULT_TARGET_X32_FALSE='#' +else + DEFAULT_TARGET_X32_TRUE='#' + DEFAULT_TARGET_X32_FALSE= +fi + if test "$targ_obj" = "tilegx"; then DEFAULT_TARGET_TILEGX_TRUE= DEFAULT_TARGET_TILEGX_FALSE='#' @@ -7811,6 +7834,10 @@ if test -z "${DEFAULT_TARGET_X86_64_TRUE}" && test -z "${DEFAULT_TARGET_X86_64_F as_fn_error "conditional \"DEFAULT_TARGET_X86_64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${DEFAULT_TARGET_X32_TRUE}" && test -z "${DEFAULT_TARGET_X32_FALSE}"; then + as_fn_error "conditional \"DEFAULT_TARGET_X32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${DEFAULT_TARGET_TILEGX_TRUE}" && test -z "${DEFAULT_TARGET_TILEGX_FALSE}"; then as_fn_error "conditional \"DEFAULT_TARGET_TILEGX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/binutils-2.25/gold/configure.ac b/binutils-2.25/gold/configure.ac index 04780117..c08d0a2d 100644 --- a/binutils-2.25/gold/configure.ac +++ b/binutils-2.25/gold/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. dnl dnl This file is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -204,7 +204,21 @@ for targ in $target $canon_targets; do AM_CONDITIONAL(DEFAULT_TARGET_I386, test "$targ_obj" = "i386") AM_CONDITIONAL(DEFAULT_TARGET_POWERPC, test "$targ_obj" = "powerpc") AM_CONDITIONAL(DEFAULT_TARGET_SPARC, test "$targ_obj" = "sparc") - AM_CONDITIONAL(DEFAULT_TARGET_X86_64, test "$targ_obj" = "x86_64") + target_x86_64=no + target_x32=no + if test "$targ_obj" = "x86_64"; then + case "$target" in + x86_64*-linux-gnux32) + target_x32=yes + default_size=32 + ;; + *) + target_x86_64=yes + ;; + esac + fi + AM_CONDITIONAL(DEFAULT_TARGET_X86_64, test "$target_x86_64" = "yes") + AM_CONDITIONAL(DEFAULT_TARGET_X32, test "$target_x32" = "yes") AM_CONDITIONAL(DEFAULT_TARGET_TILEGX, test "$targ_obj" = "tilegx") AM_CONDITIONAL(DEFAULT_TARGET_MIPS, test "$targ_obj" = "mips") DEFAULT_TARGET=${targ_obj} diff --git a/binutils-2.25/gold/configure.tgt b/binutils-2.25/gold/configure.tgt index 9a750706..a3cb34da 100644 --- a/binutils-2.25/gold/configure.tgt +++ b/binutils-2.25/gold/configure.tgt @@ -1,6 +1,6 @@ # configure.tgt -- target configuration for gold -*- sh -*- -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. @@ -146,6 +146,7 @@ arm*-*-*) ;; aarch64*-*) targ_obj=aarch64 + targ_extra_obj=aarch64-reloc-property targ_machine=EM_AARCH64 targ_size=64 targ_extra_size=32 diff --git a/binutils-2.25/gold/copy-relocs.cc b/binutils-2.25/gold/copy-relocs.cc index 41b65631..a7824fe3 100644 --- a/binutils-2.25/gold/copy-relocs.cc +++ b/binutils-2.25/gold/copy-relocs.cc @@ -1,6 +1,6 @@ // copy-relocs.cc -- handle COPY relocations for gold. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/copy-relocs.h b/binutils-2.25/gold/copy-relocs.h index 800c0e7e..6724fd9d 100644 --- a/binutils-2.25/gold/copy-relocs.h +++ b/binutils-2.25/gold/copy-relocs.h @@ -1,6 +1,6 @@ // copy-relocs.h -- handle COPY relocations for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/cref.cc b/binutils-2.25/gold/cref.cc index ac6f1c85..91f7b9e6 100644 --- a/binutils-2.25/gold/cref.cc +++ b/binutils-2.25/gold/cref.cc @@ -1,6 +1,6 @@ // cref.cc -- cross reference for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/cref.h b/binutils-2.25/gold/cref.h index 0e72d162..b03bf0ab 100644 --- a/binutils-2.25/gold/cref.h +++ b/binutils-2.25/gold/cref.h @@ -1,6 +1,6 @@ // cref.h -- cross reference reports for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/debug.h b/binutils-2.25/gold/debug.h index 63d3d8aa..bca55f37 100644 --- a/binutils-2.25/gold/debug.h +++ b/binutils-2.25/gold/debug.h @@ -1,6 +1,6 @@ // debug.h -- gold internal debugging support -*- C++ -*- -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/defstd.cc b/binutils-2.25/gold/defstd.cc index cee68a03..2da606e8 100644 --- a/binutils-2.25/gold/defstd.cc +++ b/binutils-2.25/gold/defstd.cc @@ -1,6 +1,6 @@ // defstd.cc -- define standard symbols for gold. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/defstd.h b/binutils-2.25/gold/defstd.h index 853a1e80..9e7d092e 100644 --- a/binutils-2.25/gold/defstd.h +++ b/binutils-2.25/gold/defstd.h @@ -1,6 +1,6 @@ // defstd.h -- define standard symbols for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/descriptors.cc b/binutils-2.25/gold/descriptors.cc index 2016b7ff..c55d45bb 100644 --- a/binutils-2.25/gold/descriptors.cc +++ b/binutils-2.25/gold/descriptors.cc @@ -1,6 +1,6 @@ // descriptors.cc -- manage file descriptors for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -28,6 +28,7 @@ #include #include +#include "debug.h" #include "parameters.h" #include "options.h" #include "gold-threads.h" @@ -81,6 +82,9 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode) gold_assert(lock_initialized || descriptor < 0); + if (is_debugging_enabled(DEBUG_FILES)) + this->limit_ = 8; + if (descriptor >= 0) { Hold_lock hl(*this->lock_); @@ -99,6 +103,8 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode) pod->stack_next = -1; pod->is_on_stack = false; } + gold_debug(DEBUG_FILES, "Reused existing descriptor %d for \"%s\"", + descriptor, name); return descriptor; } } @@ -128,6 +134,8 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode) errno = ENOENT; } + gold_debug(DEBUG_FILES, "Opened new descriptor %d for \"%s\"", + new_descriptor, name); return new_descriptor; } @@ -162,6 +170,8 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode) if (this->current_ >= this->limit_) this->close_some_descriptor(); + gold_debug(DEBUG_FILES, "Opened new descriptor %d for \"%s\"", + new_descriptor, name); return new_descriptor; } } @@ -209,6 +219,9 @@ Descriptors::release(int descriptor, bool permanent) pod->is_on_stack = true; } } + + gold_debug(DEBUG_FILES, "Released descriptor %d for \"%s\"", + descriptor, pod->name); } // Close some descriptor. The lock is held when this is called. We @@ -233,6 +246,8 @@ Descriptors::close_some_descriptor() if (::close(i) < 0) gold_warning(_("while closing %s: %s"), pod->name, strerror(errno)); --this->current_; + gold_debug(DEBUG_FILES, "Closed descriptor %d for \"%s\"", + i, pod->name); pod->name = NULL; if (last < 0) this->stack_top_ = pod->stack_next; @@ -265,6 +280,8 @@ Descriptors::close_all() { if (::close(i) < 0) gold_warning(_("while closing %s: %s"), pod->name, strerror(errno)); + gold_debug(DEBUG_FILES, "Closed descriptor %d for \"%s\" (close_all)", + static_cast(i), pod->name); pod->name = NULL; pod->stack_next = -1; pod->is_on_stack = false; diff --git a/binutils-2.25/gold/descriptors.h b/binutils-2.25/gold/descriptors.h index c14ac077..a2f45cfa 100644 --- a/binutils-2.25/gold/descriptors.h +++ b/binutils-2.25/gold/descriptors.h @@ -1,6 +1,6 @@ // descriptors.h -- manage file descriptors for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/dirsearch.cc b/binutils-2.25/gold/dirsearch.cc index e9e2fa12..1e92fa56 100644 --- a/binutils-2.25/gold/dirsearch.cc +++ b/binutils-2.25/gold/dirsearch.cc @@ -1,6 +1,6 @@ // dirsearch.cc -- directory searching for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/dirsearch.h b/binutils-2.25/gold/dirsearch.h index d020d94f..09f80672 100644 --- a/binutils-2.25/gold/dirsearch.h +++ b/binutils-2.25/gold/dirsearch.h @@ -1,6 +1,6 @@ // dirsearch.h -- directory searching for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/dwarf_reader.cc b/binutils-2.25/gold/dwarf_reader.cc index 30aea10f..e7c95ce6 100644 --- a/binutils-2.25/gold/dwarf_reader.cc +++ b/binutils-2.25/gold/dwarf_reader.cc @@ -1,6 +1,6 @@ // dwarf_reader.cc -- parse dwarf2/3 debug information -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/dwarf_reader.h b/binutils-2.25/gold/dwarf_reader.h index cac413b6..0792c1ca 100644 --- a/binutils-2.25/gold/dwarf_reader.h +++ b/binutils-2.25/gold/dwarf_reader.h @@ -1,6 +1,6 @@ // dwarf_reader.h -- parse dwarf2/3 debug information for gold -*- C++ -*- -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/dwp.cc b/binutils-2.25/gold/dwp.cc index 5401e0c6..d5e19ef0 100644 --- a/binutils-2.25/gold/dwp.cc +++ b/binutils-2.25/gold/dwp.cc @@ -1,6 +1,6 @@ // dwp.cc -- DWARF packaging utility -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of dwp, the DWARF packaging utility. @@ -2352,7 +2352,7 @@ print_version() { // This output is intended to follow the GNU standards. printf("GNU dwp %s\n", BFD_VERSION_STRING); - printf(_("Copyright (C) 2014 Free Software Foundation, Inc.\n")); + printf(_("Copyright (C) 2015 Free Software Foundation, Inc.\n")); printf(_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License version 3 or (at your option) any later version.\n\ diff --git a/binutils-2.25/gold/dwp.h b/binutils-2.25/gold/dwp.h index 6b57eaa3..cf628f19 100644 --- a/binutils-2.25/gold/dwp.h +++ b/binutils-2.25/gold/dwp.h @@ -1,6 +1,6 @@ // dwp.h -- general definitions for dwp. -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of dwp, the DWARF packaging utility. diff --git a/binutils-2.25/gold/dynobj.cc b/binutils-2.25/gold/dynobj.cc index baf84894..8bf6251f 100644 --- a/binutils-2.25/gold/dynobj.cc +++ b/binutils-2.25/gold/dynobj.cc @@ -1,6 +1,6 @@ // dynobj.cc -- dynamic object support for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/dynobj.h b/binutils-2.25/gold/dynobj.h index c20ed203..b7c60f82 100644 --- a/binutils-2.25/gold/dynobj.h +++ b/binutils-2.25/gold/dynobj.h @@ -1,6 +1,6 @@ // dynobj.h -- dynamic object support for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/ehframe.cc b/binutils-2.25/gold/ehframe.cc index c711bac5..faea1a83 100644 --- a/binutils-2.25/gold/ehframe.cc +++ b/binutils-2.25/gold/ehframe.cc @@ -1,6 +1,6 @@ // ehframe.cc -- handle exception frame sections for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/ehframe.h b/binutils-2.25/gold/ehframe.h index 2ae12e0e..aa2bd31a 100644 --- a/binutils-2.25/gold/ehframe.h +++ b/binutils-2.25/gold/ehframe.h @@ -1,6 +1,6 @@ // ehframe.h -- handle exception frame sections for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/errors.cc b/binutils-2.25/gold/errors.cc index 8339742e..d81b2aa5 100644 --- a/binutils-2.25/gold/errors.cc +++ b/binutils-2.25/gold/errors.cc @@ -1,6 +1,6 @@ // errors.cc -- handle errors for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/errors.h b/binutils-2.25/gold/errors.h index ea8f9927..99542c15 100644 --- a/binutils-2.25/gold/errors.h +++ b/binutils-2.25/gold/errors.h @@ -1,6 +1,6 @@ // errors.h -- handle errors for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/expression.cc b/binutils-2.25/gold/expression.cc index 61a3eaf1..a64fa423 100644 --- a/binutils-2.25/gold/expression.cc +++ b/binutils-2.25/gold/expression.cc @@ -1,6 +1,6 @@ // expression.cc -- expressions in linker scripts for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/ffsll.c b/binutils-2.25/gold/ffsll.c index 292ad806..3700b6ec 100644 --- a/binutils-2.25/gold/ffsll.c +++ b/binutils-2.25/gold/ffsll.c @@ -1,6 +1,6 @@ /* ffsll.c -- version of ffsll for gold. */ -/* Copyright (C) 2009-2014 Free Software Foundation, Inc. +/* Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/fileread.cc b/binutils-2.25/gold/fileread.cc index 8c46a1fb..0bd83206 100644 --- a/binutils-2.25/gold/fileread.cc +++ b/binutils-2.25/gold/fileread.cc @@ -1,6 +1,6 @@ // fileread.cc -- read files for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -293,6 +293,7 @@ void File_read::lock(const Task* task) { gold_assert(this->released_); + gold_debug(DEBUG_FILES, "Locking file \"%s\"", this->name_.c_str()); this->token_.add_writer(task); this->released_ = false; } @@ -302,6 +303,7 @@ File_read::lock(const Task* task) void File_read::unlock(const Task* task) { + gold_debug(DEBUG_FILES, "Unlocking file \"%s\"", this->name_.c_str()); this->release(); this->token_.remove_writer(task); } diff --git a/binutils-2.25/gold/fileread.h b/binutils-2.25/gold/fileread.h index d64f18a9..601e7b04 100644 --- a/binutils-2.25/gold/fileread.h +++ b/binutils-2.25/gold/fileread.h @@ -1,6 +1,6 @@ // fileread.h -- read files for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/freebsd.h b/binutils-2.25/gold/freebsd.h index 737da90d..6f121d9c 100644 --- a/binutils-2.25/gold/freebsd.h +++ b/binutils-2.25/gold/freebsd.h @@ -1,6 +1,6 @@ // freebsd.h -- FreeBSD support for gold -*- C++ -*- -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/ftruncate.c b/binutils-2.25/gold/ftruncate.c index 00f357f9..ae9e5e25 100644 --- a/binutils-2.25/gold/ftruncate.c +++ b/binutils-2.25/gold/ftruncate.c @@ -1,7 +1,7 @@ /* ftruncate emulations that work on some System V's. This file is in the public domain. */ -/* Copyright (C) 2012-2014 Free Software Foundation, Inc. +/* Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of gold. diff --git a/binutils-2.25/gold/gc.cc b/binutils-2.25/gold/gc.cc index 4759c008..843b2b80 100644 --- a/binutils-2.25/gold/gc.cc +++ b/binutils-2.25/gold/gc.cc @@ -1,6 +1,6 @@ // gc.cc -- garbage collection of unused sections -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/gc.h b/binutils-2.25/gold/gc.h index 2f79a240..be4a63c5 100644 --- a/binutils-2.25/gold/gc.h +++ b/binutils-2.25/gold/gc.h @@ -1,6 +1,6 @@ // gc.h -- garbage collection of unused sections -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. @@ -109,11 +109,8 @@ class Garbage_collection { Section_id src_id(src_object, src_shndx); Section_id dst_id(dst_object, dst_shndx); - Section_ref::iterator p = this->section_reloc_map_.find(src_id); - if (p == this->section_reloc_map_.end()) - this->section_reloc_map_[src_id].insert(dst_id); - else - p->second.insert(dst_id); + Sections_reachable& reachable = this->section_reloc_map_[src_id]; + reachable.insert(dst_id); } private: diff --git a/binutils-2.25/gold/gdb-index.cc b/binutils-2.25/gold/gdb-index.cc index f768827f..666ee70b 100644 --- a/binutils-2.25/gold/gdb-index.cc +++ b/binutils-2.25/gold/gdb-index.cc @@ -1,6 +1,6 @@ // gdb-index.cc -- generate .gdb_index section for fast debug lookup -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. @@ -371,7 +371,9 @@ Gdb_index_info_reader::visit_top_die(Dwarf_die* die) || this->cu_language_ == elfcpp::DW_LANG_Fortran90 || this->cu_language_ == elfcpp::DW_LANG_Java || this->cu_language_ == elfcpp::DW_LANG_Ada95 - || this->cu_language_ == elfcpp::DW_LANG_Fortran95) + || this->cu_language_ == elfcpp::DW_LANG_Fortran95 + || this->cu_language_ == elfcpp::DW_LANG_Fortran03 + || this->cu_language_ == elfcpp::DW_LANG_Fortran08) { gold_warning(_("%s: --gdb-index currently supports " "only C and C++ languages"), diff --git a/binutils-2.25/gold/gdb-index.h b/binutils-2.25/gold/gdb-index.h index 97dfc8fe..db0c2963 100644 --- a/binutils-2.25/gold/gdb-index.h +++ b/binutils-2.25/gold/gdb-index.h @@ -1,6 +1,6 @@ // gdb-index.h -- generate .gdb_index section for fast debug lookup -*- C++ -*- -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/gold-threads.cc b/binutils-2.25/gold/gold-threads.cc index ebd9c1f2..b06a908e 100644 --- a/binutils-2.25/gold/gold-threads.cc +++ b/binutils-2.25/gold/gold-threads.cc @@ -1,6 +1,6 @@ // gold-threads.cc -- thread support for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/gold-threads.h b/binutils-2.25/gold/gold-threads.h index 571cb940..cc6c9ecc 100644 --- a/binutils-2.25/gold/gold-threads.h +++ b/binutils-2.25/gold/gold-threads.h @@ -1,6 +1,6 @@ // gold-threads.h -- thread support for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/gold.cc b/binutils-2.25/gold/gold.cc index 4833aec7..ab15980f 100644 --- a/binutils-2.25/gold/gold.cc +++ b/binutils-2.25/gold/gold.cc @@ -1,6 +1,6 @@ // gold.cc -- main linker functions -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -808,6 +808,8 @@ queue_final_tasks(const General_options& options, if (!any_postprocessing_sections) { input_sections_blocker = new Task_token(true); + // Write_symbols_task, Relocate_tasks. + input_sections_blocker->add_blocker(); input_sections_blocker->add_blockers(input_objects->number_of_relobjs()); } @@ -836,6 +838,7 @@ queue_final_tasks(const General_options& options, // Queue a task to write out the output sections. workqueue->queue(new Write_sections_task(layout, of, output_sections_blocker, + input_sections_blocker, final_blocker)); // Queue a task to write out everything else. diff --git a/binutils-2.25/gold/gold.h b/binutils-2.25/gold/gold.h index b78a1656..9dfafc89 100644 --- a/binutils-2.25/gold/gold.h +++ b/binutils-2.25/gold/gold.h @@ -1,6 +1,6 @@ // gold.h -- general definitions for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/i386.cc b/binutils-2.25/gold/i386.cc index d28c4442..24f41036 100644 --- a/binutils-2.25/gold/i386.cc +++ b/binutils-2.25/gold/i386.cc @@ -1,6 +1,6 @@ // i386.cc -- i386 target support for gold. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/icf.cc b/binutils-2.25/gold/icf.cc index ad887154..8de6386c 100644 --- a/binutils-2.25/gold/icf.cc +++ b/binutils-2.25/gold/icf.cc @@ -1,6 +1,6 @@ // icf.cc -- Identical Code Folding. // -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/icf.h b/binutils-2.25/gold/icf.h index 31186427..d343fa5c 100644 --- a/binutils-2.25/gold/icf.h +++ b/binutils-2.25/gold/icf.h @@ -1,6 +1,6 @@ // icf.h -- Identical Code Folding -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/incremental-dump.cc b/binutils-2.25/gold/incremental-dump.cc index 8ef16cfa..6b647810 100644 --- a/binutils-2.25/gold/incremental-dump.cc +++ b/binutils-2.25/gold/incremental-dump.cc @@ -1,6 +1,6 @@ // incremental.cc -- incremental linking test/debug tool -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Rafael Avila de Espindola // This file is part of gold. diff --git a/binutils-2.25/gold/incremental.cc b/binutils-2.25/gold/incremental.cc index bbc055c5..b4fff11a 100644 --- a/binutils-2.25/gold/incremental.cc +++ b/binutils-2.25/gold/incremental.cc @@ -1,6 +1,6 @@ // inremental.cc -- incremental linking support for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Mikolaj Zalewski . // This file is part of gold. @@ -33,7 +33,6 @@ #include "incremental.h" #include "archive.h" #include "object.h" -#include "output.h" #include "target-select.h" #include "target.h" #include "fileread.h" diff --git a/binutils-2.25/gold/incremental.h b/binutils-2.25/gold/incremental.h index 5440c863..493cbd2a 100644 --- a/binutils-2.25/gold/incremental.h +++ b/binutils-2.25/gold/incremental.h @@ -1,6 +1,6 @@ // inremental.h -- incremental linking support for gold -*- C++ -*- -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Mikolaj Zalewski . // This file is part of gold. diff --git a/binutils-2.25/gold/int_encoding.cc b/binutils-2.25/gold/int_encoding.cc index f949d9a1..4973fbf7 100644 --- a/binutils-2.25/gold/int_encoding.cc +++ b/binutils-2.25/gold/int_encoding.cc @@ -1,6 +1,6 @@ // int_encoding.cc -- variable length and unaligned integer encoding support. -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Doug Kwan by refactoring scattered // contents from other files in gold. Original code written by Ian // Lance Taylor and Caleb Howe . diff --git a/binutils-2.25/gold/int_encoding.h b/binutils-2.25/gold/int_encoding.h index da4a2da0..07c5f45f 100644 --- a/binutils-2.25/gold/int_encoding.h +++ b/binutils-2.25/gold/int_encoding.h @@ -1,6 +1,6 @@ // int_encoding.h -- variable length and unaligned integers -*- C++ -*- -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Doug Kwan by refactoring scattered // contents from other files in gold. Original code written by Ian // Lance Taylor and Caleb Howe . diff --git a/binutils-2.25/gold/layout.cc b/binutils-2.25/gold/layout.cc index 32ac384a..7836640a 100644 --- a/binutils-2.25/gold/layout.cc +++ b/binutils-2.25/gold/layout.cc @@ -1,6 +1,6 @@ // layout.cc -- lay out output file sections for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -524,6 +524,7 @@ static const char* gdb_sections[] = "addr", // Fission extension // "aranges", // not used by gdb as of 7.4 "frame", + "gdb_scripts", "info", "types", "line", @@ -532,8 +533,11 @@ static const char* gdb_sections[] = "macro", // "pubnames", // not used by gdb as of 7.4 // "pubtypes", // not used by gdb as of 7.4 + // "gnu_pubnames", // Fission extension + // "gnu_pubtypes", // Fission extension "ranges", "str", + "str_offsets", }; // This is the minimum set of sections needed for line numbers. @@ -544,6 +548,7 @@ static const char* lines_only_debug_sections[] = // "addr", // Fission extension // "aranges", // not used by gdb as of 7.4 // "frame", + // "gdb_scripts", "info", // "types", "line", @@ -552,8 +557,11 @@ static const char* lines_only_debug_sections[] = // "macro", // "pubnames", // not used by gdb as of 7.4 // "pubtypes", // not used by gdb as of 7.4 + // "gnu_pubnames", // Fission extension + // "gnu_pubtypes", // Fission extension // "ranges", "str", + "str_offsets", // Fission extension }; // These sections are the DWARF fast-lookup tables, and are not needed @@ -2093,8 +2101,7 @@ Layout::layout_gnu_stack(bool seen_gnu_stack, uint64_t gnu_stack_flags, if ((gnu_stack_flags & elfcpp::SHF_EXECINSTR) != 0) { this->input_requires_executable_stack_ = true; - if (parameters->options().warn_execstack() - || parameters->options().is_stack_executable()) + if (parameters->options().warn_execstack()) gold_warning(_("%s: requires executable stack"), obj->name().c_str()); } @@ -2967,7 +2974,14 @@ Layout::create_executable_stack_info() { bool is_stack_executable; if (parameters->options().is_execstack_set()) - is_stack_executable = parameters->options().is_stack_executable(); + { + is_stack_executable = parameters->options().is_stack_executable(); + if (!is_stack_executable + && this->input_requires_executable_stack_ + && parameters->options().warn_execstack()) + gold_warning(_("one or more inputs require executable stack, " + "but -z noexecstack was given")); + } else if (!this->input_with_gnu_stack_note_) return; else @@ -3510,7 +3524,9 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg, // put them on different pages in memory. We will revisit this // decision once we know the size of the segment. - addr = align_address(addr, (*p)->maximum_alignment()); + uint64_t max_align = (*p)->maximum_alignment(); + if (max_align > abi_pagesize) + addr = align_address(addr, max_align); aligned_addr = addr; if (load_seg == *p) @@ -4857,7 +4873,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects, flags |= elfcpp::DF_STATIC_TLS; if (parameters->options().origin()) flags |= elfcpp::DF_ORIGIN; - if (parameters->options().Bsymbolic()) + if (parameters->options().Bsymbolic() + && !parameters->options().have_dynamic_list()) { flags |= elfcpp::DF_SYMBOLIC; // Add DT_SYMBOLIC for compatibility with older loaders. @@ -4869,6 +4886,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects, odyn->add_constant(elfcpp::DT_FLAGS, flags); flags = 0; + if (parameters->options().global()) + flags |= elfcpp::DF_1_GLOBAL; if (parameters->options().initfirst()) flags |= elfcpp::DF_1_INITFIRST; if (parameters->options().interpose()) @@ -5534,6 +5553,8 @@ void Write_sections_task::locks(Task_locker* tl) { tl->add(this, this->output_sections_blocker_); + if (this->input_sections_blocker_ != NULL) + tl->add(this, this->input_sections_blocker_); tl->add(this, this->final_blocker_); } diff --git a/binutils-2.25/gold/layout.h b/binutils-2.25/gold/layout.h index 7c0113cd..aec0c53b 100644 --- a/binutils-2.25/gold/layout.h +++ b/binutils-2.25/gold/layout.h @@ -1,6 +1,6 @@ // layout.h -- lay out output file sections for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -1454,9 +1454,11 @@ class Write_sections_task : public Task public: Write_sections_task(const Layout* layout, Output_file* of, Task_token* output_sections_blocker, + Task_token* input_sections_blocker, Task_token* final_blocker) : layout_(layout), of_(of), output_sections_blocker_(output_sections_blocker), + input_sections_blocker_(input_sections_blocker), final_blocker_(final_blocker) { } @@ -1481,6 +1483,7 @@ class Write_sections_task : public Task const Layout* layout_; Output_file* of_; Task_token* output_sections_blocker_; + Task_token* input_sections_blocker_; Task_token* final_blocker_; }; diff --git a/binutils-2.25/gold/main.cc b/binutils-2.25/gold/main.cc index bb866138..c5e50d61 100644 --- a/binutils-2.25/gold/main.cc +++ b/binutils-2.25/gold/main.cc @@ -1,6 +1,6 @@ // main.cc -- gold main function. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/mapfile.cc b/binutils-2.25/gold/mapfile.cc index dc995e9a..f2a9c424 100644 --- a/binutils-2.25/gold/mapfile.cc +++ b/binutils-2.25/gold/mapfile.cc @@ -1,6 +1,6 @@ // mapfile.cc -- map file generation for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -258,8 +258,11 @@ Mapfile::print_input_section(Relobj* relobj, unsigned int shndx) } char sizebuf[50]; + section_size_type size; + if (!relobj->section_is_compressed(shndx, &size)) + size = relobj->section_size(shndx); snprintf(sizebuf, sizeof sizebuf, "0x%llx", - static_cast(relobj->section_size(shndx))); + static_cast(size)); fprintf(this->map_file_, "0x%0*llx %10s %s\n", parameters->target().get_size() / 4, @@ -328,11 +331,13 @@ Mapfile::print_output_data(const Output_data* od, const char* name) char sizebuf[50]; snprintf(sizebuf, sizeof sizebuf, "0x%llx", - static_cast(od->data_size())); + static_cast(od->current_data_size())); fprintf(this->map_file_, "0x%0*llx %10s\n", parameters->target().get_size() / 4, - static_cast(od->address()), + (od->is_address_valid() + ? static_cast(od->address()) + : 0), sizebuf); } @@ -387,7 +392,7 @@ Mapfile::print_output_section(const Output_section* os) char sizebuf[50]; snprintf(sizebuf, sizeof sizebuf, "0x%llx", - static_cast(os->data_size())); + static_cast(os->current_data_size())); fprintf(this->map_file_, "0x%0*llx %10s", parameters->target().get_size() / 4, @@ -398,6 +403,9 @@ Mapfile::print_output_section(const Output_section* os) parameters->target().get_size() / 4, static_cast(os->load_address())); + if (os->requires_postprocessing()) + fprintf(this->map_file_, " (before compression)"); + putc('\n', this->map_file_); } diff --git a/binutils-2.25/gold/mapfile.h b/binutils-2.25/gold/mapfile.h index da158db4..4cc0d024 100644 --- a/binutils-2.25/gold/mapfile.h +++ b/binutils-2.25/gold/mapfile.h @@ -1,6 +1,6 @@ // mapfile.h -- map file generation for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/merge.cc b/binutils-2.25/gold/merge.cc index 6d444e6c..bf004818 100644 --- a/binutils-2.25/gold/merge.cc +++ b/binutils-2.25/gold/merge.cc @@ -1,6 +1,6 @@ // merge.cc -- handle section merging for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -162,15 +162,12 @@ Object_merge_map::get_output_offset(const Merge_map* merge_map, Input_merge_entry entry; entry.input_offset = input_offset; std::vector::const_iterator p = - std::lower_bound(map->entries.begin(), map->entries.end(), + std::upper_bound(map->entries.begin(), map->entries.end(), entry, Input_merge_compare()); - if (p == map->entries.end() || p->input_offset > input_offset) - { - if (p == map->entries.begin()) - return false; - --p; - gold_assert(p->input_offset <= input_offset); - } + if (p == map->entries.begin()) + return false; + --p; + gold_assert(p->input_offset <= input_offset); if (input_offset - p->input_offset >= static_cast(p->length)) @@ -564,9 +561,9 @@ Output_merge_string::do_add_input_section(Relobj* object, & (this->addralign() - 1)); bool has_misaligned_strings = false; - while (p < pend0) + while (p < pend) { - size_t len = string_length(p); + size_t len = p < pend0 ? string_length(p) : pend - p; // Within merge input section each string must be aligned. if (len != 0 @@ -581,17 +578,6 @@ Output_merge_string::do_add_input_section(Relobj* object, p += len + 1; i += (len + 1) * sizeof(Char_type); } - if (p < pend) - { - size_t len = pend - p; - - Stringpool::Key key; - this->stringpool_.add_with_length(p, len, true, &key); - - merged_strings.push_back(Merged_string(i, key)); - - i += (len + 1) * sizeof(Char_type); - } // Record the last offset in the input section so that we can // compute the length of the last string. diff --git a/binutils-2.25/gold/merge.h b/binutils-2.25/gold/merge.h index b4fd8e14..6318f458 100644 --- a/binutils-2.25/gold/merge.h +++ b/binutils-2.25/gold/merge.h @@ -1,6 +1,6 @@ // merge.h -- handle section merging for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/mips.cc b/binutils-2.25/gold/mips.cc index 92e12011..acf76cff 100644 --- a/binutils-2.25/gold/mips.cc +++ b/binutils-2.25/gold/mips.cc @@ -1,6 +1,6 @@ // mips.cc -- mips target support for gold. -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Sasa Stankovic // and Aleksandar Simeonov . // This file contains borrowed and adapted code from bfd/elfxx-mips.c. @@ -3761,11 +3761,11 @@ struct reloc_high reloc_high(unsigned char* _view, const Mips_relobj* _object, const Symbol_value* _psymval, Mips_address _addend, - unsigned int _r_type, bool _extract_addend, + unsigned int _r_type, unsigned int _r_sym, bool _extract_addend, Mips_address _address = 0, bool _gp_disp = false) : view(_view), object(_object), psymval(_psymval), addend(_addend), - r_type(_r_type), extract_addend(_extract_addend), address(_address), - gp_disp(_gp_disp) + r_type(_r_type), r_sym(_r_sym), extract_addend(_extract_addend), + address(_address), gp_disp(_gp_disp) { } unsigned char* view; @@ -3773,6 +3773,7 @@ struct reloc_high const Symbol_value* psymval; Mips_address addend; unsigned int r_type; + unsigned int r_sym; bool extract_addend; Mips_address address; bool gp_disp; @@ -4266,11 +4267,12 @@ class Mips_relocate_functions : public Relocate_functions relhi16(unsigned char* view, const Mips_relobj* object, const Symbol_value* psymval, Mips_address addend, Mips_address address, bool gp_disp, unsigned int r_type, - bool extract_addend) + unsigned int r_sym, bool extract_addend) { // Record the relocation. It will be resolved when we find lo16 part. hi16_relocs.push_back(reloc_high(view, object, psymval, - addend, r_type, extract_addend, address, gp_disp)); + addend, r_type, r_sym, extract_addend, address, + gp_disp)); return This::STATUS_OKAY; } @@ -4331,11 +4333,11 @@ class Mips_relocate_functions : public Relocate_functions relgot16_local(unsigned char* view, const Mips_relobj* object, const Symbol_value* psymval, Mips_address addend_a, - bool extract_addend, unsigned int r_type) + bool extract_addend, unsigned int r_type, unsigned int r_sym) { // Record the relocation. It will be resolved when we find lo16 part. got16_relocs.push_back(reloc_high(view, object, psymval, - addend_a, r_type, extract_addend)); + addend_a, r_type, r_sym, extract_addend)); return This::STATUS_OKAY; } @@ -4377,7 +4379,7 @@ class Mips_relocate_functions : public Relocate_functions const Mips_relobj* object, const Symbol_value* psymval, Mips_address addend_a, bool extract_addend, Mips_address address, bool is_gp_disp, - unsigned int r_type) + unsigned int r_type, unsigned int r_sym) { mips_reloc_unshuffle(view, r_type, false); Valtype32* wv = reinterpret_cast(view); @@ -4392,7 +4394,8 @@ class Mips_relocate_functions : public Relocate_functions while (it != hi16_relocs.end()) { reloc_high hi16 = *it; - if (hi16.psymval->value(hi16.object, 0) == psymval->value(object, 0)) + if (hi16.r_sym == r_sym + && is_matching_lo16_reloc(hi16.r_type, r_type)) { if (do_relhi16(hi16.view, hi16.object, hi16.psymval, hi16.addend, hi16.address, hi16.gp_disp, hi16.r_type, @@ -4411,7 +4414,8 @@ class Mips_relocate_functions : public Relocate_functions while (it2 != got16_relocs.end()) { reloc_high got16 = *it2; - if (got16.psymval->value(got16.object, 0) == psymval->value(object, 0)) + if (got16.r_sym == r_sym + && is_matching_lo16_reloc(got16.r_type, r_type)) { if (do_relgot16_local(got16.view, got16.object, got16.psymval, got16.addend, got16.r_type, @@ -9908,7 +9912,7 @@ Target_mips::Relocate::relocate( case elfcpp::R_MIPS16_HI16: case elfcpp::R_MICROMIPS_HI16: reloc_status = Reloc_funcs::relhi16(view, object, psymval, r_addend, - address, gp_disp, r_type, + address, gp_disp, r_type, r_sym, extract_addend); break; @@ -9918,7 +9922,7 @@ Target_mips::Relocate::relocate( case elfcpp::R_MICROMIPS_HI0_LO16: reloc_status = Reloc_funcs::rello16(target, view, object, psymval, r_addend, extract_addend, address, - gp_disp, r_type); + gp_disp, r_type, r_sym); break; case elfcpp::R_MIPS_LITERAL: @@ -10033,7 +10037,7 @@ Target_mips::Relocate::relocate( else reloc_status = Reloc_funcs::relgot16_local(view, object, psymval, r_addend, extract_addend, - r_type); + r_type, r_sym); update_got_entry = changed_symbol_value; break; diff --git a/binutils-2.25/gold/mremap.c b/binutils-2.25/gold/mremap.c index 9c0fe6ee..46590c08 100644 --- a/binutils-2.25/gold/mremap.c +++ b/binutils-2.25/gold/mremap.c @@ -1,6 +1,6 @@ /* mremap.c -- version of mremap for gold. */ -/* Copyright (C) 2009-2014 Free Software Foundation, Inc. +/* Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/nacl.cc b/binutils-2.25/gold/nacl.cc index 047f92e6..2b46ba37 100644 --- a/binutils-2.25/gold/nacl.cc +++ b/binutils-2.25/gold/nacl.cc @@ -1,6 +1,6 @@ // nacl.cc -- Native Client support for gold -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // This file is part of gold. diff --git a/binutils-2.25/gold/nacl.h b/binutils-2.25/gold/nacl.h index cb0e9d19..5b6f5a4c 100644 --- a/binutils-2.25/gold/nacl.h +++ b/binutils-2.25/gold/nacl.h @@ -1,6 +1,6 @@ // nacl.h -- Native Client support for gold -*- C++ -*- -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // This file is part of gold. diff --git a/binutils-2.25/gold/object.cc b/binutils-2.25/gold/object.cc index 6ab84cef..c90b67e8 100644 --- a/binutils-2.25/gold/object.cc +++ b/binutils-2.25/gold/object.cc @@ -1,6 +1,6 @@ // object.cc -- support for an object file for linking in gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -430,6 +430,7 @@ Sized_relobj_file::Sized_relobj_file( kept_comdat_sections_(), has_eh_frame_(false), discarded_eh_frame_shndx_(-1U), + is_deferred_layout_(false), deferred_layout_(), deferred_layout_relocs_(), compressed_sections_() @@ -1430,6 +1431,7 @@ Sized_relobj_file::do_layout(Symbol_table* symtab, { parameters->options().plugins()->add_deferred_layout_object(this); this->deferred_layout_.reserve(num_sections_to_defer); + this->is_deferred_layout_ = true; } // Whether we've seen a .note.GNU-stack section. @@ -1590,10 +1592,13 @@ Sized_relobj_file::do_layout(Symbol_table* symtab, { if (is_pass_one) { - out_sections[i] = reinterpret_cast(1); + if (this->is_deferred_layout()) + out_sections[i] = reinterpret_cast(2); + else + out_sections[i] = reinterpret_cast(1); out_section_offsets[i] = invalid_address; } - else if (should_defer_layout) + else if (this->is_deferred_layout()) this->deferred_layout_.push_back(Deferred_layout(i, name, pshdrs, reloc_shndx[i], @@ -1658,11 +1663,12 @@ Sized_relobj_file::do_layout(Symbol_table* symtab, } // Defer layout here if input files are claimed by plugins. When gc - // is turned on this function is called twice. For the second call - // should_defer_layout should be false. - if (should_defer_layout && (shdr.get_sh_flags() & elfcpp::SHF_ALLOC)) + // is turned on this function is called twice; we only want to do this + // on the first pass. + if (!is_pass_two + && this->is_deferred_layout() + && (shdr.get_sh_flags() & elfcpp::SHF_ALLOC)) { - gold_assert(!is_pass_two); this->deferred_layout_.push_back(Deferred_layout(i, name, pshdrs, reloc_shndx[i], @@ -1764,6 +1770,8 @@ Sized_relobj_file::do_layout(Symbol_table* symtab, Output_section* data_section = out_sections[data_shndx]; if (data_section == reinterpret_cast(2)) { + if (is_pass_two) + continue; // The layout for the data section was deferred, so we need // to defer the relocation section, too. const char* name = pnames + shdr.get_sh_name(); @@ -2581,7 +2589,7 @@ Sized_relobj_file::write_local_symbols( dyn_oview = of->get_output_view(this->local_dynsym_offset_, dyn_output_size); - const Output_sections out_sections(this->output_sections()); + const Output_sections& out_sections(this->output_sections()); gold_assert(this->local_values_.size() == loccount); diff --git a/binutils-2.25/gold/object.h b/binutils-2.25/gold/object.h index 754b1d26..cce6c8c2 100644 --- a/binutils-2.25/gold/object.h +++ b/binutils-2.25/gold/object.h @@ -1,6 +1,6 @@ // object.h -- support for an object file for linking in gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -2202,6 +2202,10 @@ class Sized_relobj_file : public Sized_relobj Symbol_value* lv_out, const Symbol_table* symtab); + // Return true if the layout for this object was deferred. + bool is_deferred_layout() const + { return this->is_deferred_layout_; } + protected: typedef typename Sized_relobj::Output_sections Output_sections; @@ -2740,6 +2744,9 @@ class Sized_relobj_file : public Sized_relobj // If this object has a GNU style .eh_frame section that is discarded in // output, record the index here. Otherwise it is -1U. unsigned int discarded_eh_frame_shndx_; + // True if the layout of this object was deferred, waiting for plugin + // replacement files. + bool is_deferred_layout_; // The list of sections whose layout was deferred. std::vector deferred_layout_; // The list of relocation sections whose layout was deferred. diff --git a/binutils-2.25/gold/options.cc b/binutils-2.25/gold/options.cc index 731061d5..7f1f69e0 100644 --- a/binutils-2.25/gold/options.cc +++ b/binutils-2.25/gold/options.cc @@ -1,6 +1,6 @@ // options.c -- handle command line options for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -1200,13 +1200,6 @@ General_options::finalize() // in the path, as appropriate. this->add_sysroot(); - // --dynamic-list overrides -Bsymbolic and -Bsymbolic-functions. - if (this->have_dynamic_list()) - { - this->set_Bsymbolic(false); - this->set_Bsymbolic_functions(false); - } - // Now that we've normalized the options, check for contradictory ones. if (this->shared() && this->is_static()) gold_fatal(_("-shared and -static are incompatible")); diff --git a/binutils-2.25/gold/options.h b/binutils-2.25/gold/options.h index cf3b7056..0d0072bc 100644 --- a/binutils-2.25/gold/options.h +++ b/binutils-2.25/gold/options.h @@ -1,6 +1,6 @@ // options.h -- handle command line options for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -1272,6 +1272,9 @@ class General_options NULL); DEFINE_bool(execstack, options::DASH_Z, '\0', false, N_("Mark output as requiring executable stack"), NULL); + DEFINE_bool(global, options::DASH_Z, '\0', false, + N_("Make symbols in DSO available for subsequently loaded " + "objects"), NULL); DEFINE_bool(initfirst, options::DASH_Z, '\0', false, N_("Mark DSO to be initialized first at runtime"), NULL); @@ -1324,6 +1327,9 @@ class General_options N_("Permit relocations in read-only segments (default)"), NULL, true); + DEFINE_bool(fix_cortex_a53_835769, options::TWO_DASHES, '\0', false, + N_("Ignored for now"), NULL); + public: typedef options::Dir_list Dir_list; diff --git a/binutils-2.25/gold/output.cc b/binutils-2.25/gold/output.cc index 3361991a..e9dd522b 100644 --- a/binutils-2.25/gold/output.cc +++ b/binutils-2.25/gold/output.cc @@ -1,6 +1,6 @@ // output.cc -- manage the output file for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -4311,8 +4311,8 @@ Output_segment::set_section_addresses(const Target* target, else { // FIXME: This could be faster. - (*p)->set_address_and_file_offset(addr + relro_size, - off + relro_size); + (*p)->set_address_and_file_offset(relro_size, + relro_size); relro_size += (*p)->data_size(); (*p)->reset_address_and_file_offset(); } @@ -4332,11 +4332,12 @@ Output_segment::set_section_addresses(const Target* target, // Align to offset N such that (N + RELRO_SIZE) % PAGE_ALIGN == 0. uint64_t desired_align = page_align - (aligned_size % page_align); - if (desired_align < *poff % page_align) - *poff += page_align - *poff % page_align; - *poff += desired_align - *poff % page_align; - addr += *poff - orig_off; - orig_off = *poff; + if (desired_align < off % page_align) + off += page_align; + off += desired_align - off % page_align; + addr += off - orig_off; + orig_off = off; + *poff = off; } if (!reset && this->are_addresses_set_) diff --git a/binutils-2.25/gold/output.h b/binutils-2.25/gold/output.h index ba0cdaab..8e0c33a3 100644 --- a/binutils-2.25/gold/output.h +++ b/binutils-2.25/gold/output.h @@ -1,6 +1,6 @@ // output.h -- manage the output file for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -1714,6 +1714,17 @@ class Output_data_reloc address, true, true, false, false)); } + void + add_local_relative(Sized_relobj* relobj, + unsigned int local_sym_index, unsigned int type, + Output_data* od, unsigned int shndx, Address address, + bool use_plt_offset) + { + this->add(od, Output_reloc_type(relobj, local_sym_index, type, shndx, + address, true, true, false, + use_plt_offset)); + } + // Add a local relocation which does not use a symbol for the relocation, // but which gets its addend from a symbol. diff --git a/binutils-2.25/gold/parameters.cc b/binutils-2.25/gold/parameters.cc index 588f448a..dbda690d 100644 --- a/binutils-2.25/gold/parameters.cc +++ b/binutils-2.25/gold/parameters.cc @@ -1,6 +1,6 @@ // parameters.cc -- general parameters for a link using gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/parameters.h b/binutils-2.25/gold/parameters.h index fe5db157..6404b8a7 100644 --- a/binutils-2.25/gold/parameters.h +++ b/binutils-2.25/gold/parameters.h @@ -1,6 +1,6 @@ // parameters.h -- general parameters for a link using gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/plugin.cc b/binutils-2.25/gold/plugin.cc index 0339d428..68da8e36 100644 --- a/binutils-2.25/gold/plugin.cc +++ b/binutils-2.25/gold/plugin.cc @@ -1,6 +1,6 @@ // plugin.cc -- plugin manager for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. @@ -427,6 +427,7 @@ Plugin_manager::~Plugin_manager() ++obj) delete *obj; this->objects_.clear(); + delete this->lock_; } // Load all plugin libraries. @@ -447,6 +448,10 @@ Pluginobj* Plugin_manager::claim_file(Input_file* input_file, off_t offset, off_t filesize, Object* elf_object) { + bool lock_initialized = this->initialize_lock_.initialize(); + + gold_assert(lock_initialized); + Hold_lock hl(*this->lock_); if (this->in_replacement_phase_) return NULL; @@ -909,7 +914,8 @@ is_visible_from_outside(Symbol* lsym) // Get symbol resolution info. ld_plugin_status -Pluginobj::get_symbol_resolution_info(int nsyms, +Pluginobj::get_symbol_resolution_info(Symbol_table* symtab, + int nsyms, ld_plugin_symbol* syms, int version) const { @@ -938,6 +944,8 @@ Pluginobj::get_symbol_resolution_info(int nsyms, { ld_plugin_symbol* isym = &syms[i]; Symbol* lsym = this->symbols_[i]; + if (lsym->is_forwarder()) + lsym = symtab->resolve_forwards(lsym); ld_plugin_symbol_resolution res = LDPR_UNKNOWN; if (lsym->is_undefined()) @@ -1506,14 +1514,16 @@ static enum ld_plugin_status get_symbols(const void* handle, int nsyms, ld_plugin_symbol* syms) { gold_assert(parameters->options().has_plugins()); - Object* obj = parameters->options().plugins()->object( + Plugin_manager* plugins = parameters->options().plugins(); + Object* obj = plugins->object( static_cast(reinterpret_cast(handle))); if (obj == NULL) return LDPS_ERR; Pluginobj* plugin_obj = obj->pluginobj(); if (plugin_obj == NULL) return LDPS_ERR; - return plugin_obj->get_symbol_resolution_info(nsyms, syms, 1); + Symbol_table* symtab = plugins->symtab(); + return plugin_obj->get_symbol_resolution_info(symtab, nsyms, syms, 1); } // Version 2 of the above. The only difference is that this version @@ -1523,14 +1533,16 @@ static enum ld_plugin_status get_symbols_v2(const void* handle, int nsyms, ld_plugin_symbol* syms) { gold_assert(parameters->options().has_plugins()); - Object* obj = parameters->options().plugins()->object( + Plugin_manager* plugins = parameters->options().plugins(); + Object* obj = plugins->object( static_cast(reinterpret_cast(handle))); if (obj == NULL) return LDPS_ERR; Pluginobj* plugin_obj = obj->pluginobj(); if (plugin_obj == NULL) return LDPS_ERR; - return plugin_obj->get_symbol_resolution_info(nsyms, syms, 2); + Symbol_table* symtab = plugins->symtab(); + return plugin_obj->get_symbol_resolution_info(symtab, nsyms, syms, 2); } // Add a new (real) input file generated by a plugin. diff --git a/binutils-2.25/gold/plugin.h b/binutils-2.25/gold/plugin.h index 9ef28129..f9268798 100644 --- a/binutils-2.25/gold/plugin.h +++ b/binutils-2.25/gold/plugin.h @@ -1,6 +1,6 @@ // plugin.h -- plugin manager for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. @@ -134,7 +134,8 @@ class Plugin_manager in_claim_file_handler_(false), options_(options), workqueue_(NULL), task_(NULL), input_objects_(NULL), symtab_(NULL), layout_(NULL), dirpath_(NULL), mapfile_(NULL), - this_blocker_(NULL), extra_search_path_() + this_blocker_(NULL), extra_search_path_(), lock_(NULL), + initialize_lock_(&lock_) { this->current_ = plugins_.end(); } ~Plugin_manager(); @@ -281,6 +282,10 @@ class Plugin_manager input_objects() const { return this->input_objects_; } + Symbol_table* + symtab() + { return this->symtab_; } + Layout* layout() { return this->layout_; } @@ -376,6 +381,8 @@ class Plugin_manager // An extra directory to seach for the libraries passed by // add_input_library. std::string extra_search_path_; + Lock* lock_; + Initialize_lock initialize_lock_; }; @@ -393,7 +400,8 @@ class Pluginobj : public Object // Fill in the symbol resolution status for the given plugin symbols. ld_plugin_status - get_symbol_resolution_info(int nsyms, + get_symbol_resolution_info(Symbol_table* symtab, + int nsyms, ld_plugin_symbol* syms, int version) const; diff --git a/binutils-2.25/gold/po/Make-in b/binutils-2.25/gold/po/Make-in index 8212bf74..8886c9a7 100644 --- a/binutils-2.25/gold/po/Make-in +++ b/binutils-2.25/gold/po/Make-in @@ -1,6 +1,6 @@ # Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2015 Free Software Foundation, Inc. # # This file may be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License diff --git a/binutils-2.25/gold/powerpc.cc b/binutils-2.25/gold/powerpc.cc index 828bc167..4deb5afb 100644 --- a/binutils-2.25/gold/powerpc.cc +++ b/binutils-2.25/gold/powerpc.cc @@ -1,6 +1,6 @@ // powerpc.cc -- powerpc target support for gold. -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by David S. Miller // and David Edelsohn @@ -62,6 +62,15 @@ class Output_data_glink; template class Stub_table; +template +class Target_powerpc; + +struct Stub_table_owner +{ + Output_section* output_section; + const Output_section::Input_section* owner; +}; + inline bool is_branch_reloc(unsigned int r_type); @@ -77,7 +86,7 @@ public: const typename elfcpp::Ehdr& ehdr) : Sized_relobj_file(name, input_file, offset, ehdr), special_(0), has_small_toc_reloc_(false), opd_valid_(false), - opd_ent_(), access_from_map_(), has14_(), stub_table_(), + opd_ent_(), access_from_map_(), has14_(), stub_table_index_(), e_flags_(ehdr.get_e_flags()), st_other_() { this->set_abiversion(0); @@ -260,21 +269,34 @@ public: { return shndx < this->has14_.size() && this->has14_[shndx]; } void - set_stub_table(unsigned int shndx, Stub_table* stub_table) + set_stub_table(unsigned int shndx, unsigned int stub_index) { - if (shndx >= this->stub_table_.size()) - this->stub_table_.resize(shndx + 1); - this->stub_table_[shndx] = stub_table; + if (shndx >= this->stub_table_index_.size()) + this->stub_table_index_.resize(shndx + 1); + this->stub_table_index_[shndx] = stub_index; } Stub_table* stub_table(unsigned int shndx) { - if (shndx < this->stub_table_.size()) - return this->stub_table_[shndx]; + if (shndx < this->stub_table_index_.size()) + { + Target_powerpc* target + = static_cast*>( + parameters->sized_target()); + unsigned int indx = this->stub_table_index_[shndx]; + gold_assert(indx < target->stub_tables().size()); + return target->stub_tables()[indx]; + } return NULL; } + void + clear_stub_table() + { + this->stub_table_index_.clear(); + } + int abiversion() const { return this->e_flags_ & elfcpp::EF_PPC64_ABI; } @@ -343,7 +365,7 @@ private: std::vector has14_; // The stub table to use for a given input section. - std::vector*> stub_table_; + std::vector stub_table_index_; // Header e_flags elfcpp::Elf_Word e_flags_; @@ -487,7 +509,8 @@ class Target_powerpc : public Sized_target glink_(NULL), rela_dyn_(NULL), copy_relocs_(elfcpp::R_POWERPC_COPY), tlsld_got_offset_(-1U), stub_tables_(), branch_lookup_table_(), branch_info_(), - plt_thread_safe_(false) + plt_thread_safe_(false), relax_failed_(false), relax_fail_count_(0), + stub_group_size_(0) { } @@ -562,9 +585,6 @@ class Target_powerpc : public Sized_target ppc_object->set_has_14bit_branch(data_shndx); } - Stub_table* - new_stub_table(); - void do_define_standard_symbols(Symbol_table*, Layout*); @@ -1015,11 +1035,11 @@ class Target_powerpc : public Sized_target bool issued_non_pic_error_; }; - Address - symval_for_branch(const Symbol_table* symtab, Address value, + bool + symval_for_branch(const Symbol_table* symtab, const Sized_symbol* gsym, Powerpc_relobj* object, - unsigned int *dest_shndx); + Address *value, unsigned int *dest_shndx); // The class which implements relocation. class Relocate : protected Track_tls @@ -1179,7 +1199,7 @@ class Target_powerpc : public Sized_target // Look over all the input sections, deciding where to place stubs. void - group_sections(Layout*, const Task*); + group_sections(Layout*, const Task*, bool); // Sort output sections by address. struct Sort_sections @@ -1206,7 +1226,7 @@ class Target_powerpc : public Sized_target { } // If this branch needs a plt call stub, or a long branch stub, make one. - void + bool make_stub(Stub_table*, Stub_table*, Symbol_table*) const; @@ -1284,6 +1304,10 @@ class Target_powerpc : public Sized_target Branches branch_info_; bool plt_thread_safe_; + + bool relax_failed_; + int relax_fail_count_; + int32_t stub_group_size_; }; template<> @@ -1524,58 +1548,58 @@ private: } // Do a simple RELA relocation - template + template static inline Status rela(unsigned char* view, Address value, Overflow_check overflow) { - typedef typename elfcpp::Swap::Valtype Valtype; + typedef typename elfcpp::Swap::Valtype Valtype; Valtype* wv = reinterpret_cast(view); - elfcpp::Swap::writeval(wv, value); + elfcpp::Swap::writeval(wv, value); return overflowed(value, overflow); } - template + template static inline Status rela(unsigned char* view, unsigned int right_shift, - typename elfcpp::Valtype_base::Valtype dst_mask, + typename elfcpp::Valtype_base::Valtype dst_mask, Address value, Overflow_check overflow) { - typedef typename elfcpp::Swap::Valtype Valtype; + typedef typename elfcpp::Swap::Valtype Valtype; Valtype* wv = reinterpret_cast(view); - Valtype val = elfcpp::Swap::readval(wv); + Valtype val = elfcpp::Swap::readval(wv); Valtype reloc = value >> right_shift; val &= ~dst_mask; reloc &= dst_mask; - elfcpp::Swap::writeval(wv, val | reloc); + elfcpp::Swap::writeval(wv, val | reloc); return overflowed(value >> right_shift, overflow); } // Do a simple RELA relocation, unaligned. - template + template static inline Status rela_ua(unsigned char* view, Address value, Overflow_check overflow) { - elfcpp::Swap_unaligned::writeval(view, value); + elfcpp::Swap_unaligned::writeval(view, value); return overflowed(value, overflow); } - template + template static inline Status rela_ua(unsigned char* view, unsigned int right_shift, - typename elfcpp::Valtype_base::Valtype dst_mask, + typename elfcpp::Valtype_base::Valtype dst_mask, Address value, Overflow_check overflow) { - typedef typename elfcpp::Swap_unaligned::Valtype + typedef typename elfcpp::Swap_unaligned::Valtype Valtype; - Valtype val = elfcpp::Swap::readval(view); + Valtype val = elfcpp::Swap::readval(view); Valtype reloc = value >> right_shift; val &= ~dst_mask; reloc &= dst_mask; - elfcpp::Swap_unaligned::writeval(view, val | reloc); + elfcpp::Swap_unaligned::writeval(view, val | reloc); return overflowed(value >> right_shift, overflow); } @@ -1583,28 +1607,29 @@ public: // R_PPC64_ADDR64: (Symbol + Addend) static inline void addr64(unsigned char* view, Address value) - { This::template rela<64>(view, value, CHECK_NONE); } + { This::template rela<64,64>(view, value, CHECK_NONE); } // R_PPC64_UADDR64: (Symbol + Addend) unaligned static inline void addr64_u(unsigned char* view, Address value) - { This::template rela_ua<64>(view, value, CHECK_NONE); } + { This::template rela_ua<64,64>(view, value, CHECK_NONE); } // R_POWERPC_ADDR32: (Symbol + Addend) static inline Status addr32(unsigned char* view, Address value, Overflow_check overflow) - { return This::template rela<32>(view, value, overflow); } + { return This::template rela<32,32>(view, value, overflow); } // R_POWERPC_UADDR32: (Symbol + Addend) unaligned static inline Status addr32_u(unsigned char* view, Address value, Overflow_check overflow) - { return This::template rela_ua<32>(view, value, overflow); } + { return This::template rela_ua<32,32>(view, value, overflow); } // R_POWERPC_ADDR24: (Symbol + Addend) & 0x3fffffc static inline Status addr24(unsigned char* view, Address value, Overflow_check overflow) { - Status stat = This::template rela<32>(view, 0, 0x03fffffc, value, overflow); + Status stat = This::template rela<32,26>(view, 0, 0x03fffffc, + value, overflow); if (overflow != CHECK_NONE && (value & 3) != 0) stat = STATUS_OVERFLOW; return stat; @@ -1613,18 +1638,18 @@ public: // R_POWERPC_ADDR16: (Symbol + Addend) & 0xffff static inline Status addr16(unsigned char* view, Address value, Overflow_check overflow) - { return This::template rela<16>(view, value, overflow); } + { return This::template rela<16,16>(view, value, overflow); } // R_POWERPC_ADDR16: (Symbol + Addend) & 0xffff, unaligned static inline Status addr16_u(unsigned char* view, Address value, Overflow_check overflow) - { return This::template rela_ua<16>(view, value, overflow); } + { return This::template rela_ua<16,16>(view, value, overflow); } // R_POWERPC_ADDR16_DS: (Symbol + Addend) & 0xfffc static inline Status addr16_ds(unsigned char* view, Address value, Overflow_check overflow) { - Status stat = This::template rela<16>(view, 0, 0xfffc, value, overflow); + Status stat = This::template rela<16,16>(view, 0, 0xfffc, value, overflow); if (overflow != CHECK_NONE && (value & 3) != 0) stat = STATUS_OVERFLOW; return stat; @@ -1633,7 +1658,7 @@ public: // R_POWERPC_ADDR16_HI: ((Symbol + Addend) >> 16) & 0xffff static inline void addr16_hi(unsigned char* view, Address value) - { This::template rela<16>(view, 16, 0xffff, value, CHECK_NONE); } + { This::template rela<16,16>(view, 16, 0xffff, value, CHECK_NONE); } // R_POWERPC_ADDR16_HA: ((Symbol + Addend + 0x8000) >> 16) & 0xffff static inline void @@ -1643,7 +1668,7 @@ public: // R_POWERPC_ADDR16_HIGHER: ((Symbol + Addend) >> 32) & 0xffff static inline void addr16_hi2(unsigned char* view, Address value) - { This::template rela<16>(view, 32, 0xffff, value, CHECK_NONE); } + { This::template rela<16,16>(view, 32, 0xffff, value, CHECK_NONE); } // R_POWERPC_ADDR16_HIGHERA: ((Symbol + Addend + 0x8000) >> 32) & 0xffff static inline void @@ -1653,7 +1678,7 @@ public: // R_POWERPC_ADDR16_HIGHEST: ((Symbol + Addend) >> 48) & 0xffff static inline void addr16_hi3(unsigned char* view, Address value) - { This::template rela<16>(view, 48, 0xffff, value, CHECK_NONE); } + { This::template rela<16,16>(view, 48, 0xffff, value, CHECK_NONE); } // R_POWERPC_ADDR16_HIGHESTA: ((Symbol + Addend + 0x8000) >> 48) & 0xffff static inline void @@ -1664,7 +1689,7 @@ public: static inline Status addr14(unsigned char* view, Address value, Overflow_check overflow) { - Status stat = This::template rela<32>(view, 0, 0xfffc, value, overflow); + Status stat = This::template rela<32,16>(view, 0, 0xfffc, value, overflow); if (overflow != CHECK_NONE && (value & 3) != 0) stat = STATUS_OVERFLOW; return stat; @@ -2360,27 +2385,13 @@ class Stub_control // value of the parameter --stub-group-size. If --stub-group-size // is passed a negative value, we restrict stubs to be always before // the stubbed branches. - Stub_control(int32_t size) + Stub_control(int32_t size, bool no_size_errors) : state_(NO_GROUP), stub_group_size_(abs(size)), - stub14_group_size_(abs(size)), - stubs_always_before_branch_(size < 0), suppress_size_errors_(false), + stub14_group_size_(abs(size) >> 10), + stubs_always_before_branch_(size < 0), + suppress_size_errors_(no_size_errors), group_end_addr_(0), owner_(NULL), output_section_(NULL) { - if (stub_group_size_ == 1) - { - // Default values. - if (stubs_always_before_branch_) - { - stub_group_size_ = 0x1e00000; - stub14_group_size_ = 0x7800; - } - else - { - stub_group_size_ = 0x1c00000; - stub14_group_size_ = 0x7000; - } - suppress_size_errors_ = true; - } } // Return true iff input section can be handled by current stub @@ -2398,6 +2409,14 @@ class Stub_control output_section() { return output_section_; } + void + set_output_and_owner(Output_section* o, + const Output_section::Input_section* i) + { + this->output_section_ = o; + this->owner_ = i; + } + private: typedef enum { @@ -2486,12 +2505,14 @@ Stub_control::can_add_to_stub_group(Output_section* o, template void Target_powerpc::group_sections(Layout* layout, - const Task*) + const Task*, + bool no_size_errors) { - Stub_control stub_control(parameters->options().stub_group_size()); + Stub_control stub_control(this->stub_group_size_, no_size_errors); // Group input sections and insert stub table - Stub_table* stub_table = NULL; + Stub_table_owner* table_owner = NULL; + std::vector tables; Layout::Section_list section_list; layout->get_executable_sections(§ion_list); std::stable_sort(section_list.begin(), section_list.end(), Sort_sections()); @@ -2505,49 +2526,89 @@ Target_powerpc::group_sections(Layout* layout, i != (*o)->input_sections().rend(); ++i) { - if (i->is_input_section()) + if (i->is_input_section() + || i->is_relaxed_input_section()) { Powerpc_relobj* ppcobj = static_cast *>(i->relobj()); bool has14 = ppcobj->has_14bit_branch(i->shndx()); if (!stub_control.can_add_to_stub_group(*o, &*i, has14)) { - stub_table->init(stub_control.owner(), - stub_control.output_section()); - stub_table = NULL; + table_owner->output_section = stub_control.output_section(); + table_owner->owner = stub_control.owner(); + stub_control.set_output_and_owner(*o, &*i); + table_owner = NULL; + } + if (table_owner == NULL) + { + table_owner = new Stub_table_owner; + tables.push_back(table_owner); } - if (stub_table == NULL) - stub_table = this->new_stub_table(); - ppcobj->set_stub_table(i->shndx(), stub_table); + ppcobj->set_stub_table(i->shndx(), tables.size() - 1); } } } - if (stub_table != NULL) + if (table_owner != NULL) { const Output_section::Input_section* i = stub_control.owner(); - if (!i->is_input_section()) + + if (tables.size() >= 2 && tables[tables.size() - 2]->owner == i) { // Corner case. A new stub group was made for the first // section (last one looked at here) for some reason, but // the first section is already being used as the owner for // a stub table for following sections. Force it into that // stub group. - gold_assert(this->stub_tables_.size() >= 2); - this->stub_tables_.pop_back(); - delete stub_table; + tables.pop_back(); + delete table_owner; Powerpc_relobj* ppcobj = static_cast *>(i->relobj()); - ppcobj->set_stub_table(i->shndx(), this->stub_tables_.back()); + ppcobj->set_stub_table(i->shndx(), tables.size() - 1); } else - stub_table->init(i, stub_control.output_section()); + { + table_owner->output_section = stub_control.output_section(); + table_owner->owner = i; + } } + for (typename std::vector::iterator t = tables.begin(); + t != tables.end(); + ++t) + { + Stub_table* stub_table; + + if ((*t)->owner->is_input_section()) + stub_table = new Stub_table(this, + (*t)->output_section, + (*t)->owner); + else if ((*t)->owner->is_relaxed_input_section()) + stub_table = static_cast*>( + (*t)->owner->relaxed_input_section()); + else + gold_unreachable(); + this->stub_tables_.push_back(stub_table); + delete *t; + } +} + +static unsigned long +max_branch_delta (unsigned int r_type) +{ + if (r_type == elfcpp::R_POWERPC_REL14 + || r_type == elfcpp::R_POWERPC_REL14_BRTAKEN + || r_type == elfcpp::R_POWERPC_REL14_BRNTAKEN) + return 1L << 15; + if (r_type == elfcpp::R_POWERPC_REL24 + || r_type == elfcpp::R_PPC_PLTREL24 + || r_type == elfcpp::R_PPC_LOCAL24PC) + return 1L << 25; + return 0; } // If this branch needs a plt call stub, or a long branch stub, make one. template -void +bool Target_powerpc::Branch_info::make_stub( Stub_table* stub_table, Stub_table* ifunc_stub_table, @@ -2580,27 +2641,25 @@ Target_powerpc::Branch_info::make_stub( stub_table = ifunc_stub_table; } gold_assert(stub_table != NULL); + Address from = this->object_->get_output_section_offset(this->shndx_); + if (from != invalid_address) + from += (this->object_->output_section(this->shndx_)->address() + + this->offset_); if (gsym != NULL) - stub_table->add_plt_call_entry(this->object_, gsym, - this->r_type_, this->addend_); + return stub_table->add_plt_call_entry(from, + this->object_, gsym, + this->r_type_, this->addend_); else - stub_table->add_plt_call_entry(this->object_, this->r_sym_, - this->r_type_, this->addend_); + return stub_table->add_plt_call_entry(from, + this->object_, this->r_sym_, + this->r_type_, this->addend_); } } else { - unsigned long max_branch_offset; - if (this->r_type_ == elfcpp::R_POWERPC_REL14 - || this->r_type_ == elfcpp::R_POWERPC_REL14_BRTAKEN - || this->r_type_ == elfcpp::R_POWERPC_REL14_BRNTAKEN) - max_branch_offset = 1 << 15; - else if (this->r_type_ == elfcpp::R_POWERPC_REL24 - || this->r_type_ == elfcpp::R_PPC_PLTREL24 - || this->r_type_ == elfcpp::R_PPC_LOCAL24PC) - max_branch_offset = 1 << 25; - else - return; + Address max_branch_offset = max_branch_delta(this->r_type_); + if (max_branch_offset == 0) + return true; Address from = this->object_->get_output_section_offset(this->shndx_); gold_assert(from != invalid_address); from += (this->object_->output_section(this->shndx_)->address() @@ -2615,16 +2674,16 @@ Target_powerpc::Branch_info::make_stub( Object* symobj = gsym->object(); if (symobj->is_dynamic() || symobj->pluginobj() != NULL) - return; + return true; bool is_ordinary; unsigned int shndx = gsym->shndx(&is_ordinary); if (shndx == elfcpp::SHN_UNDEF) - return; + return true; } break; case Symbol::IS_UNDEFINED: - return; + return true; default: break; @@ -2632,7 +2691,7 @@ Target_powerpc::Branch_info::make_stub( Symbol_table::Compute_final_value_status status; to = symtab->compute_final_value(gsym, &status); if (status != Symbol_table::CFVS_OK) - return; + return true; if (size == 64) to += this->object_->ppc64_local_entry_offset(gsym); } @@ -2647,19 +2706,21 @@ Target_powerpc::Branch_info::make_stub( &symval, symtab); if (status != ObjType::CFLV_OK || !symval.has_output_value()) - return; + return true; to = symval.value(this->object_, 0); if (size == 64) to += this->object_->ppc64_local_entry_offset(this->r_sym_); } - to += this->addend_; + if (!(size == 32 && this->r_type_ == elfcpp::R_PPC_PLTREL24)) + to += this->addend_; if (stub_table == NULL) stub_table = this->object_->stub_table(this->shndx_); if (size == 64 && target->abiversion() < 2) { unsigned int dest_shndx; - to = target->symval_for_branch(symtab, to, gsym, - this->object_, &dest_shndx); + if (!target->symval_for_branch(symtab, gsym, this->object_, + &to, &dest_shndx)) + return true; } Address delta = to - from; if (delta + max_branch_offset >= 2 * max_branch_offset) @@ -2670,11 +2731,13 @@ Target_powerpc::Branch_info::make_stub( " no long branch stub for you"), this->object_->name().c_str(), this->object_->section_name(this->shndx_).c_str()); - return; + return true; } - stub_table->add_long_branch_entry(this->object_, to); + return stub_table->add_long_branch_entry(this->object_, + this->r_type_, from, to); } } + return true; } // Relaxation hook. This is where we do stub generation. @@ -2720,6 +2783,8 @@ Target_powerpc::do_relax(int pass, "GOMP_parallel_loop_runtime_start", "GOMP_parallel_sections", "GOMP_parallel_sections_start", + /* libgo */ + "__go_go", }; if (parameters->options().shared()) @@ -2740,7 +2805,34 @@ Target_powerpc::do_relax(int pass, } } this->plt_thread_safe_ = thread_safe; - this->group_sections(layout, task); + } + + if (pass == 1) + { + this->stub_group_size_ = parameters->options().stub_group_size(); + bool no_size_errors = true; + if (this->stub_group_size_ == 1) + this->stub_group_size_ = 0x1c00000; + else if (this->stub_group_size_ == -1) + this->stub_group_size_ = -0x1e00000; + else + no_size_errors = false; + this->group_sections(layout, task, no_size_errors); + } + else if (this->relax_failed_ && this->relax_fail_count_ < 3) + { + this->branch_lookup_table_.clear(); + for (typename Stub_tables::iterator p = this->stub_tables_.begin(); + p != this->stub_tables_.end(); + ++p) + { + (*p)->clear_stubs(true); + } + this->stub_tables_.clear(); + this->stub_group_size_ = this->stub_group_size_ / 4 * 3; + gold_info(_("%s: stub group size is too large; retrying with %d"), + program_name, this->stub_group_size_); + this->group_sections(layout, task, true); } // We need address of stub tables valid for make_stub. @@ -2765,11 +2857,12 @@ Target_powerpc::do_relax(int pass, p != this->stub_tables_.end(); ++p) { - (*p)->clear_stubs(); + (*p)->clear_stubs(false); } } // Build all the stubs. + this->relax_failed_ = false; Stub_table* ifunc_stub_table = this->stub_tables_.size() == 0 ? NULL : this->stub_tables_[0]; Stub_table* one_stub_table @@ -2778,7 +2871,14 @@ Target_powerpc::do_relax(int pass, b != this->branch_info_.end(); b++) { - b->make_stub(one_stub_table, ifunc_stub_table, symtab); + if (!b->make_stub(one_stub_table, ifunc_stub_table, symtab) + && !this->relax_failed_) + { + this->relax_failed_ = true; + this->relax_fail_count_++; + if (this->relax_fail_count_ < 3) + return true; + } } // Did anything change size? @@ -3078,8 +3178,6 @@ static const uint32_t addi_11_11 = 0x396b0000; static const uint32_t addi_12_12 = 0x398c0000; static const uint32_t addis_0_2 = 0x3c020000; static const uint32_t addis_0_13 = 0x3c0d0000; -static const uint32_t addis_3_2 = 0x3c620000; -static const uint32_t addis_3_13 = 0x3c6d0000; static const uint32_t addis_11_2 = 0x3d620000; static const uint32_t addis_11_11 = 0x3d6b0000; static const uint32_t addis_11_30 = 0x3d7e0000; @@ -3463,26 +3561,35 @@ class Stub_table : public Output_relaxed_input_section typedef typename elfcpp::Elf_types::Elf_Addr Address; static const Address invalid_address = static_cast
(0) - 1; - Stub_table(Target_powerpc* targ) - : Output_relaxed_input_section(NULL, 0, 0), + Stub_table(Target_powerpc* targ, + Output_section* output_section, + const Output_section::Input_section* owner) + : Output_relaxed_input_section(owner->relobj(), owner->shndx(), + owner->relobj() + ->section_addralign(owner->shndx())), targ_(targ), plt_call_stubs_(), long_branch_stubs_(), - orig_data_size_(0), plt_size_(0), last_plt_size_(0), + orig_data_size_(owner->current_data_size()), + plt_size_(0), last_plt_size_(0), branch_size_(0), last_branch_size_(0), eh_frame_added_(false) - { } + { + this->set_output_section(output_section); - // Delayed Output_relaxed_input_section init. - void - init(const Output_section::Input_section*, Output_section*); + std::vector new_relaxed; + new_relaxed.push_back(this); + output_section->convert_input_sections_to_relaxed_sections(new_relaxed); + } // Add a plt call stub. - void - add_plt_call_entry(const Sized_relobj_file*, + bool + add_plt_call_entry(Address, + const Sized_relobj_file*, const Symbol*, unsigned int, Address); - void - add_plt_call_entry(const Sized_relobj_file*, + bool + add_plt_call_entry(Address, + const Sized_relobj_file*, unsigned int, unsigned int, Address); @@ -3508,20 +3615,37 @@ class Stub_table : public Output_relaxed_input_section Address) const; // Add a long branch stub. - void - add_long_branch_entry(const Powerpc_relobj*, Address); + bool + add_long_branch_entry(const Powerpc_relobj*, + unsigned int, Address, Address); Address find_long_branch_entry(const Powerpc_relobj*, Address) const; + bool + can_reach_stub(Address from, unsigned int off, unsigned int r_type) + { + Address max_branch_offset = max_branch_delta(r_type); + if (max_branch_offset == 0) + return true; + gold_assert(from != invalid_address); + Address loc = off + this->stub_address(); + return loc - from + max_branch_offset < 2 * max_branch_offset; + } + void - clear_stubs() + clear_stubs(bool all) { this->plt_call_stubs_.clear(); this->plt_size_ = 0; this->long_branch_stubs_.clear(); this->branch_size_ = 0; + if (all) + { + this->last_plt_size_ = 0; + this->last_branch_size_ = 0; + } } Address @@ -3825,44 +3949,13 @@ class Stub_table : public Output_relaxed_input_section bool eh_frame_added_; }; -// Make a new stub table, and record. - -template -Stub_table* -Target_powerpc::new_stub_table() -{ - Stub_table* stub_table - = new Stub_table(this); - this->stub_tables_.push_back(stub_table); - return stub_table; -} - -// Delayed stub table initialisation, because we create the stub table -// before we know to which section it will be attached. - -template -void -Stub_table::init( - const Output_section::Input_section* owner, - Output_section* output_section) -{ - this->set_relobj(owner->relobj()); - this->set_shndx(owner->shndx()); - this->set_addralign(this->relobj()->section_addralign(this->shndx())); - this->set_output_section(output_section); - this->orig_data_size_ = owner->current_data_size(); - - std::vector new_relaxed; - new_relaxed.push_back(this); - output_section->convert_input_sections_to_relaxed_sections(new_relaxed); -} - // Add a plt call stub, if we do not already have one for this // sym/object/addend combo. template -void +bool Stub_table::add_plt_call_entry( + Address from, const Sized_relobj_file* object, const Symbol* gsym, unsigned int r_type, @@ -3874,11 +3967,13 @@ Stub_table::add_plt_call_entry( = this->plt_call_stubs_.insert(std::make_pair(ent, off)); if (p.second) this->plt_size_ = off + this->plt_call_size(p.first); + return this->can_reach_stub(from, off, r_type); } template -void +bool Stub_table::add_plt_call_entry( + Address from, const Sized_relobj_file* object, unsigned int locsym_index, unsigned int r_type, @@ -3890,6 +3985,7 @@ Stub_table::add_plt_call_entry( = this->plt_call_stubs_.insert(std::make_pair(ent, off)); if (p.second) this->plt_size_ = off + this->plt_call_size(p.first); + return this->can_reach_stub(from, off, r_type); } // Find a plt call stub. @@ -3944,9 +4040,11 @@ Stub_table::find_plt_call_entry( // destination. template -void +bool Stub_table::add_long_branch_entry( const Powerpc_relobj* object, + unsigned int r_type, + Address from, Address to) { Branch_stub_ent ent(object, to); @@ -3958,6 +4056,7 @@ Stub_table::add_long_branch_entry( if (size == 64 && stub_size != 4) this->targ_->add_branch_lookup_table(to); } + return this->can_reach_stub(from, off, r_type); } // Find long branch stub. @@ -5467,10 +5566,10 @@ Target_powerpc::Scan::local( { Reloc_section* rela_dyn = target->rela_dyn_section(symtab, layout, is_ifunc); + unsigned int r_sym = elfcpp::elf_r_sym(reloc.get_r_info()); if ((size == 32 && r_type == elfcpp::R_POWERPC_ADDR32) || (size == 64 && r_type == elfcpp::R_PPC64_ADDR64)) { - unsigned int r_sym = elfcpp::elf_r_sym(reloc.get_r_info()); unsigned int dynrel = (is_ifunc ? elfcpp::R_POWERPC_IRELATIVE : elfcpp::R_POWERPC_RELATIVE); rela_dyn->add_local_relative(object, r_sym, dynrel, @@ -5478,14 +5577,28 @@ Target_powerpc::Scan::local( reloc.get_r_offset(), reloc.get_r_addend(), false); } - else + else if (lsym.get_st_type() != elfcpp::STT_SECTION) { check_non_pic(object, r_type); - unsigned int r_sym = elfcpp::elf_r_sym(reloc.get_r_info()); rela_dyn->add_local(object, r_sym, r_type, output_section, data_shndx, reloc.get_r_offset(), reloc.get_r_addend()); } + else + { + gold_assert(lsym.get_st_value() == 0); + unsigned int shndx = lsym.get_st_shndx(); + bool is_ordinary; + shndx = object->adjust_sym_shndx(r_sym, shndx, + &is_ordinary); + if (!is_ordinary) + object->error(_("section symbol %u has bad shndx %u"), + r_sym, shndx); + else + rela_dyn->add_local_section(object, shndx, r_type, + output_section, data_shndx, + reloc.get_r_offset()); + } } break; @@ -5556,8 +5669,8 @@ Target_powerpc::Scan::local( if (!parameters->options().output_is_position_independent()) { - if ((size == 32 && is_ifunc) - || (size == 64 && target->abiversion() >= 2)) + if (is_ifunc + && (size == 32 || target->abiversion() >= 2)) got->add_local_plt(object, r_sym, GOT_TYPE_STANDARD); else got->add_local(object, r_sym, GOT_TYPE_STANDARD); @@ -6004,8 +6117,8 @@ Target_powerpc::Scan::global( got = target->got_section(symtab, layout); if (gsym->final_value_is_known()) { - if ((size == 32 && is_ifunc) - || (size == 64 && target->abiversion() >= 2)) + if (is_ifunc + && (size == 32 || target->abiversion() >= 2)) got->add_global_plt(gsym, GOT_TYPE_STANDARD); else got->add_global(gsym, GOT_TYPE_STANDARD); @@ -6436,7 +6549,12 @@ class Global_symbol_visitor_opd unsigned int shndx = sym->shndx(&is_ordinary); if (shndx == symobj->opd_shndx() && symobj->get_opd_discard(sym->value())) - sym->set_symtab_index(-1U); + { + sym->set_undefined(); + sym->set_visibility(elfcpp::STV_DEFAULT); + sym->set_is_defined_in_discarded_section(); + sym->set_symtab_index(-1U); + } } }; @@ -6614,12 +6732,12 @@ ok_lo_toc_insn(uint32_t insn) // Return the value to use for a branch relocation. template -typename Target_powerpc::Address +bool Target_powerpc::symval_for_branch( const Symbol_table* symtab, - Address value, const Sized_symbol* gsym, Powerpc_relobj* object, + Address *value, unsigned int *dest_shndx) { if (size == 32 || this->abiversion() >= 2) @@ -6631,20 +6749,20 @@ Target_powerpc::symval_for_branch( Powerpc_relobj* symobj = object; if (gsym != NULL && gsym->source() != Symbol::FROM_OBJECT) - return value; + return true; if (gsym != NULL) symobj = static_cast*>(gsym->object()); unsigned int shndx = symobj->opd_shndx(); if (shndx == 0) - return value; + return true; Address opd_addr = symobj->get_output_section_offset(shndx); if (opd_addr == invalid_address) - return value; + return true; opd_addr += symobj->output_section_address(shndx); - if (value >= opd_addr && value < opd_addr + symobj->section_size(shndx)) + if (*value >= opd_addr && *value < opd_addr + symobj->section_size(shndx)) { Address sec_off; - *dest_shndx = symobj->get_opd_ent(value - opd_addr, &sec_off); + *dest_shndx = symobj->get_opd_ent(*value - opd_addr, &sec_off); if (symtab->is_section_folded(symobj, *dest_shndx)) { Section_id folded @@ -6653,11 +6771,13 @@ Target_powerpc::symval_for_branch( *dest_shndx = folded.second; } Address sec_addr = symobj->get_output_section_offset(*dest_shndx); - gold_assert(sec_addr != invalid_address); + if (sec_addr == invalid_address) + return false; + sec_addr += symobj->output_section(*dest_shndx)->address(); - value = sec_addr + sec_off; + *value = sec_addr + sec_off; } - return value; + return true; } // Perform a relocation. @@ -6700,7 +6820,7 @@ Target_powerpc::Relocate::relocate( Powerpc_relobj* const object = static_cast*>(relinfo->object); Address value = 0; - bool has_plt_value = false; + bool has_stub_value = false; unsigned int r_sym = elfcpp::elf_r_sym(rela.get_r_info()); if ((gsym != NULL ? gsym->use_plt_offset(Scan::get_reference_flags(r_type, target)) @@ -6739,7 +6859,7 @@ Target_powerpc::Relocate::relocate( gold_assert(off != invalid_address); value = stub_table->stub_address() + off; } - has_plt_value = true; + has_stub_value = true; } if (r_type == elfcpp::R_POWERPC_GOT16 @@ -6770,7 +6890,7 @@ Target_powerpc::Relocate::relocate( else if (gsym != NULL && (r_type == elfcpp::R_POWERPC_REL24 || r_type == elfcpp::R_PPC_PLTREL24) - && has_plt_value) + && has_stub_value) { if (size == 64) { @@ -6817,10 +6937,9 @@ Target_powerpc::Relocate::relocate( if (target->abiversion() < 2) { Address addend = rela.get_r_addend(); - Address opdent = psymval->value(object, addend); - code = target->symval_for_branch(relinfo->symtab, - opdent, gsym, object, - &dest_shndx); + code = psymval->value(object, addend); + target->symval_for_branch(relinfo->symtab, gsym, object, + &code, &dest_shndx); } bool is_ordinary; if (dest_shndx == 0) @@ -6888,9 +7007,12 @@ Target_powerpc::Relocate::relocate( || r_type == elfcpp::R_POWERPC_GOT_TLSGD16_LO) { Insn* iview = reinterpret_cast(view - 2 * big_endian); - Insn insn = addis_3_13; + Insn insn = elfcpp::Swap<32, big_endian>::readval(iview); + insn &= (1 << 26) - (1 << 21); // extract rt if (size == 32) - insn = addis_3_2; + insn |= addis_0_2; + else + insn |= addis_0_13; elfcpp::Swap<32, big_endian>::writeval(iview, insn); r_type = elfcpp::R_POWERPC_TPREL16_HA; value = psymval->value(object, rela.get_r_addend()); @@ -6923,9 +7045,12 @@ Target_powerpc::Relocate::relocate( || r_type == elfcpp::R_POWERPC_GOT_TLSLD16_LO) { Insn* iview = reinterpret_cast(view - 2 * big_endian); - Insn insn = addis_3_13; + Insn insn = elfcpp::Swap<32, big_endian>::readval(iview); + insn &= (1 << 26) - (1 << 21); // extract rt if (size == 32) - insn = addis_3_2; + insn |= addis_0_2; + else + insn |= addis_0_13; elfcpp::Swap<32, big_endian>::writeval(iview, insn); r_type = elfcpp::R_POWERPC_TPREL16_HA; value = dtp_offset; @@ -7075,11 +7200,10 @@ Target_powerpc::Relocate::relocate( value = psymval->value(object, rela.get_r_addend()); } } - else if (!has_plt_value) + else if (!has_stub_value) { Address addend = 0; - unsigned int dest_shndx; - if (r_type != elfcpp::R_PPC_PLTREL24) + if (!(size == 32 && r_type == elfcpp::R_PPC_PLTREL24)) addend = rela.get_r_addend(); value = psymval->value(object, addend); if (size == 64 && is_branch_reloc(r_type)) @@ -7092,18 +7216,13 @@ Target_powerpc::Relocate::relocate( value += object->ppc64_local_entry_offset(r_sym); } else - value = target->symval_for_branch(relinfo->symtab, value, - gsym, object, &dest_shndx); + { + unsigned int dest_shndx; + target->symval_for_branch(relinfo->symtab, gsym, object, + &value, &dest_shndx); + } } - unsigned int max_branch_offset = 0; - if (r_type == elfcpp::R_POWERPC_REL24 - || r_type == elfcpp::R_PPC_PLTREL24 - || r_type == elfcpp::R_PPC_LOCAL24PC) - max_branch_offset = 1 << 25; - else if (r_type == elfcpp::R_POWERPC_REL14 - || r_type == elfcpp::R_POWERPC_REL14_BRTAKEN - || r_type == elfcpp::R_POWERPC_REL14_BRNTAKEN) - max_branch_offset = 1 << 15; + Address max_branch_offset = max_branch_delta(r_type); if (max_branch_offset != 0 && value - address + max_branch_offset >= 2 * max_branch_offset) { @@ -7113,8 +7232,11 @@ Target_powerpc::Relocate::relocate( { Address off = stub_table->find_long_branch_entry(object, value); if (off != invalid_address) - value = (stub_table->stub_address() + stub_table->plt_size() - + off); + { + value = (stub_table->stub_address() + stub_table->plt_size() + + off); + has_stub_value = true; + } } } } @@ -7414,7 +7536,6 @@ Target_powerpc::Relocate::relocate( Insn* iview = reinterpret_cast(view - 2 * big_endian); Insn insn = elfcpp::Swap<32, big_endian>::readval(iview); - overflow = Reloc::CHECK_SIGNED; if ((insn & (0x3f << 26)) == 10u << 26 /* cmpli */) overflow = Reloc::CHECK_BITFIELD; else if (overflow == Reloc::CHECK_LOW_INSN @@ -7425,6 +7546,8 @@ Target_powerpc::Relocate::relocate( || (insn & (0x3f << 26)) == 25u << 26 /* oris */ || (insn & (0x3f << 26)) == 27u << 26 /* xoris */)) overflow = Reloc::CHECK_UNSIGNED; + else + overflow = Reloc::CHECK_SIGNED; } typename Powerpc_relocate_functions::Status status @@ -7665,9 +7788,17 @@ Target_powerpc::Relocate::relocate( r_type); break; } - if (status != Powerpc_relocate_functions::STATUS_OK) - gold_error_at_location(relinfo, relnum, rela.get_r_offset(), - _("relocation overflow")); + if (status != Powerpc_relocate_functions::STATUS_OK + && (has_stub_value + || !(gsym != NULL + && gsym->is_weak_undefined() + && is_branch_reloc(r_type)))) + { + gold_error_at_location(relinfo, relnum, rela.get_r_offset(), + _("relocation overflow")); + if (has_stub_value) + gold_info(_("try relinking with a smaller --stub-group-size")); + } return true; } diff --git a/binutils-2.25/gold/pread.c b/binutils-2.25/gold/pread.c index eb274117..7dc399b2 100644 --- a/binutils-2.25/gold/pread.c +++ b/binutils-2.25/gold/pread.c @@ -1,6 +1,6 @@ /* pread.c -- version of pread for gold. */ -/* Copyright (C) 2006-2014 Free Software Foundation, Inc. +/* Copyright (C) 2006-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/readsyms.cc b/binutils-2.25/gold/readsyms.cc index 8aaa91a6..45cbf196 100644 --- a/binutils-2.25/gold/readsyms.cc +++ b/binutils-2.25/gold/readsyms.cc @@ -1,6 +1,6 @@ // readsyms.cc -- read input file symbols for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/readsyms.h b/binutils-2.25/gold/readsyms.h index 0276f4d4..01549f12 100644 --- a/binutils-2.25/gold/readsyms.h +++ b/binutils-2.25/gold/readsyms.h @@ -1,6 +1,6 @@ // readsyms.h -- read input file symbols for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/reduced_debug_output.cc b/binutils-2.25/gold/reduced_debug_output.cc index 09bdf138..d182870c 100644 --- a/binutils-2.25/gold/reduced_debug_output.cc +++ b/binutils-2.25/gold/reduced_debug_output.cc @@ -1,6 +1,6 @@ // reduced_debug_output.cc -- output reduced debugging information to save space -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Caleb Howe . // This file is part of gold. diff --git a/binutils-2.25/gold/reduced_debug_output.h b/binutils-2.25/gold/reduced_debug_output.h index a4f9ebbd..2c9557b2 100644 --- a/binutils-2.25/gold/reduced_debug_output.h +++ b/binutils-2.25/gold/reduced_debug_output.h @@ -1,6 +1,6 @@ // reduced_debug_output.h -- reduce debugging information -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Caleb Howe . // This file is part of gold. diff --git a/binutils-2.25/gold/reloc-types.h b/binutils-2.25/gold/reloc-types.h index e5f235f7..8612b77e 100644 --- a/binutils-2.25/gold/reloc-types.h +++ b/binutils-2.25/gold/reloc-types.h @@ -1,6 +1,6 @@ // reloc-types.h -- ELF relocation templates for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/reloc.cc b/binutils-2.25/gold/reloc.cc index 115ab375..5906754d 100644 --- a/binutils-2.25/gold/reloc.cc +++ b/binutils-2.25/gold/reloc.cc @@ -1,6 +1,6 @@ // reloc.cc -- relocate input files for gold. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/reloc.h b/binutils-2.25/gold/reloc.h index da14ec18..559206ef 100644 --- a/binutils-2.25/gold/reloc.h +++ b/binutils-2.25/gold/reloc.h @@ -1,6 +1,6 @@ // reloc.h -- relocate input files for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/resolve.cc b/binutils-2.25/gold/resolve.cc index 07dff4ad..1c0344c6 100644 --- a/binutils-2.25/gold/resolve.cc +++ b/binutils-2.25/gold/resolve.cc @@ -1,6 +1,6 @@ // resolve.cc -- symbol resolution for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/script-c.h b/binutils-2.25/gold/script-c.h index f9555fe7..772c76cb 100644 --- a/binutils-2.25/gold/script-c.h +++ b/binutils-2.25/gold/script-c.h @@ -1,6 +1,6 @@ /* script-c.h -- C interface for linker scripts in gold. */ -/* Copyright (C) 2006-2014 Free Software Foundation, Inc. +/* Copyright (C) 2006-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/script-sections.cc b/binutils-2.25/gold/script-sections.cc index 799f4ab3..9ff0feec 100644 --- a/binutils-2.25/gold/script-sections.cc +++ b/binutils-2.25/gold/script-sections.cc @@ -1,6 +1,6 @@ // script-sections.cc -- linker script SECTIONS for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/script-sections.h b/binutils-2.25/gold/script-sections.h index daf9f64e..2e07aa2b 100644 --- a/binutils-2.25/gold/script-sections.h +++ b/binutils-2.25/gold/script-sections.h @@ -1,6 +1,6 @@ // script-sections.h -- linker script SECTIONS for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/script.cc b/binutils-2.25/gold/script.cc index eff9a81a..5350afc6 100644 --- a/binutils-2.25/gold/script.cc +++ b/binutils-2.25/gold/script.cc @@ -1,6 +1,6 @@ // script.cc -- handle linker scripts for gold. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/script.h b/binutils-2.25/gold/script.h index 99bba08a..1731985d 100644 --- a/binutils-2.25/gold/script.h +++ b/binutils-2.25/gold/script.h @@ -1,6 +1,6 @@ // script.h -- handle linker scripts for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/sparc.cc b/binutils-2.25/gold/sparc.cc index 5a5f76a6..d34585a9 100644 --- a/binutils-2.25/gold/sparc.cc +++ b/binutils-2.25/gold/sparc.cc @@ -1,6 +1,6 @@ // sparc.cc -- sparc target support for gold. -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by David S. Miller . // This file is part of gold. diff --git a/binutils-2.25/gold/stringpool.cc b/binutils-2.25/gold/stringpool.cc index 02f0da9f..c6d3c9b5 100644 --- a/binutils-2.25/gold/stringpool.cc +++ b/binutils-2.25/gold/stringpool.cc @@ -1,6 +1,6 @@ // stringpool.cc -- a string pool for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/stringpool.h b/binutils-2.25/gold/stringpool.h index 8ef8386b..2a3fb08f 100644 --- a/binutils-2.25/gold/stringpool.h +++ b/binutils-2.25/gold/stringpool.h @@ -1,6 +1,6 @@ // stringpool.h -- a string pool for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/symtab.cc b/binutils-2.25/gold/symtab.cc index 70fb3f04..045327ac 100644 --- a/binutils-2.25/gold/symtab.cc +++ b/binutils-2.25/gold/symtab.cc @@ -1,6 +1,6 @@ // symtab.cc -- the gold symbol table -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -547,7 +547,6 @@ Symbol::set_output_segment(Output_segment* os, Segment_offset_base base) void Symbol::set_undefined() { - gold_assert(this->is_predefined_); this->source_ = IS_UNDEFINED; this->is_predefined_ = false; } diff --git a/binutils-2.25/gold/symtab.h b/binutils-2.25/gold/symtab.h index 7984dd6f..9413360f 100644 --- a/binutils-2.25/gold/symtab.h +++ b/binutils-2.25/gold/symtab.h @@ -1,6 +1,6 @@ // symtab.h -- the gold symbol table -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -604,10 +604,8 @@ class Symbol if (parameters->options().in_dynamic_list(this->name())) return true; - // If the user used -Bsymbolic or provided a --dynamic-list script, - // then nothing (else) is preemptible. - if (parameters->options().Bsymbolic() - || parameters->options().have_dynamic_list()) + // If the user used -Bsymbolic, then nothing (else) is preemptible. + if (parameters->options().Bsymbolic()) return false; // If the user used -Bsymbolic-functions, then functions are not diff --git a/binutils-2.25/gold/system.h b/binutils-2.25/gold/system.h index 8d4d6bea..10557680 100644 --- a/binutils-2.25/gold/system.h +++ b/binutils-2.25/gold/system.h @@ -1,6 +1,6 @@ // system.h -- general definitions for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/target-reloc.h b/binutils-2.25/gold/target-reloc.h index e44519b2..c1354594 100644 --- a/binutils-2.25/gold/target-reloc.h +++ b/binutils-2.25/gold/target-reloc.h @@ -1,6 +1,6 @@ // target-reloc.h -- target specific relocation support -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/target-select.cc b/binutils-2.25/gold/target-select.cc index e5f2597d..33e8f23f 100644 --- a/binutils-2.25/gold/target-select.cc +++ b/binutils-2.25/gold/target-select.cc @@ -1,6 +1,6 @@ // target-select.cc -- select a target for an object file -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/target-select.h b/binutils-2.25/gold/target-select.h index c18d84be..cb9302b8 100644 --- a/binutils-2.25/gold/target-select.h +++ b/binutils-2.25/gold/target-select.h @@ -1,6 +1,6 @@ // target-select.h -- select a target for an object file -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/target.cc b/binutils-2.25/gold/target.cc index 81c02cce..f558c5e8 100644 --- a/binutils-2.25/gold/target.cc +++ b/binutils-2.25/gold/target.cc @@ -1,6 +1,6 @@ // target.cc -- target support for gold. -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/target.h b/binutils-2.25/gold/target.h index e3805910..95bc57e6 100644 --- a/binutils-2.25/gold/target.h +++ b/binutils-2.25/gold/target.h @@ -1,6 +1,6 @@ // target.h -- target support for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/Makefile.am b/binutils-2.25/gold/testsuite/Makefile.am index dd06d5fd..7b73f9d1 100644 --- a/binutils-2.25/gold/testsuite/Makefile.am +++ b/binutils-2.25/gold/testsuite/Makefile.am @@ -472,7 +472,7 @@ two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic. two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc two_file_shared_2_pic_1_test_DEPENDENCIES = \ - gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o + gcctestdir/ld two_file_shared_1.so two_file_test_2_pic.o two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so @@ -520,6 +520,7 @@ two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \ check_PROGRAMS += pie_copyrelocs_test pie_copyrelocs_test_SOURCES = pie_copyrelocs_test.cc pie_copyrelocs_test_DEPENDENCIES = gcctestdir/ld pie_copyrelocs_shared_test.so +pie_copyrelocs_test_CXXFLAGS = -fno-exceptions -fno-asynchronous-unwind-tables pie_copyrelocs_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -pie pie_copyrelocs_test_LDADD = pie_copyrelocs_shared_test.so pie_copyrelocs_shared_test.o: pie_copyrelocs_shared_test.cc @@ -732,6 +733,7 @@ weak_undef_test_2_SOURCES = weak_undef_test_2.cc weak_undef_test_2_DEPENDENCIES = gcctestdir/ld libweak_undef_2.a weak_undef_test_2_LDFLAGS = -Bgcctestdir/ -u weak_undef_2 weak_undef_test_2_LDADD = -L . -lweak_undef_2 +MOSTLYCLEANFILES += libweak_undef_2.a libweak_undef_2.a: weak_undef_file3.o weak_undef_file4.o $(TEST_AR) rc $@ $^ weak_undef_file3.o: weak_undef_file3.cc @@ -1516,7 +1518,7 @@ dynamic_list_lib1.o: dynamic_list_lib1.cc $(CXXCOMPILE) -c -fpic -o $@ $< dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t - $(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o + $(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o dynamic_list_lib2.o: dynamic_list_lib2.cc $(CXXCOMPILE) -c -fpic -o $@ $< @@ -1563,8 +1565,8 @@ check_PROGRAMS += plugin_test_1 check_SCRIPTS += plugin_test_1.sh check_DATA += plugin_test_1.err MOSTLYCLEANFILES += plugin_test_1.err -plugin_test_1: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so - $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err +plugin_test_1: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_1.err plugin_test_1.err: plugin_test_1 @touch plugin_test_1.err @@ -1572,8 +1574,8 @@ check_PROGRAMS += plugin_test_2 check_SCRIPTS += plugin_test_2.sh check_DATA += plugin_test_2.err MOSTLYCLEANFILES += plugin_test_2.err -plugin_test_2: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so gcctestdir/ld plugin_test.so - $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so 2>plugin_test_2.err +plugin_test_2: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_shared_2.so gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_shared_2.so 2>plugin_test_2.err plugin_test_2.err: plugin_test_2 @touch plugin_test_2.err @@ -1581,8 +1583,8 @@ check_PROGRAMS += plugin_test_3 check_SCRIPTS += plugin_test_3.sh check_DATA += plugin_test_3.err MOSTLYCLEANFILES += plugin_test_3.err -plugin_test_3: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so - $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_3.err +plugin_test_3: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_3.err plugin_test_3.err: plugin_test_3 @touch plugin_test_3.err @@ -1595,35 +1597,35 @@ plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so plugin_test_4.err: plugin_test_4 @touch plugin_test_4.err -plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms +plugin_test_4.a: two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms $(TEST_AR) cr $@ $^ check_PROGRAMS += plugin_test_5 -plugin_test_5: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms gcctestdir/ld plugin_test.so - $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms +plugin_test_5: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms unused.o.syms gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms unused.o.syms check_PROGRAMS += plugin_test_6 check_SCRIPTS += plugin_test_6.sh check_DATA += plugin_test_6.err MOSTLYCLEANFILES += plugin_test_6.err -plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so - $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err +plugin_test_6: plugin_common_test_1.o.syms plugin_common_test_2.o.syms gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o.syms 2>plugin_test_6.err plugin_test_6.err: plugin_test_6 @touch plugin_test_6.err check_PROGRAMS += plugin_test_7 check_SCRIPTS += plugin_test_7.sh -check_DATA += plugin_test_7.err plugin_test_7.syms +check_DATA += plugin_test_7.err plugin_test_7.o.syms MOSTLYCLEANFILES += plugin_test_7.err -plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so - $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.syms plugin_test_7_2.o 2>plugin_test_7.err -plugin_test_7.syms: plugin_test_7 +plugin_test_7: plugin_test_7_1.o plugin_test_7_1.o.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so + $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.o.syms plugin_test_7_2.o 2>plugin_test_7.err +plugin_test_7.o.syms: plugin_test_7 $(TEST_READELF) -sW $< >$@ 2>/dev/null plugin_test_7_1.o: plugin_test_7_1.c $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< plugin_test_7_1_orig.o: plugin_test_7_1.c $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< -plugin_test_7_1.syms: plugin_test_7_1_orig.o +plugin_test_7_1.o.syms: plugin_test_7_1_orig.o $(TEST_READELF) -sW $< >$@ 2>/dev/null plugin_test_7_2.o: plugin_test_7_2.c $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< @@ -1631,8 +1633,8 @@ plugin_test_7.err: plugin_test_7 # Test plugins with -r. check_PROGRAMS += plugin_test_8 -plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so - ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o +plugin_test_8.o: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o ../ld-new plugin_test.so + ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o plugin_test_8: plugin_test_8.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o @@ -1640,17 +1642,17 @@ plugin_test_8: plugin_test_8.o gcctestdir/ld # produce an unresolved symbol error. check_DATA += plugin_test_9.err MOSTLYCLEANFILES += plugin_test_9.err -plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so - @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms "2>$@" - @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms 2>$@; then \ +plugin_test_9.err: two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms gcctestdir/ld plugin_test.so + @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms "2>$@" + @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms 2>$@; then \ echo 1>&2 "Link of plugin_test_9 should have failed"; \ rm -f $@; \ exit 1; \ fi # Make a .syms file that claims to define the symbol _Z4t16av. -two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o - cp two_file_test_1.syms $@.tmp - grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp +two_file_test_1c.o.syms: two_file_test_1.o.syms two_file_test_1c.o + cp two_file_test_1.o.syms $@.tmp + grep "_Z4t16av" two_file_test_1b.o.syms >> $@.tmp mv -f $@.tmp $@ # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. MOSTLYCLEANFILES += two_file_test_1c.o @@ -1661,32 +1663,43 @@ check_PROGRAMS += plugin_test_10 check_SCRIPTS += plugin_test_10.sh check_DATA += plugin_test_10.sections MOSTLYCLEANFILES += plugin_test_10.sections -plugin_test_10: plugin_common_test_1.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so - $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.o +plugin_test_10: plugin_common_test_1.o.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o plugin_test_10.sections: plugin_test_10 $(TEST_READELF) -SW $< >$@ 2>/dev/null - +check_PROGRAMS += plugin_test_11 +check_SCRIPTS += plugin_test_11.sh +check_DATA += plugin_test_11.err +MOSTLYCLEANFILES += plugin_test_11.err plugin_test_thin.a +PLUGIN_TEST_11_SYMS = two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms +plugin_test_11: two_file_test_main.o plugin_test_thin.a gcctestdir/ld plugin_test.so $(PLUGIN_TEST_11_SYMS) + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o plugin_test_thin.a 2>plugin_test_11.err +plugin_test_11.err: plugin_test_11 + @touch plugin_test_11.err +plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o + rm -f $@ + $(TEST_AR) crT $@ $^ plugin_test.so: plugin_test.o $(LINK) -Bgcctestdir/ -shared plugin_test.o plugin_test.o: plugin_test.c $(COMPILE) -O0 -c -fpic -o $@ $< -two_file_test_main.syms: two_file_test_main.o +two_file_test_main.o.syms: two_file_test_main.o $(TEST_READELF) -sW $< >$@ 2>/dev/null -two_file_test_1.syms: two_file_test_1.o +two_file_test_1.o.syms: two_file_test_1.o $(TEST_READELF) -sW $< >$@ 2>/dev/null -two_file_test_1b.syms: two_file_test_1b.o +two_file_test_1b.o.syms: two_file_test_1b.o $(TEST_READELF) -sW $< >$@ 2>/dev/null -two_file_test_2.syms: two_file_test_2.o +two_file_test_2.o.syms: two_file_test_2.o $(TEST_READELF) -sW $< >$@ 2>/dev/null -plugin_common_test_1.syms: plugin_common_test_1.o +plugin_common_test_1.o.syms: plugin_common_test_1.o $(TEST_READELF) -sW $< >$@ 2>/dev/null -plugin_common_test_2.syms: plugin_common_test_2.o +plugin_common_test_2.o.syms: plugin_common_test_2.o $(TEST_READELF) -sW $< >$@ 2>/dev/null -empty.syms: +empty.o.syms: @echo "" >$@ @echo "Symbol table" >>$@ @@ -1696,18 +1709,18 @@ check_PROGRAMS += plugin_test_tls check_SCRIPTS += plugin_test_tls.sh check_DATA += plugin_test_tls.err MOSTLYCLEANFILES += plugin_test_tls.err -plugin_test_tls: two_file_test_tls.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2_tls.syms gcctestdir/ld plugin_test.so - $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_tls.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2_tls.syms 2>plugin_test_tls.err +plugin_test_tls: two_file_test_tls.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2_tls.o.syms gcctestdir/ld plugin_test.so + $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_tls.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2_tls.o.syms 2>plugin_test_tls.err plugin_test_tls.err: plugin_test_tls @touch plugin_test_tls.err -two_file_test_2_tls.syms: two_file_test_2_tls.o +two_file_test_2_tls.o.syms: two_file_test_2_tls.o $(TEST_READELF) -sW $< >$@ 2>/dev/null endif TLS MOSTLYCLEANFILES += unused.c -unused.syms: unused.o +unused.o.syms: unused.o $(TEST_READELF) -sW $< >$@ 2>/dev/null @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ unused.o: unused.c @@ -2267,7 +2280,7 @@ ehdr_start_test_5_LDADD = # Test that the --defsym option copies the symbol type and visibility. check_SCRIPTS += defsym_test.sh check_DATA += defsym_test.syms -MOSTLYCLEANFILES += defsym_test.syms +MOSTLYCLEANFILES += defsym_test defsym_test.syms defsym_test.syms: defsym_test $(TEST_READELF) -sW $< > $@ defsym_test: defsym_test.o gcctestdir/ld @@ -2380,10 +2393,9 @@ endif DEFAULT_TARGET_X86_64 if DEFAULT_TARGET_X86_64 check_PROGRAMS += exception_x86_64_bnd_test exception_x86_64_bnd_test_SOURCES = exception_test_main.cc -exception_x86_64_bnd_test_DEPENDENCIES = exception_x86_64_bnd_1.o \ - exception_x86_64_bnd_2.o +exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -exception_x86_64_bnd_test_LDADD = $(exception_x86_64_bnd_test_DEPENDENCIES) +exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as @@ -2484,6 +2496,43 @@ MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \ endif DEFAULT_TARGET_X86_64 +if DEFAULT_TARGET_X32 + +check_SCRIPTS += split_x32.sh +check_DATA += split_x32_1.stdout split_x32_2.stdout \ + split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout +SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 +split_x32_1.o: split_x32_1.s + $(TEST_AS) -o $@ $< +split_x32_2.o: split_x32_2.s + $(TEST_AS) -o $@ $< +split_x32_3.o: split_x32_3.s + $(TEST_AS) -o $@ $< +split_x32_4.o: split_x32_4.s + $(TEST_AS) -o $@ $< +split_x32_n.o: split_x32_n.s + $(TEST_AS) -o $@ $< +split_x32_1: split_x32_1.o split_x32_n.o ../ld-new + ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_1.o split_x32_n.o +split_x32_1.stdout: split_x32_1 + $(TEST_OBJDUMP) -d $< > $@ +split_x32_2: split_x32_2.o split_x32_n.o ../ld-new + ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_2.o split_x32_n.o +split_x32_2.stdout: split_x32_2 + $(TEST_OBJDUMP) -d $< > $@ +split_x32_3.stdout: split_x32_3.o split_x32_n.o ../ld-new + ../ld-new $(SPLIT_DEFSYMS) -o split_x32_3 split_x32_3.o split_x32_n.o > $@ 2>&1 || exit 0 +split_x32_4: split_x32_4.o split_x32_n.o ../ld-new + ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_4.o split_x32_n.o +split_x32_4.stdout: split_x32_4 + $(TEST_OBJDUMP) -d $< > $@ +split_x32_r.stdout: split_x32_1.o split_x32_n.o ../ld-new + ../ld-new -r split_x32_1.o split_x32_n.o -o split_x32_r > $@ 2>&1 || exit 0 +MOSTLYCLEANFILES += split_x32_1 split_x32_2 split_x32_3 \ + split_x32_4 split_x32_r + +endif DEFAULT_TARGET_X32 + if DEFAULT_TARGET_ARM check_SCRIPTS += arm_abs_global.sh diff --git a/binutils-2.25/gold/testsuite/Makefile.in b/binutils-2.25/gold/testsuite/Makefile.in index fed610f1..b4ae3fdc 100644 --- a/binutils-2.25/gold/testsuite/Makefile.in +++ b/binutils-2.25/gold/testsuite/Makefile.in @@ -155,7 +155,8 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ icf_sht_rel_addend_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ merge_string_literals \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared.dbg \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ alt/weak_undef_lib.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@ alt/weak_undef_lib.so \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ libweak_undef_2.a @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_5 = icf_virtual_function_folding_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ large_symbol_alignment \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test basic_pic_test @@ -351,7 +352,8 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_6 \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7 \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_8 \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10 +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10 \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@am__append_34 = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_1.sh \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_2.sh \ @@ -359,7 +361,8 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_4.sh \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_6.sh \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.sh \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sh +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sh \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11.sh # Test that symbols known in the IR file but not in the replacement file # produce an unresolved symbol error. @@ -370,9 +373,10 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_4.err \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_6.err \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.err \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.syms \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.o.syms \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_9.err \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sections +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sections \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11.err # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@am__append_36 = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_1.err \ @@ -384,7 +388,9 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.err \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_9.err \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ two_file_test_1c.o \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sections +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sections \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11.err \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_thin.a @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@am__append_37 = plugin_test_tls @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@am__append_38 = plugin_test_tls.sh @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@am__append_39 = plugin_test_tls.err @@ -579,7 +585,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_71 = ehdr_start_test_4.syms \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ defsym_test.syms @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_72 = ehdr_start_test_4 \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ defsym_test.syms +@GCC_TRUE@@NATIVE_LINKER_TRUE@ defsym_test defsym_test.syms @GCC_FALSE@ehdr_start_test_5_DEPENDENCIES = @NATIVE_LINKER_FALSE@ehdr_start_test_5_DEPENDENCIES = @@ -623,6 +629,13 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_83 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \ @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4 split_x86_64_r +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_84 = split_x32.sh +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_85 = split_x32_1.stdout split_x32_2.stdout \ +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout + +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_86 = split_x32_1 split_x32_2 split_x32_3 \ +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_4 split_x32_r + # ARM1176 workaround test. @@ -635,7 +648,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ # Check Thumb to Thumb farcall veneers # Check Thumb to ARM farcall veneers -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_84 = arm_abs_global.sh \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_87 = arm_abs_global.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_in_range.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_out_of_range.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_fix_v4bx.sh \ @@ -649,7 +662,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.sh -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_85 = arm_abs_global.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_88 = arm_abs_global.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range.stdout \ @@ -694,7 +707,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_6m.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm_5t.stdout -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_86 = arm_abs_global \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_89 = arm_abs_global \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range \ @@ -737,10 +750,10 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_6m \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm_5t -@DEFAULT_TARGET_X86_64_TRUE@am__append_87 = *.dwo *.dwp -@DEFAULT_TARGET_X86_64_TRUE@am__append_88 = dwp_test_1.sh \ +@DEFAULT_TARGET_X86_64_TRUE@am__append_90 = *.dwo *.dwp +@DEFAULT_TARGET_X86_64_TRUE@am__append_91 = dwp_test_1.sh \ @DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.sh -@DEFAULT_TARGET_X86_64_TRUE@am__append_89 = dwp_test_1.stdout \ +@DEFAULT_TARGET_X86_64_TRUE@am__append_92 = dwp_test_1.stdout \ @DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.stdout subdir = testsuite DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am @@ -879,7 +892,8 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS) @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_6$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_8$(EXEEXT) \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10$(EXEEXT) +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11$(EXEEXT) @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@am__EXEEXT_24 = plugin_test_tls$(EXEEXT) @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_25 = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ exclude_libs_test$(EXEEXT) \ @@ -1419,11 +1433,10 @@ permission_test_LDADD = $(LDADD) permission_test_DEPENDENCIES = libgoldtest.a ../libgold.a \ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -@GCC_TRUE@@NATIVE_LINKER_TRUE@am_pie_copyrelocs_test_OBJECTS = \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ pie_copyrelocs_test.$(OBJEXT) +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_pie_copyrelocs_test_OBJECTS = pie_copyrelocs_test-pie_copyrelocs_test.$(OBJEXT) pie_copyrelocs_test_OBJECTS = $(am_pie_copyrelocs_test_OBJECTS) -pie_copyrelocs_test_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(pie_copyrelocs_test_LDFLAGS) $(LDFLAGS) -o $@ +pie_copyrelocs_test_LINK = $(CXXLD) $(pie_copyrelocs_test_CXXFLAGS) \ + $(CXXFLAGS) $(pie_copyrelocs_test_LDFLAGS) $(LDFLAGS) -o $@ plugin_test_1_SOURCES = plugin_test_1.c plugin_test_1_OBJECTS = plugin_test_1.$(OBJEXT) plugin_test_1_LDADD = $(LDADD) @@ -1436,6 +1449,12 @@ plugin_test_10_LDADD = $(LDADD) plugin_test_10_DEPENDENCIES = libgoldtest.a ../libgold.a \ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +plugin_test_11_SOURCES = plugin_test_11.c +plugin_test_11_OBJECTS = plugin_test_11.$(OBJEXT) +plugin_test_11_LDADD = $(LDADD) +plugin_test_11_DEPENDENCIES = libgoldtest.a ../libgold.a \ + ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) plugin_test_2_SOURCES = plugin_test_2.c plugin_test_2_OBJECTS = plugin_test_2.$(OBJEXT) plugin_test_2_LDADD = $(LDADD) @@ -1899,10 +1918,10 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \ local_labels_test.c many_sections_r_test.c \ $(many_sections_test_SOURCES) $(object_unittest_SOURCES) \ permission_test.c $(pie_copyrelocs_test_SOURCES) \ - plugin_test_1.c plugin_test_10.c plugin_test_2.c \ - plugin_test_3.c plugin_test_4.c plugin_test_5.c \ - plugin_test_6.c plugin_test_7.c plugin_test_8.c \ - plugin_test_tls.c $(protected_1_SOURCES) \ + plugin_test_1.c plugin_test_10.c plugin_test_11.c \ + plugin_test_2.c plugin_test_3.c plugin_test_4.c \ + plugin_test_5.c plugin_test_6.c plugin_test_7.c \ + plugin_test_8.c plugin_test_tls.c $(protected_1_SOURCES) \ $(protected_2_SOURCES) $(relro_now_test_SOURCES) \ $(relro_script_test_SOURCES) $(relro_strip_test_SOURCES) \ $(relro_test_SOURCES) $(script_test_1_SOURCES) \ @@ -2224,7 +2243,8 @@ MOSTLYCLEANFILES = *.so *.syms *.stdout $(am__append_4) \ $(am__append_41) $(am__append_47) $(am__append_63) \ $(am__append_66) $(am__append_69) $(am__append_72) \ $(am__append_74) $(am__append_77) $(am__append_80) \ - $(am__append_83) $(am__append_86) $(am__append_87) + $(am__append_83) $(am__append_86) $(am__append_89) \ + $(am__append_90) # We will add to these later, for each individual test. Note # that we add each test under check_SCRIPTS or check_PROGRAMS; @@ -2233,13 +2253,13 @@ check_SCRIPTS = $(am__append_2) $(am__append_34) $(am__append_38) \ $(am__append_42) $(am__append_45) $(am__append_61) \ $(am__append_64) $(am__append_67) $(am__append_70) \ $(am__append_75) $(am__append_78) $(am__append_81) \ - $(am__append_84) $(am__append_88) + $(am__append_84) $(am__append_87) $(am__append_91) check_DATA = $(am__append_3) $(am__append_27) $(am__append_29) \ $(am__append_35) $(am__append_39) $(am__append_43) \ $(am__append_46) $(am__append_62) $(am__append_65) \ $(am__append_68) $(am__append_71) $(am__append_76) \ $(am__append_79) $(am__append_82) $(am__append_85) \ - $(am__append_89) + $(am__append_88) $(am__append_92) BUILT_SOURCES = $(am__append_25) TESTS = $(check_SCRIPTS) $(check_PROGRAMS) @@ -2306,7 +2326,7 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_shared_2.so @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_DEPENDENCIES = \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_1.so two_file_test_2_pic.o @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so @@ -2338,6 +2358,7 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_relocatable_test_LDADD = two_file_relocatable.o @GCC_TRUE@@NATIVE_LINKER_TRUE@pie_copyrelocs_test_SOURCES = pie_copyrelocs_test.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@pie_copyrelocs_test_DEPENDENCIES = gcctestdir/ld pie_copyrelocs_shared_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@pie_copyrelocs_test_CXXFLAGS = -fno-exceptions -fno-asynchronous-unwind-tables @GCC_TRUE@@NATIVE_LINKER_TRUE@pie_copyrelocs_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -pie @GCC_TRUE@@NATIVE_LINKER_TRUE@pie_copyrelocs_test_LDADD = pie_copyrelocs_shared_test.so @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_nonpic_test_SOURCES = \ @@ -2637,6 +2658,7 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a @GCC_TRUE@@NATIVE_LINKER_TRUE@thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. @GCC_TRUE@@NATIVE_LINKER_TRUE@thin_archive_test_2_LDADD = -lthinall +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@PLUGIN_TEST_11_SYMS = two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms @GCC_TRUE@@NATIVE_LINKER_TRUE@exclude_libs_test_SOURCES = exclude_libs_test.c @GCC_TRUE@@NATIVE_LINKER_TRUE@exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ libexclude_libs_test_2.a alt/libexclude_libs_test_3.a @@ -2732,12 +2754,11 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ehdr_start_test_5_LDFLAGS = -Bgcctestdir/ @GCC_TRUE@@NATIVE_LINKER_TRUE@ehdr_start_test_5_LDADD = @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_SOURCES = exception_test_main.cc -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = exception_x86_64_bnd_1.o \ -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_2.o - +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = $(exception_x86_64_bnd_test_DEPENDENCIES) +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -3294,6 +3315,15 @@ pie_copyrelocs_test$(EXEEXT): $(pie_copyrelocs_test_OBJECTS) $(pie_copyrelocs_te @PLUGINS_FALSE@plugin_test_10$(EXEEXT): $(plugin_test_10_OBJECTS) $(plugin_test_10_DEPENDENCIES) @PLUGINS_FALSE@ @rm -f plugin_test_10$(EXEEXT) @PLUGINS_FALSE@ $(LINK) $(plugin_test_10_OBJECTS) $(plugin_test_10_LDADD) $(LIBS) +@GCC_FALSE@plugin_test_11$(EXEEXT): $(plugin_test_11_OBJECTS) $(plugin_test_11_DEPENDENCIES) +@GCC_FALSE@ @rm -f plugin_test_11$(EXEEXT) +@GCC_FALSE@ $(LINK) $(plugin_test_11_OBJECTS) $(plugin_test_11_LDADD) $(LIBS) +@NATIVE_LINKER_FALSE@plugin_test_11$(EXEEXT): $(plugin_test_11_OBJECTS) $(plugin_test_11_DEPENDENCIES) +@NATIVE_LINKER_FALSE@ @rm -f plugin_test_11$(EXEEXT) +@NATIVE_LINKER_FALSE@ $(LINK) $(plugin_test_11_OBJECTS) $(plugin_test_11_LDADD) $(LIBS) +@PLUGINS_FALSE@plugin_test_11$(EXEEXT): $(plugin_test_11_OBJECTS) $(plugin_test_11_DEPENDENCIES) +@PLUGINS_FALSE@ @rm -f plugin_test_11$(EXEEXT) +@PLUGINS_FALSE@ $(LINK) $(plugin_test_11_OBJECTS) $(plugin_test_11_LDADD) $(LIBS) @GCC_FALSE@plugin_test_2$(EXEEXT): $(plugin_test_2_OBJECTS) $(plugin_test_2_DEPENDENCIES) @GCC_FALSE@ @rm -f plugin_test_2$(EXEEXT) @GCC_FALSE@ $(LINK) $(plugin_test_2_OBJECTS) $(plugin_test_2_LDADD) $(LIBS) @@ -3675,9 +3705,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/many_sections_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object_unittest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/permission_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pie_copyrelocs_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pie_copyrelocs_test-pie_copyrelocs_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_10.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_11.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_4.Po@am__quote@ @@ -3836,6 +3867,20 @@ ehdr_start_test_5-ehdr_start_def.obj: ehdr_start_def.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ehdr_start_test_5_CXXFLAGS) $(CXXFLAGS) -c -o ehdr_start_test_5-ehdr_start_def.obj `if test -f 'ehdr_start_def.cc'; then $(CYGPATH_W) 'ehdr_start_def.cc'; else $(CYGPATH_W) '$(srcdir)/ehdr_start_def.cc'; fi` +pie_copyrelocs_test-pie_copyrelocs_test.o: pie_copyrelocs_test.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pie_copyrelocs_test_CXXFLAGS) $(CXXFLAGS) -MT pie_copyrelocs_test-pie_copyrelocs_test.o -MD -MP -MF $(DEPDIR)/pie_copyrelocs_test-pie_copyrelocs_test.Tpo -c -o pie_copyrelocs_test-pie_copyrelocs_test.o `test -f 'pie_copyrelocs_test.cc' || echo '$(srcdir)/'`pie_copyrelocs_test.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/pie_copyrelocs_test-pie_copyrelocs_test.Tpo $(DEPDIR)/pie_copyrelocs_test-pie_copyrelocs_test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='pie_copyrelocs_test.cc' object='pie_copyrelocs_test-pie_copyrelocs_test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pie_copyrelocs_test_CXXFLAGS) $(CXXFLAGS) -c -o pie_copyrelocs_test-pie_copyrelocs_test.o `test -f 'pie_copyrelocs_test.cc' || echo '$(srcdir)/'`pie_copyrelocs_test.cc + +pie_copyrelocs_test-pie_copyrelocs_test.obj: pie_copyrelocs_test.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pie_copyrelocs_test_CXXFLAGS) $(CXXFLAGS) -MT pie_copyrelocs_test-pie_copyrelocs_test.obj -MD -MP -MF $(DEPDIR)/pie_copyrelocs_test-pie_copyrelocs_test.Tpo -c -o pie_copyrelocs_test-pie_copyrelocs_test.obj `if test -f 'pie_copyrelocs_test.cc'; then $(CYGPATH_W) 'pie_copyrelocs_test.cc'; else $(CYGPATH_W) '$(srcdir)/pie_copyrelocs_test.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/pie_copyrelocs_test-pie_copyrelocs_test.Tpo $(DEPDIR)/pie_copyrelocs_test-pie_copyrelocs_test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='pie_copyrelocs_test.cc' object='pie_copyrelocs_test-pie_copyrelocs_test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pie_copyrelocs_test_CXXFLAGS) $(CXXFLAGS) -c -o pie_copyrelocs_test-pie_copyrelocs_test.obj `if test -f 'pie_copyrelocs_test.cc'; then $(CYGPATH_W) 'pie_copyrelocs_test.cc'; else $(CYGPATH_W) '$(srcdir)/pie_copyrelocs_test.cc'; fi` + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -4130,6 +4175,8 @@ plugin_test_7.sh.log: plugin_test_7.sh @p='plugin_test_7.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) plugin_test_10.sh.log: plugin_test_10.sh @p='plugin_test_10.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +plugin_test_11.sh.log: plugin_test_11.sh + @p='plugin_test_11.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) plugin_test_tls.sh.log: plugin_test_tls.sh @p='plugin_test_tls.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) plugin_final_layout.sh.log: plugin_final_layout.sh @@ -4168,6 +4215,8 @@ split_i386.sh.log: split_i386.sh @p='split_i386.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) split_x86_64.sh.log: split_x86_64.sh @p='split_x86_64.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +split_x32.sh.log: split_x32.sh + @p='split_x32.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) arm_abs_global.sh.log: arm_abs_global.sh @p='arm_abs_global.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) arm_branch_in_range.sh.log: arm_branch_in_range.sh @@ -4412,6 +4461,8 @@ plugin_test_8.log: plugin_test_8$(EXEEXT) @p='plugin_test_8$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) plugin_test_10.log: plugin_test_10$(EXEEXT) @p='plugin_test_10$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +plugin_test_11.log: plugin_test_11$(EXEEXT) + @p='plugin_test_11$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) plugin_test_tls.log: plugin_test_tls$(EXEEXT) @p='plugin_test_tls$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) exclude_libs_test.log: exclude_libs_test$(EXEEXT) @@ -5268,7 +5319,7 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $< @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t -@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.o: dynamic_list_lib2.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $< @@ -5293,16 +5344,16 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@alt/thin_archive_test_4.o: thin_archive_test_4.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d alt || mkdir -p alt @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -o $@ $< -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_1: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_1: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_1.err @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_1.err: plugin_test_1 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @touch plugin_test_1.err -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_2: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so 2>plugin_test_2.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_2: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_shared_2.so gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_shared_2.so 2>plugin_test_2.err @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_2.err: plugin_test_2 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @touch plugin_test_2.err -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_3: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_3.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_3: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--export-dynamic -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms empty.o.syms 2>plugin_test_3.err @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_3.err: plugin_test_3 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @touch plugin_test_3.err @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so @@ -5310,79 +5361,86 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_4.err: plugin_test_4 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @touch plugin_test_4.err -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_4.a: two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_AR) cr $@ $^ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_5: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_5: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms unused.o.syms gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o.syms unused.o.syms +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_6: plugin_common_test_1.o.syms plugin_common_test_2.o.syms gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o.syms 2>plugin_test_6.err @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_6.err: plugin_test_6 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @touch plugin_test_6.err -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.syms plugin_test_7_2.o 2>plugin_test_7.err -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7.syms: plugin_test_7 +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7: plugin_test_7_1.o plugin_test_7_1.o.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.o.syms plugin_test_7_2.o 2>plugin_test_7.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7.o.syms: plugin_test_7 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7_1.o: plugin_test_7_1.c @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(COMPILE) -DLTO -O0 -c -ffunction-sections -fdata-sections -o $@ $< @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7_1_orig.o: plugin_test_7_1.c @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7_1.syms: plugin_test_7_1_orig.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7_1.o.syms: plugin_test_7_1_orig.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7_2.o: plugin_test_7_2.c @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(COMPILE) -O0 -c -ffunction-sections -fdata-sections -o $@ $< @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_7.err: plugin_test_7 -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_8.o: two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o ../ld-new plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_8: plugin_test_8.o gcctestdir/ld @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle plugin_test_8.o -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_9.err: two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms "2>$@" -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.syms two_file_test_2.syms 2>$@; then \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_9.err: two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @echo $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms "2>$@" +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @if $(CXXLINK) -Bgcctestdir/ -o plugin_test_9 -Wl,--no-demangle,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1c.o.syms two_file_test_2.o.syms 2>$@; then \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ echo 1>&2 "Link of plugin_test_9 should have failed"; \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ rm -f $@; \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ exit 1; \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ fi # Make a .syms file that claims to define the symbol _Z4t16av. -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_1c.syms: two_file_test_1.syms two_file_test_1c.o -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ cp two_file_test_1.syms $@.tmp -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ grep "_Z4t16av" two_file_test_1b.syms >> $@.tmp +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_1c.o.syms: two_file_test_1.o.syms two_file_test_1c.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ cp two_file_test_1.o.syms $@.tmp +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ grep "_Z4t16av" two_file_test_1b.o.syms >> $@.tmp @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ mv -f $@.tmp $@ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_1c.o: two_file_test_1.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ cp two_file_test_1.o $@ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_10: plugin_common_test_1.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_10: plugin_common_test_1.o.syms plugin_common_test_2.o gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.o.syms plugin_common_test_2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_10.sections: plugin_test_10 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -SW $< >$@ 2>/dev/null +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_11: two_file_test_main.o plugin_test_thin.a gcctestdir/ld plugin_test.so $(PLUGIN_TEST_11_SYMS) +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o plugin_test_thin.a 2>plugin_test_11.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_11.err: plugin_test_11 +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @touch plugin_test_11.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ rm -f $@ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_AR) crT $@ $^ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test.so: plugin_test.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(LINK) -Bgcctestdir/ -shared plugin_test.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test.o: plugin_test.c @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(COMPILE) -O0 -c -fpic -o $@ $< -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_main.syms: two_file_test_main.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_main.o.syms: two_file_test_main.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_1.syms: two_file_test_1.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_1.o.syms: two_file_test_1.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_1b.syms: two_file_test_1b.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_1b.o.syms: two_file_test_1b.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_2.syms: two_file_test_2.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@two_file_test_2.o.syms: two_file_test_2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_common_test_1.syms: plugin_common_test_1.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_common_test_1.o.syms: plugin_common_test_1.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_common_test_2.syms: plugin_common_test_2.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_common_test_2.o.syms: plugin_common_test_2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@empty.syms: +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@empty.o.syms: @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @echo "" >$@ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @echo "Symbol table" >>$@ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@plugin_test_tls: two_file_test_tls.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2_tls.syms gcctestdir/ld plugin_test.so -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_tls.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2_tls.syms 2>plugin_test_tls.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@plugin_test_tls: two_file_test_tls.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2_tls.o.syms gcctestdir/ld plugin_test.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_tls.o two_file_test_1.o.syms two_file_test_1b.o.syms two_file_test_2_tls.o.syms 2>plugin_test_tls.err @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@plugin_test_tls.err: plugin_test_tls @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@ @touch plugin_test_tls.err -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@two_file_test_2_tls.syms: two_file_test_2_tls.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@two_file_test_2_tls.o.syms: two_file_test_2_tls.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@unused.syms: unused.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@unused.o.syms: unused.o @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @echo " 1: 00000000 4 FUNC GLOBAL DEFAULT 1 UNUSED" >>$@ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@unused.o: unused.c @@ -5779,6 +5837,32 @@ uninstall-am: @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -d $< > $@ @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new -r split_x86_64_1.o split_x86_64_n.o -o split_x86_64_r > $@ 2>&1 || exit 0 +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_1.o: split_x32_1.s +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_2.o: split_x32_2.s +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_3.o: split_x32_3.s +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_4.o: split_x32_4.s +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_n.o: split_x32_n.s +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_1: split_x32_1.o split_x32_n.o ../ld-new +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_1.o split_x32_n.o +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_1.stdout: split_x32_1 +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -d $< > $@ +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_2: split_x32_2.o split_x32_n.o ../ld-new +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_2.o split_x32_n.o +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_2.stdout: split_x32_2 +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -d $< > $@ +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_3.stdout: split_x32_3.o split_x32_n.o ../ld-new +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new $(SPLIT_DEFSYMS) -o split_x32_3 split_x32_3.o split_x32_n.o > $@ 2>&1 || exit 0 +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_4: split_x32_4.o split_x32_n.o ../ld-new +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new $(SPLIT_DEFSYMS) -o $@ split_x32_4.o split_x32_n.o +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_4.stdout: split_x32_4 +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -d $< > $@ +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@split_x32_r.stdout: split_x32_1.o split_x32_n.o ../ld-new +@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new -r split_x32_1.o split_x32_n.o -o split_x32_r > $@ 2>&1 || exit 0 @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_abs_lib.o: arm_abs_lib.s @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -march=armv7-a -o $@ $< @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@libarm_abs.so: arm_abs_lib.o ../ld-new diff --git a/binutils-2.25/gold/testsuite/arm_abs_global.sh b/binutils-2.25/gold/testsuite/arm_abs_global.sh index 7445b1c9..aed8ef3d 100755 --- a/binutils-2.25/gold/testsuite/arm_abs_global.sh +++ b/binutils-2.25/gold/testsuite/arm_abs_global.sh @@ -2,7 +2,7 @@ # arm_abs_global.sh -- test ARM absolute relocations against global symbols. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_attr_merge.sh b/binutils-2.25/gold/testsuite/arm_attr_merge.sh index a579bb43..6fbe9bff 100755 --- a/binutils-2.25/gold/testsuite/arm_attr_merge.sh +++ b/binutils-2.25/gold/testsuite/arm_attr_merge.sh @@ -2,7 +2,7 @@ # arm_attr_merge.sh -- test ARM attributes merging. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_branch_in_range.sh b/binutils-2.25/gold/testsuite/arm_branch_in_range.sh index b034c9b5..9ec38279 100755 --- a/binutils-2.25/gold/testsuite/arm_branch_in_range.sh +++ b/binutils-2.25/gold/testsuite/arm_branch_in_range.sh @@ -3,7 +3,7 @@ # arm_branch_in_range.sh -- test ARM/THUMB/THUMB branch instructions whose # targets are just within the branch range limits. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_branch_out_of_range.sh b/binutils-2.25/gold/testsuite/arm_branch_out_of_range.sh index aba1873b..1cc89360 100755 --- a/binutils-2.25/gold/testsuite/arm_branch_out_of_range.sh +++ b/binutils-2.25/gold/testsuite/arm_branch_out_of_range.sh @@ -3,7 +3,7 @@ # arm_branch_out_of_range.sh -- test ARM/THUMB/THUMB branch instructions whose # targets are just out of the branch range limits. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_branch_range.t b/binutils-2.25/gold/testsuite/arm_branch_range.t index 7db4c640..1b04ce0d 100644 --- a/binutils-2.25/gold/testsuite/arm_branch_range.t +++ b/binutils-2.25/gold/testsuite/arm_branch_range.t @@ -1,6 +1,6 @@ /* arm_banch_range.t -- linker script to test ARM branch range. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Doug Kwan . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_cortex_a8.sh b/binutils-2.25/gold/testsuite/arm_cortex_a8.sh index cd7c3c8f..d6341d2a 100755 --- a/binutils-2.25/gold/testsuite/arm_cortex_a8.sh +++ b/binutils-2.25/gold/testsuite/arm_cortex_a8.sh @@ -2,7 +2,7 @@ # arm_cortex_a8.sh -- a test case for the Cortex-A8 workaround. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_exidx_test.sh b/binutils-2.25/gold/testsuite/arm_exidx_test.sh index 9f7bd759..43dd579a 100755 --- a/binutils-2.25/gold/testsuite/arm_exidx_test.sh +++ b/binutils-2.25/gold/testsuite/arm_exidx_test.sh @@ -2,7 +2,7 @@ # arm_exidx_test.sh -- a test case for .ARM.exidx section. -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_farcall_arm_arm.sh b/binutils-2.25/gold/testsuite/arm_farcall_arm_arm.sh index ae59dd2e..187a9506 100755 --- a/binutils-2.25/gold/testsuite/arm_farcall_arm_arm.sh +++ b/binutils-2.25/gold/testsuite/arm_farcall_arm_arm.sh @@ -2,7 +2,7 @@ # arm_farcall_arm_arm.sh -- a test case for ARM->ARM farcall veneers -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Matthew Gretton-Dann # Based upon arm_cortex_a8.sh # Written by Doug Kwan . diff --git a/binutils-2.25/gold/testsuite/arm_farcall_arm_thumb.sh b/binutils-2.25/gold/testsuite/arm_farcall_arm_thumb.sh index 8847f441..cfc21692 100755 --- a/binutils-2.25/gold/testsuite/arm_farcall_arm_thumb.sh +++ b/binutils-2.25/gold/testsuite/arm_farcall_arm_thumb.sh @@ -2,7 +2,7 @@ # arm_farcall_arm_thumb.sh -- a test case for ARM->Thumb farcall veneers. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Matthew Gretton-Dann # Based upon arm_cortex_a8.sh # Written by Doug Kwan . diff --git a/binutils-2.25/gold/testsuite/arm_farcall_thumb_arm.sh b/binutils-2.25/gold/testsuite/arm_farcall_thumb_arm.sh index b13e7833..b9f2f672 100755 --- a/binutils-2.25/gold/testsuite/arm_farcall_thumb_arm.sh +++ b/binutils-2.25/gold/testsuite/arm_farcall_thumb_arm.sh @@ -2,7 +2,7 @@ # arm_farcall_thumb_arm.sh -- a test case for Thumb->ARM farcall veneers. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Matthew Gretton-Dann # Based upon arm_cortex_a8.sh # Written by Doug Kwan . diff --git a/binutils-2.25/gold/testsuite/arm_farcall_thumb_thumb.sh b/binutils-2.25/gold/testsuite/arm_farcall_thumb_thumb.sh index 838535c4..45fb2d54 100755 --- a/binutils-2.25/gold/testsuite/arm_farcall_thumb_thumb.sh +++ b/binutils-2.25/gold/testsuite/arm_farcall_thumb_thumb.sh @@ -2,7 +2,7 @@ # arm_farcall_thumb_thumb.sh -- a test case for Thumb->Thumb farcall veneers. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Matthew Gretton-Dann # Based upon arm_cortex_a8.sh # Written by Doug Kwan . diff --git a/binutils-2.25/gold/testsuite/arm_fix_1176.sh b/binutils-2.25/gold/testsuite/arm_fix_1176.sh index 4fe54658..5b29f682 100755 --- a/binutils-2.25/gold/testsuite/arm_fix_1176.sh +++ b/binutils-2.25/gold/testsuite/arm_fix_1176.sh @@ -2,7 +2,7 @@ # arm_fix_1176.sh -- a test case for the ARM1176 workaround. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Matthew Gretton-Dann # Based upon arm_cortex_a8.sh # Written by Doug Kwan . diff --git a/binutils-2.25/gold/testsuite/arm_fix_v4bx.sh b/binutils-2.25/gold/testsuite/arm_fix_v4bx.sh index aeead675..869ca8e0 100755 --- a/binutils-2.25/gold/testsuite/arm_fix_v4bx.sh +++ b/binutils-2.25/gold/testsuite/arm_fix_v4bx.sh @@ -2,7 +2,7 @@ # arm_v4bx.sh -- a test case for --fix-v4bx and --fix-v4bx-interworking. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_thm_jump11.t b/binutils-2.25/gold/testsuite/arm_thm_jump11.t index abd22524..b935e54d 100644 --- a/binutils-2.25/gold/testsuite/arm_thm_jump11.t +++ b/binutils-2.25/gold/testsuite/arm_thm_jump11.t @@ -1,6 +1,6 @@ /* arm_thm_jump11.t -- linker script to test R_ARM_THM_JUMP11 relocation. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. Written by Doug Kwan . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_thm_jump8.t b/binutils-2.25/gold/testsuite/arm_thm_jump8.t index d2af57d8..98abce89 100644 --- a/binutils-2.25/gold/testsuite/arm_thm_jump8.t +++ b/binutils-2.25/gold/testsuite/arm_thm_jump8.t @@ -1,6 +1,6 @@ /* arm_thm_jump8.t -- linker script to test R_ARM_THM_JUMP8 relocation. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. Written by Doug Kwan . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/arm_unaligned_reloc.sh b/binutils-2.25/gold/testsuite/arm_unaligned_reloc.sh index bb1c43e5..d1874538 100755 --- a/binutils-2.25/gold/testsuite/arm_unaligned_reloc.sh +++ b/binutils-2.25/gold/testsuite/arm_unaligned_reloc.sh @@ -2,7 +2,7 @@ # arm_unaligned_reloc.sh -- test ARM unaligned static data relocations. -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/basic_test.cc b/binutils-2.25/gold/testsuite/basic_test.cc index a8729cfa..0c032892 100644 --- a/binutils-2.25/gold/testsuite/basic_test.cc +++ b/binutils-2.25/gold/testsuite/basic_test.cc @@ -1,6 +1,6 @@ // basic_test.cc -- a test case for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/binary_test.cc b/binutils-2.25/gold/testsuite/binary_test.cc index be788bd1..4ee98689 100644 --- a/binutils-2.25/gold/testsuite/binary_test.cc +++ b/binutils-2.25/gold/testsuite/binary_test.cc @@ -1,6 +1,6 @@ // binary_test.cc -- test --format binary for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/binary_unittest.cc b/binutils-2.25/gold/testsuite/binary_unittest.cc index f920de82..35e2629a 100644 --- a/binutils-2.25/gold/testsuite/binary_unittest.cc +++ b/binutils-2.25/gold/testsuite/binary_unittest.cc @@ -1,6 +1,6 @@ // binary_unittest.cc -- test Binary_to_elf -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/common_test_1.c b/binutils-2.25/gold/testsuite/common_test_1.c index 8c79a0b5..a5b37073 100644 --- a/binutils-2.25/gold/testsuite/common_test_1.c +++ b/binutils-2.25/gold/testsuite/common_test_1.c @@ -1,6 +1,6 @@ /* common_test_1.c -- test common symbol sorting - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/common_test_1_v1.c b/binutils-2.25/gold/testsuite/common_test_1_v1.c index db65063f..29ccdc15 100644 --- a/binutils-2.25/gold/testsuite/common_test_1_v1.c +++ b/binutils-2.25/gold/testsuite/common_test_1_v1.c @@ -1,6 +1,6 @@ /* common_test_1_v1.c -- test common symbol sorting - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/common_test_1_v2.c b/binutils-2.25/gold/testsuite/common_test_1_v2.c index 81614bfc..0acb433f 100644 --- a/binutils-2.25/gold/testsuite/common_test_1_v2.c +++ b/binutils-2.25/gold/testsuite/common_test_1_v2.c @@ -1,6 +1,6 @@ /* common_test_1_v2.c -- test common symbol sorting - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/common_test_2.c b/binutils-2.25/gold/testsuite/common_test_2.c index 9f29dfb0..68b329e9 100644 --- a/binutils-2.25/gold/testsuite/common_test_2.c +++ b/binutils-2.25/gold/testsuite/common_test_2.c @@ -1,6 +1,6 @@ /* common_test_2.c -- test common symbol name conflicts - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/common_test_3.c b/binutils-2.25/gold/testsuite/common_test_3.c index a8d8120e..d13abbd3 100644 --- a/binutils-2.25/gold/testsuite/common_test_3.c +++ b/binutils-2.25/gold/testsuite/common_test_3.c @@ -1,6 +1,6 @@ /* common_test_3.c -- test common symbol name conflicts - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/constructor_test.cc b/binutils-2.25/gold/testsuite/constructor_test.cc index 5c3aa53f..795be820 100644 --- a/binutils-2.25/gold/testsuite/constructor_test.cc +++ b/binutils-2.25/gold/testsuite/constructor_test.cc @@ -1,6 +1,6 @@ // constructor_test.cc -- a test case for gold global constructors -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/copy_test.cc b/binutils-2.25/gold/testsuite/copy_test.cc index 856511d5..3de132e1 100644 --- a/binutils-2.25/gold/testsuite/copy_test.cc +++ b/binutils-2.25/gold/testsuite/copy_test.cc @@ -1,6 +1,6 @@ // copy_test.cc -- test copy relocs for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/copy_test_1.cc b/binutils-2.25/gold/testsuite/copy_test_1.cc index b653ded2..7e8c41d2 100644 --- a/binutils-2.25/gold/testsuite/copy_test_1.cc +++ b/binutils-2.25/gold/testsuite/copy_test_1.cc @@ -1,6 +1,6 @@ // copy_test_1.cc -- test copy relocs for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/copy_test_2.cc b/binutils-2.25/gold/testsuite/copy_test_2.cc index 8fd722a9..c949ba17 100644 --- a/binutils-2.25/gold/testsuite/copy_test_2.cc +++ b/binutils-2.25/gold/testsuite/copy_test_2.cc @@ -1,6 +1,6 @@ // copy_test_2.cc -- test copy relocs variables for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/copy_test_v1.cc b/binutils-2.25/gold/testsuite/copy_test_v1.cc index ce028843..b01f6734 100644 --- a/binutils-2.25/gold/testsuite/copy_test_v1.cc +++ b/binutils-2.25/gold/testsuite/copy_test_v1.cc @@ -1,6 +1,6 @@ // copy_test_v1.cc -- test copy relocs for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/debug_msg.cc b/binutils-2.25/gold/testsuite/debug_msg.cc index e5beb5f9..13efa986 100644 --- a/binutils-2.25/gold/testsuite/debug_msg.cc +++ b/binutils-2.25/gold/testsuite/debug_msg.cc @@ -1,6 +1,6 @@ // debug_msg.cc -- a test case for printing debug info for missing symbols. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -66,7 +66,7 @@ OdrBase* CreateOdrDerived2(); // in odr_violation2.cc extern "C" int OverriddenCFunction(int i); // in odr_violation*.cc inline int SometimesInlineFunction(int i) { // strong in odr_violation2.cc. - return i; + return i * i * 3; } diff --git a/binutils-2.25/gold/testsuite/debug_msg.sh b/binutils-2.25/gold/testsuite/debug_msg.sh index 4426762d..785e5c5f 100755 --- a/binutils-2.25/gold/testsuite/debug_msg.sh +++ b/binutils-2.25/gold/testsuite/debug_msg.sh @@ -2,7 +2,7 @@ # debug_msg.sh -- a test case for printing debug info for missing symbols. -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/defsym_test.sh b/binutils-2.25/gold/testsuite/defsym_test.sh index 6c1ff115..2bedcf6b 100755 --- a/binutils-2.25/gold/testsuite/defsym_test.sh +++ b/binutils-2.25/gold/testsuite/defsym_test.sh @@ -2,7 +2,7 @@ # defsym_test.sh -- test that --defsym copies type and visiblity. -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/discard_locals_relocatable_test.c b/binutils-2.25/gold/testsuite/discard_locals_relocatable_test.c index 79f82db9..95ceb0c8 100644 --- a/binutils-2.25/gold/testsuite/discard_locals_relocatable_test.c +++ b/binutils-2.25/gold/testsuite/discard_locals_relocatable_test.c @@ -1,6 +1,6 @@ /* discard_locals_relocatable_test.c -- test --discard-locals/--discard-all -r - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Viktor Kutuzov . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/discard_locals_test.c b/binutils-2.25/gold/testsuite/discard_locals_test.c index e8766c88..f1c68e27 100644 --- a/binutils-2.25/gold/testsuite/discard_locals_test.c +++ b/binutils-2.25/gold/testsuite/discard_locals_test.c @@ -1,6 +1,6 @@ /* discard_locals_test.c -- test --discard-locals option. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Doug Kwan . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/discard_locals_test.sh b/binutils-2.25/gold/testsuite/discard_locals_test.sh index 185d09b2..0a9ab828 100755 --- a/binutils-2.25/gold/testsuite/discard_locals_test.sh +++ b/binutils-2.25/gold/testsuite/discard_locals_test.sh @@ -2,7 +2,7 @@ # discard_locals_test.sh -- test that local symbols are discarded. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dwp_test.h b/binutils-2.25/gold/testsuite/dwp_test.h index 8e265ee2..1e17fd3b 100644 --- a/binutils-2.25/gold/testsuite/dwp_test.h +++ b/binutils-2.25/gold/testsuite/dwp_test.h @@ -1,6 +1,6 @@ // dwp_test.h -- a test case for dwp, header file -*- C++ -*- -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dwp_test_1.cc b/binutils-2.25/gold/testsuite/dwp_test_1.cc index b3ae8bc8..01a22b09 100644 --- a/binutils-2.25/gold/testsuite/dwp_test_1.cc +++ b/binutils-2.25/gold/testsuite/dwp_test_1.cc @@ -1,6 +1,6 @@ // dwp_test_1.cc -- a test case for dwp -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dwp_test_1.sh b/binutils-2.25/gold/testsuite/dwp_test_1.sh index 90146acd..dfec67d1 100755 --- a/binutils-2.25/gold/testsuite/dwp_test_1.sh +++ b/binutils-2.25/gold/testsuite/dwp_test_1.sh @@ -2,7 +2,7 @@ # dwp_test_1.sh -- Test the dwp tool. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dwp_test_1b.cc b/binutils-2.25/gold/testsuite/dwp_test_1b.cc index 7ca28a51..17203163 100644 --- a/binutils-2.25/gold/testsuite/dwp_test_1b.cc +++ b/binutils-2.25/gold/testsuite/dwp_test_1b.cc @@ -1,6 +1,6 @@ // dwp_test_1b.cc -- a test case for dwp -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dwp_test_2.cc b/binutils-2.25/gold/testsuite/dwp_test_2.cc index 10baef0f..db96196c 100644 --- a/binutils-2.25/gold/testsuite/dwp_test_2.cc +++ b/binutils-2.25/gold/testsuite/dwp_test_2.cc @@ -1,6 +1,6 @@ // dwp_test_2.cc -- a test case for dwp -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dwp_test_2.sh b/binutils-2.25/gold/testsuite/dwp_test_2.sh index dd0fe510..3db54086 100755 --- a/binutils-2.25/gold/testsuite/dwp_test_2.sh +++ b/binutils-2.25/gold/testsuite/dwp_test_2.sh @@ -2,7 +2,7 @@ # dwp_test_2.sh -- Test the dwp tool. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dwp_test_main.cc b/binutils-2.25/gold/testsuite/dwp_test_main.cc index 7cf72cae..fc8eac39 100644 --- a/binutils-2.25/gold/testsuite/dwp_test_main.cc +++ b/binutils-2.25/gold/testsuite/dwp_test_main.cc @@ -1,6 +1,6 @@ // dwp_test_main.cc -- a test case for dwp -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dyn_weak_ref.sh b/binutils-2.25/gold/testsuite/dyn_weak_ref.sh index e2d200d0..9591edcc 100755 --- a/binutils-2.25/gold/testsuite/dyn_weak_ref.sh +++ b/binutils-2.25/gold/testsuite/dyn_weak_ref.sh @@ -3,7 +3,7 @@ # dyn_weak_ref.sh -- test weak reference remains weak in output even if # gold sees a dynamic weak reference before a static one. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dyn_weak_ref_1.c b/binutils-2.25/gold/testsuite/dyn_weak_ref_1.c index b32f3a8e..d9dd9969 100644 --- a/binutils-2.25/gold/testsuite/dyn_weak_ref_1.c +++ b/binutils-2.25/gold/testsuite/dyn_weak_ref_1.c @@ -1,7 +1,7 @@ // dyn_weak_ref_1.c -- test that a weak ref remains weak in output when // there is a DSO with the same weak ref. -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dyn_weak_ref_2.c b/binutils-2.25/gold/testsuite/dyn_weak_ref_2.c index dfd4be10..2804aa52 100644 --- a/binutils-2.25/gold/testsuite/dyn_weak_ref_2.c +++ b/binutils-2.25/gold/testsuite/dyn_weak_ref_2.c @@ -1,7 +1,7 @@ // dyn_weak_ref_1.c -- test that a weak ref remains weak in output when // there is a DSO with the same weak ref. -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dynamic_list.sh b/binutils-2.25/gold/testsuite/dynamic_list.sh index e2ef9fd0..1f5817f5 100755 --- a/binutils-2.25/gold/testsuite/dynamic_list.sh +++ b/binutils-2.25/gold/testsuite/dynamic_list.sh @@ -2,7 +2,7 @@ # dynamic_list.sh -- test --dynamic-list and --dynamic-list-* -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dynamic_list_2.cc b/binutils-2.25/gold/testsuite/dynamic_list_2.cc index 59133123..63f552c7 100644 --- a/binutils-2.25/gold/testsuite/dynamic_list_2.cc +++ b/binutils-2.25/gold/testsuite/dynamic_list_2.cc @@ -1,6 +1,6 @@ // dynamic_list_test_2.cc -- Test --dynamic-list with shared libraries. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dynamic_list_2.t b/binutils-2.25/gold/testsuite/dynamic_list_2.t index eef848d8..44e6c6c1 100644 --- a/binutils-2.25/gold/testsuite/dynamic_list_2.t +++ b/binutils-2.25/gold/testsuite/dynamic_list_2.t @@ -1,6 +1,6 @@ /* dynamic_list_2.t -- script file for building dynamic_list_lib2.so. - Copyright (C) 2014 Free Software Foundation, Inc. + Copyright (C) 2014-2015 Free Software Foundation, Inc. Written by Cary Coutant . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dynamic_list_lib1.cc b/binutils-2.25/gold/testsuite/dynamic_list_lib1.cc index afc36ca2..ccf70e73 100644 --- a/binutils-2.25/gold/testsuite/dynamic_list_lib1.cc +++ b/binutils-2.25/gold/testsuite/dynamic_list_lib1.cc @@ -1,6 +1,6 @@ // dynamic_list_test_lib1.cc -- Test --dynamic-list with shared libraries. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/dynamic_list_lib2.cc b/binutils-2.25/gold/testsuite/dynamic_list_lib2.cc index 8ed5be5c..54d722d3 100644 --- a/binutils-2.25/gold/testsuite/dynamic_list_lib2.cc +++ b/binutils-2.25/gold/testsuite/dynamic_list_lib2.cc @@ -1,6 +1,6 @@ // dynamic_list_test_lib2.cc -- Test --dynamic-list with shared libraries. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ehdr_start_def.cc b/binutils-2.25/gold/testsuite/ehdr_start_def.cc index f102a78a..6a5723d3 100644 --- a/binutils-2.25/gold/testsuite/ehdr_start_def.cc +++ b/binutils-2.25/gold/testsuite/ehdr_start_def.cc @@ -1,6 +1,6 @@ // ehdr_start_def.cc -- test for __ehdr_start linker-defined symbol. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ehdr_start_test.cc b/binutils-2.25/gold/testsuite/ehdr_start_test.cc index a119b5e8..0d216017 100644 --- a/binutils-2.25/gold/testsuite/ehdr_start_test.cc +++ b/binutils-2.25/gold/testsuite/ehdr_start_test.cc @@ -1,6 +1,6 @@ // ehdr_start_test.cc -- test for __ehdr_start linker-defined symbol. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ehdr_start_test.t b/binutils-2.25/gold/testsuite/ehdr_start_test.t index 50daa645..e8981362 100644 --- a/binutils-2.25/gold/testsuite/ehdr_start_test.t +++ b/binutils-2.25/gold/testsuite/ehdr_start_test.t @@ -1,6 +1,6 @@ /* ehdr_start_test.t -- __ehdr_start test for gold - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ehdr_start_test_4.sh b/binutils-2.25/gold/testsuite/ehdr_start_test_4.sh index 5e3d20fc..2d998e06 100755 --- a/binutils-2.25/gold/testsuite/ehdr_start_test_4.sh +++ b/binutils-2.25/gold/testsuite/ehdr_start_test_4.sh @@ -2,7 +2,7 @@ # ehdr_start_test_4.sh -- test that __ehdr_start symbol is undefined. -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/exception_test.h b/binutils-2.25/gold/testsuite/exception_test.h index f7825bf9..efab7587 100644 --- a/binutils-2.25/gold/testsuite/exception_test.h +++ b/binutils-2.25/gold/testsuite/exception_test.h @@ -1,6 +1,6 @@ // exception_test.h -- exception test case for gold, header file -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/exception_test_1.cc b/binutils-2.25/gold/testsuite/exception_test_1.cc index 7972f017..cb7c8ec3 100644 --- a/binutils-2.25/gold/testsuite/exception_test_1.cc +++ b/binutils-2.25/gold/testsuite/exception_test_1.cc @@ -1,6 +1,6 @@ // exception_test_1.cc -- test exception handling for gold, file 1 of 2 -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/exception_test_2.cc b/binutils-2.25/gold/testsuite/exception_test_2.cc index 1267cf63..51001338 100644 --- a/binutils-2.25/gold/testsuite/exception_test_2.cc +++ b/binutils-2.25/gold/testsuite/exception_test_2.cc @@ -1,6 +1,6 @@ // exception_test_1.cc -- test exception handling for gold, file 1 of 2 -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/exception_test_main.cc b/binutils-2.25/gold/testsuite/exception_test_main.cc index a4c644b1..4eca1bed 100644 --- a/binutils-2.25/gold/testsuite/exception_test_main.cc +++ b/binutils-2.25/gold/testsuite/exception_test_main.cc @@ -1,6 +1,6 @@ // exception_test_main.cc -- an exception test case for gold, main function -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/exclude_libs_test.sh b/binutils-2.25/gold/testsuite/exclude_libs_test.sh index 09f50b9e..6993d05e 100755 --- a/binutils-2.25/gold/testsuite/exclude_libs_test.sh +++ b/binutils-2.25/gold/testsuite/exclude_libs_test.sh @@ -2,7 +2,7 @@ # exclude_libs_test.sh -- test that library symbols are not exported. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/final_layout.cc b/binutils-2.25/gold/testsuite/final_layout.cc index 71065c77..61d24cea 100644 --- a/binutils-2.25/gold/testsuite/final_layout.cc +++ b/binutils-2.25/gold/testsuite/final_layout.cc @@ -1,6 +1,6 @@ // final_layout.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/final_layout.sh b/binutils-2.25/gold/testsuite/final_layout.sh index c93e2657..4b51210e 100755 --- a/binutils-2.25/gold/testsuite/final_layout.sh +++ b/binutils-2.25/gold/testsuite/final_layout.sh @@ -2,7 +2,7 @@ # final_layout.sh -- test --final-layout -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_comdat_test.sh b/binutils-2.25/gold/testsuite/gc_comdat_test.sh index 1a38f212..0b4bdf84 100755 --- a/binutils-2.25/gold/testsuite/gc_comdat_test.sh +++ b/binutils-2.25/gold/testsuite/gc_comdat_test.sh @@ -2,7 +2,7 @@ # gc_comdat_test.sh -- test --gc-sections -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_comdat_test_1.cc b/binutils-2.25/gold/testsuite/gc_comdat_test_1.cc index 8db55e91..e3b3a5fe 100644 --- a/binutils-2.25/gold/testsuite/gc_comdat_test_1.cc +++ b/binutils-2.25/gold/testsuite/gc_comdat_test_1.cc @@ -1,6 +1,6 @@ // gc_comdat_test_1.cc -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_comdat_test_2.cc b/binutils-2.25/gold/testsuite/gc_comdat_test_2.cc index 1d68be27..2c471a27 100644 --- a/binutils-2.25/gold/testsuite/gc_comdat_test_2.cc +++ b/binutils-2.25/gold/testsuite/gc_comdat_test_2.cc @@ -1,6 +1,6 @@ // gc_comdat_test_2.cc -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_dynamic_list_test.c b/binutils-2.25/gold/testsuite/gc_dynamic_list_test.c index fb9a92ee..efc02637 100644 --- a/binutils-2.25/gold/testsuite/gc_dynamic_list_test.c +++ b/binutils-2.25/gold/testsuite/gc_dynamic_list_test.c @@ -1,6 +1,6 @@ // gc_dynamic_list_test.cc -- Check that --gc-sections honors --dynamic-list. -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_dynamic_list_test.sh b/binutils-2.25/gold/testsuite/gc_dynamic_list_test.sh index a586929e..cbe7cd1d 100755 --- a/binutils-2.25/gold/testsuite/gc_dynamic_list_test.sh +++ b/binutils-2.25/gold/testsuite/gc_dynamic_list_test.sh @@ -2,7 +2,7 @@ # gc_comdat_test.sh -- test --gc-sections -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_dynamic_list_test.t b/binutils-2.25/gold/testsuite/gc_dynamic_list_test.t index c0b818e2..0af5607d 100644 --- a/binutils-2.25/gold/testsuite/gc_dynamic_list_test.t +++ b/binutils-2.25/gold/testsuite/gc_dynamic_list_test.t @@ -1,6 +1,6 @@ /* gc_dynamic_list_test.t -- script file for gc_dynamic_list_test.cc - Copyright (C) 2014 Free Software Foundation, Inc. + Copyright (C) 2014-2015 Free Software Foundation, Inc. Written by Cary Coutant . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_orphan_section_test.cc b/binutils-2.25/gold/testsuite/gc_orphan_section_test.cc index bcf06e4d..308b46e2 100644 --- a/binutils-2.25/gold/testsuite/gc_orphan_section_test.cc +++ b/binutils-2.25/gold/testsuite/gc_orphan_section_test.cc @@ -1,6 +1,6 @@ // gc_orphan_section_test.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_orphan_section_test.sh b/binutils-2.25/gold/testsuite/gc_orphan_section_test.sh index de2d2fe1..a6bfa26e 100755 --- a/binutils-2.25/gold/testsuite/gc_orphan_section_test.sh +++ b/binutils-2.25/gold/testsuite/gc_orphan_section_test.sh @@ -2,7 +2,7 @@ # gc_orphan_section_test.sh -- test --gc-sections -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_tls_test.cc b/binutils-2.25/gold/testsuite/gc_tls_test.cc index 2d29d68b..bc4b867d 100644 --- a/binutils-2.25/gold/testsuite/gc_tls_test.cc +++ b/binutils-2.25/gold/testsuite/gc_tls_test.cc @@ -1,6 +1,6 @@ // gc_tls_test.cc -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gc_tls_test.sh b/binutils-2.25/gold/testsuite/gc_tls_test.sh index 7b6485e9..2241c53f 100755 --- a/binutils-2.25/gold/testsuite/gc_tls_test.sh +++ b/binutils-2.25/gold/testsuite/gc_tls_test.sh @@ -2,7 +2,7 @@ # gc_tls_test.sh -- test -- gc + tls -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gdb_index_test.cc b/binutils-2.25/gold/testsuite/gdb_index_test.cc index 6a562c3b..b9592a8c 100644 --- a/binutils-2.25/gold/testsuite/gdb_index_test.cc +++ b/binutils-2.25/gold/testsuite/gdb_index_test.cc @@ -1,6 +1,6 @@ // gdb_index_test.cc -- a test case for the --gdb-index option. -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gdb_index_test_1.sh b/binutils-2.25/gold/testsuite/gdb_index_test_1.sh index 5fae5500..14d023df 100755 --- a/binutils-2.25/gold/testsuite/gdb_index_test_1.sh +++ b/binutils-2.25/gold/testsuite/gdb_index_test_1.sh @@ -2,7 +2,7 @@ # gdb_index_test_1.sh -- a test case for the --gdb-index option. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gdb_index_test_2.sh b/binutils-2.25/gold/testsuite/gdb_index_test_2.sh index a1d4d83d..9d8b52be 100755 --- a/binutils-2.25/gold/testsuite/gdb_index_test_2.sh +++ b/binutils-2.25/gold/testsuite/gdb_index_test_2.sh @@ -2,7 +2,7 @@ # gdb_index_test_2.sh -- a test case for the --gdb-index option. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gdb_index_test_3.c b/binutils-2.25/gold/testsuite/gdb_index_test_3.c index 683510c8..f64eaff0 100644 --- a/binutils-2.25/gold/testsuite/gdb_index_test_3.c +++ b/binutils-2.25/gold/testsuite/gdb_index_test_3.c @@ -1,6 +1,6 @@ // gdb_index_test.c -- a test case for the --gdb-index option. -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gdb_index_test_3.sh b/binutils-2.25/gold/testsuite/gdb_index_test_3.sh index 7b4948d7..c7ba93ca 100755 --- a/binutils-2.25/gold/testsuite/gdb_index_test_3.sh +++ b/binutils-2.25/gold/testsuite/gdb_index_test_3.sh @@ -2,7 +2,7 @@ # gdb_index_test_3.sh -- a test case for the --gdb-index option. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gdb_index_test_4.sh b/binutils-2.25/gold/testsuite/gdb_index_test_4.sh index 3d5d66bb..8f82f8f3 100755 --- a/binutils-2.25/gold/testsuite/gdb_index_test_4.sh +++ b/binutils-2.25/gold/testsuite/gdb_index_test_4.sh @@ -2,7 +2,7 @@ # gdb_index_test_4.sh -- a test case for the --gdb-index option. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/gdb_index_test_comm.sh b/binutils-2.25/gold/testsuite/gdb_index_test_comm.sh index e8888250..e7436611 100755 --- a/binutils-2.25/gold/testsuite/gdb_index_test_comm.sh +++ b/binutils-2.25/gold/testsuite/gdb_index_test_comm.sh @@ -2,7 +2,7 @@ # gdb_index_test_comm.sh -- common code for --gdb-index tests. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/hidden_test.sh b/binutils-2.25/gold/testsuite/hidden_test.sh index 39ebbf68..8366bc93 100755 --- a/binutils-2.25/gold/testsuite/hidden_test.sh +++ b/binutils-2.25/gold/testsuite/hidden_test.sh @@ -2,7 +2,7 @@ # hidden_test.sh -- a test case for hidden and internal symbols. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/hidden_test_1.c b/binutils-2.25/gold/testsuite/hidden_test_1.c index e9c96e6e..ea240275 100644 --- a/binutils-2.25/gold/testsuite/hidden_test_1.c +++ b/binutils-2.25/gold/testsuite/hidden_test_1.c @@ -1,6 +1,6 @@ /* hidden_test_1.c -- test hidden and internal symbols - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/hidden_test_main.c b/binutils-2.25/gold/testsuite/hidden_test_main.c index 60b8893b..9feb678e 100644 --- a/binutils-2.25/gold/testsuite/hidden_test_main.c +++ b/binutils-2.25/gold/testsuite/hidden_test_main.c @@ -1,6 +1,6 @@ /* hidden_test_main.c -- test hidden and internal symbols - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_keep_unique_test.cc b/binutils-2.25/gold/testsuite/icf_keep_unique_test.cc index 75a83859..4a196e70 100644 --- a/binutils-2.25/gold/testsuite/icf_keep_unique_test.cc +++ b/binutils-2.25/gold/testsuite/icf_keep_unique_test.cc @@ -1,6 +1,6 @@ // icf_keep_unique_test.cc -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_keep_unique_test.sh b/binutils-2.25/gold/testsuite/icf_keep_unique_test.sh index d481d019..eabe9f75 100755 --- a/binutils-2.25/gold/testsuite/icf_keep_unique_test.sh +++ b/binutils-2.25/gold/testsuite/icf_keep_unique_test.sh @@ -2,7 +2,7 @@ # icf_keep_unique_test.sh -- test --icf --keep-unique -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.cc b/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.cc index dc588a34..e22197ab 100644 --- a/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.cc +++ b/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.cc @@ -1,6 +1,6 @@ // icf_preemptible_functions_test.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.sh b/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.sh index c2a9f1ce..4446f3bd 100755 --- a/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.sh +++ b/binutils-2.25/gold/testsuite/icf_preemptible_functions_test.sh @@ -2,7 +2,7 @@ # icf_preemptible_functions_test.sh -- test --icf=all -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_safe_so_test.cc b/binutils-2.25/gold/testsuite/icf_safe_so_test.cc index bca852f8..a0732bed 100644 --- a/binutils-2.25/gold/testsuite/icf_safe_so_test.cc +++ b/binutils-2.25/gold/testsuite/icf_safe_so_test.cc @@ -1,6 +1,6 @@ // icf_safe_so_test.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. @@ -22,10 +22,10 @@ // The goal of this program is to verify if identical code folding // in safe mode correctly folds functions in a shared object. The -// foo_* functions below should not be folded. For x86-64, -// foo_glob and bar_glob should be folded as their function pointers -// are addresses of PLT entries in shared objects. For 32-bit X86, -// the hidden protected and internal symbols can be folded. +// foo_* functions below should not be folded on X86_64. +// For 32-bit X86, the hidden protected and internal symbols can be folded. +// foo_glob and bar_glob should not be folded, because function pointer +// of foo_glob is taken. int __attribute__ ((visibility ("protected"))) foo_prot() diff --git a/binutils-2.25/gold/testsuite/icf_safe_so_test.sh b/binutils-2.25/gold/testsuite/icf_safe_so_test.sh index 804334da..dd33a13a 100755 --- a/binutils-2.25/gold/testsuite/icf_safe_so_test.sh +++ b/binutils-2.25/gold/testsuite/icf_safe_so_test.sh @@ -2,7 +2,7 @@ # icf_safe_so_test.sh -- test --icf=safe -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_safe_test.cc b/binutils-2.25/gold/testsuite/icf_safe_test.cc index 46bced18..cb042e54 100644 --- a/binutils-2.25/gold/testsuite/icf_safe_test.cc +++ b/binutils-2.25/gold/testsuite/icf_safe_test.cc @@ -1,6 +1,6 @@ // icf_safe_test.cc -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_safe_test.sh b/binutils-2.25/gold/testsuite/icf_safe_test.sh index e18468ca..9e6fffa1 100755 --- a/binutils-2.25/gold/testsuite/icf_safe_test.sh +++ b/binutils-2.25/gold/testsuite/icf_safe_test.sh @@ -2,7 +2,7 @@ # icf_safe_test.sh -- test --icf=safe -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. @@ -57,7 +57,7 @@ END { arch_specific_safe_fold() { - grep_x86=`grep -q -e "Advanced Micro Devices X86-64" -e "Intel 80386" -e "ARM" -e "TILE" -e "PowerPC" $2` + grep_x86=`grep -q -e "Advanced Micro Devices X86-64" -e "Intel 80386" -e "ARM" -e "TILE" -e "PowerPC" -e "AArch64" $2` if [ $? -eq 0 ]; then check_fold $3 $4 $5 diff --git a/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test.sh b/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test.sh index 64b69d3f..f35d155e 100755 --- a/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test.sh +++ b/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test.sh @@ -2,7 +2,7 @@ # icf_sht_rel_addend_test.sh -- test --icf=all -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_1.cc b/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_1.cc index 8f20a71a..2dacc1fe 100644 --- a/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_1.cc +++ b/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_1.cc @@ -1,6 +1,6 @@ // icf_sht_rel_addend_test_1.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_2.cc b/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_2.cc index dfc2bd4f..904b4759 100644 --- a/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_2.cc +++ b/binutils-2.25/gold/testsuite/icf_sht_rel_addend_test_2.cc @@ -1,6 +1,6 @@ // icf_sht_rel_addend_test_2.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_string_merge_test.cc b/binutils-2.25/gold/testsuite/icf_string_merge_test.cc index 869ee805..7b9ae272 100644 --- a/binutils-2.25/gold/testsuite/icf_string_merge_test.cc +++ b/binutils-2.25/gold/testsuite/icf_string_merge_test.cc @@ -1,6 +1,6 @@ // icf_string_merge_test.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_string_merge_test.sh b/binutils-2.25/gold/testsuite/icf_string_merge_test.sh index a86728c6..281cc799 100755 --- a/binutils-2.25/gold/testsuite/icf_string_merge_test.sh +++ b/binutils-2.25/gold/testsuite/icf_string_merge_test.sh @@ -2,7 +2,7 @@ # icf_string_merge_test.sh -- test --icf=all -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_test.cc b/binutils-2.25/gold/testsuite/icf_test.cc index 41168ec2..5f99bcef 100644 --- a/binutils-2.25/gold/testsuite/icf_test.cc +++ b/binutils-2.25/gold/testsuite/icf_test.cc @@ -1,6 +1,6 @@ // icf_test.cc -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_test.sh b/binutils-2.25/gold/testsuite/icf_test.sh index 07af1a9d..57d2081a 100755 --- a/binutils-2.25/gold/testsuite/icf_test.sh +++ b/binutils-2.25/gold/testsuite/icf_test.sh @@ -2,7 +2,7 @@ # icf_test.sh -- test --icf -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/icf_virtual_function_folding_test.cc b/binutils-2.25/gold/testsuite/icf_virtual_function_folding_test.cc index ba144bf8..41e95d21 100644 --- a/binutils-2.25/gold/testsuite/icf_virtual_function_folding_test.cc +++ b/binutils-2.25/gold/testsuite/icf_virtual_function_folding_test.cc @@ -1,6 +1,6 @@ // icf_virtual_function_folding_test.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/incr_comdat_test_1.cc b/binutils-2.25/gold/testsuite/incr_comdat_test_1.cc index 7a798bdb..4c152468 100644 --- a/binutils-2.25/gold/testsuite/incr_comdat_test_1.cc +++ b/binutils-2.25/gold/testsuite/incr_comdat_test_1.cc @@ -1,6 +1,6 @@ // incr_comdat_test_1.cc -- test incremental update with comdat sections -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/incr_comdat_test_2_v1.cc b/binutils-2.25/gold/testsuite/incr_comdat_test_2_v1.cc index 02307ac9..c6b329b6 100644 --- a/binutils-2.25/gold/testsuite/incr_comdat_test_2_v1.cc +++ b/binutils-2.25/gold/testsuite/incr_comdat_test_2_v1.cc @@ -1,6 +1,6 @@ // incr_comdat_test_2.cc -- test incremental update with comdat sections -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/incr_comdat_test_2_v2.cc b/binutils-2.25/gold/testsuite/incr_comdat_test_2_v2.cc index 936d7a1b..bec44014 100644 --- a/binutils-2.25/gold/testsuite/incr_comdat_test_2_v2.cc +++ b/binutils-2.25/gold/testsuite/incr_comdat_test_2_v2.cc @@ -1,6 +1,6 @@ // incr_comdat_test_2.cc -- test incremental update with comdat sections -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/incr_comdat_test_2_v3.cc b/binutils-2.25/gold/testsuite/incr_comdat_test_2_v3.cc index 3c402e98..de0248c2 100644 --- a/binutils-2.25/gold/testsuite/incr_comdat_test_2_v3.cc +++ b/binutils-2.25/gold/testsuite/incr_comdat_test_2_v3.cc @@ -1,6 +1,6 @@ // incr_comdat_test_2.cc -- test incremental update with comdat sections -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/incremental_test.sh b/binutils-2.25/gold/testsuite/incremental_test.sh index d8c0c845..cee1a0c8 100755 --- a/binutils-2.25/gold/testsuite/incremental_test.sh +++ b/binutils-2.25/gold/testsuite/incremental_test.sh @@ -2,7 +2,7 @@ # incremental_test.sh -- test that incremental linking information is correct. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Rafael Avila de Espindola # and Cary Coutant diff --git a/binutils-2.25/gold/testsuite/incremental_test_1.c b/binutils-2.25/gold/testsuite/incremental_test_1.c index 850d1164..2d5df6ca 100644 --- a/binutils-2.25/gold/testsuite/incremental_test_1.c +++ b/binutils-2.25/gold/testsuite/incremental_test_1.c @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Rafael Avila de Espindola // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/incremental_test_2.c b/binutils-2.25/gold/testsuite/incremental_test_2.c index a86c0fba..0da76c12 100644 --- a/binutils-2.25/gold/testsuite/incremental_test_2.c +++ b/binutils-2.25/gold/testsuite/incremental_test_2.c @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Rafael Avila de Espindola // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/initpri1.c b/binutils-2.25/gold/testsuite/initpri1.c index 2fbe6bd9..b37b977f 100644 --- a/binutils-2.25/gold/testsuite/initpri1.c +++ b/binutils-2.25/gold/testsuite/initpri1.c @@ -1,6 +1,6 @@ /* initpri1.c -- test constructor priorities. - Copyright (C) 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2015 Free Software Foundation, Inc. Copied from the gcc testsuite, where the test was contributed by Mark Mitchell . diff --git a/binutils-2.25/gold/testsuite/initpri2.c b/binutils-2.25/gold/testsuite/initpri2.c index 023d76ab..ac84e0d9 100644 --- a/binutils-2.25/gold/testsuite/initpri2.c +++ b/binutils-2.25/gold/testsuite/initpri2.c @@ -1,6 +1,6 @@ /* initpri2.c -- test mixing init_array and ctor priorities. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. Copied from the gcc configury, where the test was contributed by H.J. Lu . diff --git a/binutils-2.25/gold/testsuite/initpri3.c b/binutils-2.25/gold/testsuite/initpri3.c index 65963a90..c8c4d043 100644 --- a/binutils-2.25/gold/testsuite/initpri3.c +++ b/binutils-2.25/gold/testsuite/initpri3.c @@ -1,6 +1,6 @@ /* initpri3.c -- test ctor odering when using init_array. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/justsyms.t b/binutils-2.25/gold/testsuite/justsyms.t index 2af2d01f..450abc1b 100644 --- a/binutils-2.25/gold/testsuite/justsyms.t +++ b/binutils-2.25/gold/testsuite/justsyms.t @@ -1,6 +1,6 @@ /* justsyms.t -- test --just-symbols for gold. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/justsyms_1.cc b/binutils-2.25/gold/testsuite/justsyms_1.cc index 362f939b..fff79207 100644 --- a/binutils-2.25/gold/testsuite/justsyms_1.cc +++ b/binutils-2.25/gold/testsuite/justsyms_1.cc @@ -1,6 +1,6 @@ // justsyms_1.cc -- test --just-symbols for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/justsyms_2.cc b/binutils-2.25/gold/testsuite/justsyms_2.cc index c0d9c948..215d92eb 100644 --- a/binutils-2.25/gold/testsuite/justsyms_2.cc +++ b/binutils-2.25/gold/testsuite/justsyms_2.cc @@ -1,6 +1,6 @@ // justsyms_2.cc -- test --just-symbols for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/justsyms_exec.c b/binutils-2.25/gold/testsuite/justsyms_exec.c index 3bb6d2fd..49500805 100644 --- a/binutils-2.25/gold/testsuite/justsyms_exec.c +++ b/binutils-2.25/gold/testsuite/justsyms_exec.c @@ -1,6 +1,6 @@ // justsyms_exec.c -- test --just-symbols for gold -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/justsyms_lib.c b/binutils-2.25/gold/testsuite/justsyms_lib.c index 9e043d9e..4882f3a4 100644 --- a/binutils-2.25/gold/testsuite/justsyms_lib.c +++ b/binutils-2.25/gold/testsuite/justsyms_lib.c @@ -1,6 +1,6 @@ // justsyms_lib.cc -- test --just-symbols for gold -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/large.c b/binutils-2.25/gold/testsuite/large.c index 0702d112..fa1c0529 100644 --- a/binutils-2.25/gold/testsuite/large.c +++ b/binutils-2.25/gold/testsuite/large.c @@ -1,6 +1,6 @@ /* large.c -- a test case for gold - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/large_symbol_alignment.cc b/binutils-2.25/gold/testsuite/large_symbol_alignment.cc index 296d7aab..190c3e9b 100644 --- a/binutils-2.25/gold/testsuite/large_symbol_alignment.cc +++ b/binutils-2.25/gold/testsuite/large_symbol_alignment.cc @@ -1,6 +1,6 @@ // large_symbol_alignment.cc -- a test case for gold -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013-2015 Free Software Foundation, Inc. // Written by Alexander Ivchenko . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/leb128_unittest.cc b/binutils-2.25/gold/testsuite/leb128_unittest.cc index 5b438b35..c2d1be6d 100644 --- a/binutils-2.25/gold/testsuite/leb128_unittest.cc +++ b/binutils-2.25/gold/testsuite/leb128_unittest.cc @@ -1,6 +1,6 @@ // leb_unittest.cc -- test read_signed_LEB_128 and read_unsigned_LEB_128 -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/many_sections_test.cc b/binutils-2.25/gold/testsuite/many_sections_test.cc index 44530e21..4a820083 100644 --- a/binutils-2.25/gold/testsuite/many_sections_test.cc +++ b/binutils-2.25/gold/testsuite/many_sections_test.cc @@ -1,6 +1,6 @@ // many_sections_test.cc -- test lots of sections for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/memory_test.sh b/binutils-2.25/gold/testsuite/memory_test.sh index 4e858011..5b12971e 100755 --- a/binutils-2.25/gold/testsuite/memory_test.sh +++ b/binutils-2.25/gold/testsuite/memory_test.sh @@ -2,7 +2,7 @@ # memory_test.sh -- test MEMORY regions. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Nick Clifton # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/merge_string_literals.sh b/binutils-2.25/gold/testsuite/merge_string_literals.sh index f17ab132..db656151 100755 --- a/binutils-2.25/gold/testsuite/merge_string_literals.sh +++ b/binutils-2.25/gold/testsuite/merge_string_literals.sh @@ -2,7 +2,7 @@ # merge_string_literals.sh -- test -# Copyright (C) 2013-2014 Free Software Foundation, Inc. +# Copyright (C) 2013-2015 Free Software Foundation, Inc. # Written by Alexander Ivchenko . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/merge_string_literals_1.cc b/binutils-2.25/gold/testsuite/merge_string_literals_1.cc index b313dfc2..c57b8b55 100644 --- a/binutils-2.25/gold/testsuite/merge_string_literals_1.cc +++ b/binutils-2.25/gold/testsuite/merge_string_literals_1.cc @@ -1,6 +1,6 @@ // merge_string_literals_1.c -- a test case for gold -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013-2015 Free Software Foundation, Inc. // Written by Alexander Ivchenko // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/merge_string_literals_2.cc b/binutils-2.25/gold/testsuite/merge_string_literals_2.cc index 73265f53..2c931c3f 100644 --- a/binutils-2.25/gold/testsuite/merge_string_literals_2.cc +++ b/binutils-2.25/gold/testsuite/merge_string_literals_2.cc @@ -1,6 +1,6 @@ // merge_string_literals_2.c -- a test case for gold -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013-2015 Free Software Foundation, Inc. // Written by Alexander Ivchenko // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/missing_key_func.cc b/binutils-2.25/gold/testsuite/missing_key_func.cc index e89e95a0..c685c79c 100644 --- a/binutils-2.25/gold/testsuite/missing_key_func.cc +++ b/binutils-2.25/gold/testsuite/missing_key_func.cc @@ -1,6 +1,6 @@ // basic_test.cc -- a test case for gold -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/missing_key_func.sh b/binutils-2.25/gold/testsuite/missing_key_func.sh index 0027c7f8..465f5679 100755 --- a/binutils-2.25/gold/testsuite/missing_key_func.sh +++ b/binutils-2.25/gold/testsuite/missing_key_func.sh @@ -3,7 +3,7 @@ # missing_key_func.sh -- a test case for printing error messages when # a class is missing its key function. -# Copyright (C) 2013-2014 Free Software Foundation, Inc. +# Copyright (C) 2013-2015 Free Software Foundation, Inc. # Written by Cary Coutant # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/no_version_test.c b/binutils-2.25/gold/testsuite/no_version_test.c index 1171fad9..de3fe456 100644 --- a/binutils-2.25/gold/testsuite/no_version_test.c +++ b/binutils-2.25/gold/testsuite/no_version_test.c @@ -1,6 +1,6 @@ // ver_no_default.c -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/no_version_test.sh b/binutils-2.25/gold/testsuite/no_version_test.sh index cbcf24f8..6d86c345 100755 --- a/binutils-2.25/gold/testsuite/no_version_test.sh +++ b/binutils-2.25/gold/testsuite/no_version_test.sh @@ -3,7 +3,7 @@ # no_version_test.sh -- test that .gnu.version* sections are not created # in a shared object when symbol versioning is not used. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Doug Kwan # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/object_unittest.cc b/binutils-2.25/gold/testsuite/object_unittest.cc index adbd2757..1764d73b 100644 --- a/binutils-2.25/gold/testsuite/object_unittest.cc +++ b/binutils-2.25/gold/testsuite/object_unittest.cc @@ -1,6 +1,6 @@ // object_unittest.cc -- test Object, Relobj, etc. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/pie_copyrelocs_shared_test.cc b/binutils-2.25/gold/testsuite/pie_copyrelocs_shared_test.cc index 85134175..3beacd81 100644 --- a/binutils-2.25/gold/testsuite/pie_copyrelocs_shared_test.cc +++ b/binutils-2.25/gold/testsuite/pie_copyrelocs_shared_test.cc @@ -1,7 +1,7 @@ // pie_copyrelocs_shared_test.cc -- a test case for gold, used // by pie_copyrelocs_test -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/pie_copyrelocs_test.cc b/binutils-2.25/gold/testsuite/pie_copyrelocs_test.cc index bebe89dc..a2ca746e 100644 --- a/binutils-2.25/gold/testsuite/pie_copyrelocs_test.cc +++ b/binutils-2.25/gold/testsuite/pie_copyrelocs_test.cc @@ -1,6 +1,6 @@ // pie_coprelocs_test.cc -- a test case for gold -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_common_test_1.c b/binutils-2.25/gold/testsuite/plugin_common_test_1.c index 6f764fdc..f8b3291a 100644 --- a/binutils-2.25/gold/testsuite/plugin_common_test_1.c +++ b/binutils-2.25/gold/testsuite/plugin_common_test_1.c @@ -1,6 +1,6 @@ /* plugin_common_test_1.c -- test common symbol handling in plugins - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_common_test_2.c b/binutils-2.25/gold/testsuite/plugin_common_test_2.c index df9f7f1f..fa9114e1 100644 --- a/binutils-2.25/gold/testsuite/plugin_common_test_2.c +++ b/binutils-2.25/gold/testsuite/plugin_common_test_2.c @@ -1,6 +1,6 @@ /* plugin_common_test_2.c -- test common symbol handling in plugins - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_final_layout.cc b/binutils-2.25/gold/testsuite/plugin_final_layout.cc index a40c5d69..d00c8d53 100644 --- a/binutils-2.25/gold/testsuite/plugin_final_layout.cc +++ b/binutils-2.25/gold/testsuite/plugin_final_layout.cc @@ -1,6 +1,6 @@ // plugin_final_layout.cc -- a test case for gold -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_final_layout.sh b/binutils-2.25/gold/testsuite/plugin_final_layout.sh index dc456fab..47a6a20d 100755 --- a/binutils-2.25/gold/testsuite/plugin_final_layout.sh +++ b/binutils-2.25/gold/testsuite/plugin_final_layout.sh @@ -2,7 +2,7 @@ # plugin_final_layout.sh -- test -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_section_order.c b/binutils-2.25/gold/testsuite/plugin_section_order.c index 48d30df2..29fcae71 100644 --- a/binutils-2.25/gold/testsuite/plugin_section_order.c +++ b/binutils-2.25/gold/testsuite/plugin_section_order.c @@ -1,6 +1,6 @@ /* plugin_section_reorder.c -- Simple plugin to reorder function sections - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. Written by Sriraman Tallam . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_test.c b/binutils-2.25/gold/testsuite/plugin_test.c index 79ae44e1..cf6adf3e 100644 --- a/binutils-2.25/gold/testsuite/plugin_test.c +++ b/binutils-2.25/gold/testsuite/plugin_test.c @@ -1,6 +1,6 @@ /* test_plugin.c -- simple linker plugin test - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Cary Coutant . This file is part of gold. @@ -263,15 +263,35 @@ claim_file_hook (const struct ld_plugin_input_file* file, int* claimed) int vis; int is_comdat; int i; + int irfile_was_opened = 0; + char syms_name[80]; (*message)(LDPL_INFO, "%s: claim file hook called (offset = %ld, size = %ld)", file->name, (long)file->offset, (long)file->filesize); + /* Look for matching syms file for an archive member. */ + if (file->offset == 0) + snprintf(syms_name, sizeof(syms_name), "%s.syms", file->name); + else + snprintf(syms_name, sizeof(syms_name), "%s-%d.syms", + file->name, (int)file->offset); + irfile = fopen(syms_name, "r"); + if (irfile != NULL) + { + irfile_was_opened = 1; + end_offset = 1 << 20; + } + + /* Otherwise, see if the file itself is a syms file. */ + if (!irfile_was_opened) + { + irfile = fdopen(file->fd, "r"); + (void)fseek(irfile, file->offset, SEEK_SET); + end_offset = file->offset + file->filesize; + } + /* Look for the beginning of output from readelf -s. */ - irfile = fdopen(file->fd, "r"); - (void)fseek(irfile, file->offset, SEEK_SET); - end_offset = file->offset + file->filesize; len = fread(buf, 1, 13, irfile); if (len < 13 || strncmp(buf, "\nSymbol table", 13) != 0) return LDPS_OK; @@ -378,6 +398,8 @@ claim_file_hook (const struct ld_plugin_input_file* file, int* claimed) (*add_symbols)(file->handle, nsyms, syms); *claimed = 1; + if (irfile_was_opened) + fclose(irfile); return LDPS_OK; } @@ -474,12 +496,31 @@ all_symbols_read_hook(void) claimed_file != NULL; claimed_file = claimed_file->next) { + int irfile_was_opened = 0; + char syms_name[80]; + (*get_input_file) (claimed_file->handle, &file); + if (file.offset == 0) + snprintf(syms_name, sizeof(syms_name), "%s.syms", file.name); + else + snprintf(syms_name, sizeof(syms_name), "%s-%d.syms", + file.name, (int)file.offset); + irfile = fopen(syms_name, "r"); + if (irfile != NULL) + { + irfile_was_opened = 1; + end_offset = 1 << 20; + } + + if (!irfile_was_opened) + { + irfile = fdopen(file.fd, "r"); + (void)fseek(irfile, file.offset, SEEK_SET); + end_offset = file.offset + file.filesize; + } + /* Look for the beginning of output from readelf -s. */ - irfile = fdopen(file.fd, "r"); - (void)fseek(irfile, file.offset, SEEK_SET); - end_offset = file.offset + file.filesize; len = fread(buf, 1, 13, irfile); if (len < 13 || strncmp(buf, "\nSymbol table", 13) != 0) { @@ -509,6 +550,9 @@ all_symbols_read_hook(void) } } + if (irfile_was_opened) + fclose(irfile); + (*release_input_file) (claimed_file->handle); if (filename == NULL) diff --git a/binutils-2.25/gold/testsuite/plugin_test_1.sh b/binutils-2.25/gold/testsuite/plugin_test_1.sh index 0f9c9b1d..c54a74f5 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_1.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_1.sh @@ -2,7 +2,7 @@ # plugin_test_1.sh -- a test case for the plugin API. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. @@ -43,14 +43,14 @@ check plugin_test_1.err "API version:" check plugin_test_1.err "gold version:" check plugin_test_1.err "option: _Z4f13iv" check plugin_test_1.err "two_file_test_main.o: claim file hook called" -check plugin_test_1.err "two_file_test_1.syms: claim file hook called" -check plugin_test_1.err "two_file_test_1b.syms: claim file hook called" -check plugin_test_1.err "two_file_test_2.syms: claim file hook called" -check plugin_test_1.err "two_file_test_1.syms: _Z4f13iv: PREVAILING_DEF_IRONLY" -check plugin_test_1.err "two_file_test_1.syms: _Z2t2v: PREVAILING_DEF_REG" -check plugin_test_1.err "two_file_test_1.syms: v2: RESOLVED_IR" -check plugin_test_1.err "two_file_test_1.syms: t17data: RESOLVED_IR" -check plugin_test_1.err "two_file_test_2.syms: _Z4f13iv: PREEMPTED_IR" +check plugin_test_1.err "two_file_test_1.o.syms: claim file hook called" +check plugin_test_1.err "two_file_test_1b.o.syms: claim file hook called" +check plugin_test_1.err "two_file_test_2.o.syms: claim file hook called" +check plugin_test_1.err "two_file_test_1.o.syms: _Z4f13iv: PREVAILING_DEF_IRONLY" +check plugin_test_1.err "two_file_test_1.o.syms: _Z2t2v: PREVAILING_DEF_REG" +check plugin_test_1.err "two_file_test_1.o.syms: v2: RESOLVED_IR" +check plugin_test_1.err "two_file_test_1.o.syms: t17data: RESOLVED_IR" +check plugin_test_1.err "two_file_test_2.o.syms: _Z4f13iv: PREEMPTED_IR" check plugin_test_1.err "two_file_test_1.o: adding new input file" check plugin_test_1.err "two_file_test_1b.o: adding new input file" check plugin_test_1.err "two_file_test_2.o: adding new input file" diff --git a/binutils-2.25/gold/testsuite/plugin_test_10.sh b/binutils-2.25/gold/testsuite/plugin_test_10.sh index 80b9f155..62d22e7a 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_10.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_10.sh @@ -2,7 +2,7 @@ # plugin_test_10.sh -- a test case for the plugin API. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Rafael Ávila de Espíndola # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_test_11.sh b/binutils-2.25/gold/testsuite/plugin_test_11.sh new file mode 100755 index 00000000..4e1057a7 --- /dev/null +++ b/binutils-2.25/gold/testsuite/plugin_test_11.sh @@ -0,0 +1,59 @@ +#!/bin/sh + +# plugin_test_11.sh -- a test case for the plugin API. + +# Copyright (C) 2008-2015 Free Software Foundation, Inc. +# Written by Cary Coutant . + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +# This file goes with plugin_test_1.c, a simple plug-in library that +# exercises the basic interfaces and prints out version numbers and +# options passed to the plugin. + +check() +{ + if ! grep -q "$2" "$1" + then + echo "Did not find expected output in $1:" + echo " $2" + echo "" + echo "Actual output below:" + cat "$1" + exit 1 + fi +} + +check plugin_test_11.err "API version:" +check plugin_test_11.err "gold version:" +check plugin_test_11.err "option: _Z4f13iv" +check plugin_test_11.err "two_file_test_main.o: claim file hook called" +check plugin_test_11.err "two_file_test_1.o: claim file hook called" +check plugin_test_11.err "two_file_test_1b.o: claim file hook called" +check plugin_test_11.err "two_file_test_2.o: claim file hook called" +check plugin_test_11.err "two_file_test_1.o: _Z4f13iv: PREVAILING_DEF_IRONLY" +check plugin_test_11.err "two_file_test_1.o: _Z2t2v: PREVAILING_DEF_REG" +check plugin_test_11.err "two_file_test_1.o: v2: RESOLVED_IR" +check plugin_test_11.err "two_file_test_1.o: t17data: RESOLVED_IR" +check plugin_test_11.err "two_file_test_2.o: _Z4f13iv: PREEMPTED_IR" +check plugin_test_11.err "two_file_test_1.o: adding new input file" +check plugin_test_11.err "two_file_test_1b.o: adding new input file" +check plugin_test_11.err "two_file_test_2.o: adding new input file" +check plugin_test_11.err "cleanup hook called" + +exit 0 diff --git a/binutils-2.25/gold/testsuite/plugin_test_2.sh b/binutils-2.25/gold/testsuite/plugin_test_2.sh index e06a85f1..cb8c71c8 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_2.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_2.sh @@ -2,7 +2,7 @@ # plugin_test_2.sh -- a test case for the plugin API. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. @@ -42,13 +42,13 @@ check() check plugin_test_2.err "API version:" check plugin_test_2.err "gold version:" check plugin_test_2.err "two_file_test_main.o: claim file hook called" -check plugin_test_2.err "two_file_test_1.syms: claim file hook called" -check plugin_test_2.err "two_file_test_1b.syms: claim file hook called" +check plugin_test_2.err "two_file_test_1.o.syms: claim file hook called" +check plugin_test_2.err "two_file_test_1b.o.syms: claim file hook called" check plugin_test_2.err "two_file_shared_2.so: claim file hook called" -check plugin_test_2.err "two_file_test_1.syms: _Z4f13iv: PREVAILING_DEF_IRONLY_EXP" -check plugin_test_2.err "two_file_test_1.syms: _Z2t2v: PREVAILING_DEF_REG" -check plugin_test_2.err "two_file_test_1.syms: v2: RESOLVED_DYN" -check plugin_test_2.err "two_file_test_1.syms: t17data: RESOLVED_DYN" +check plugin_test_2.err "two_file_test_1.o.syms: _Z4f13iv: PREVAILING_DEF_IRONLY_EXP" +check plugin_test_2.err "two_file_test_1.o.syms: _Z2t2v: PREVAILING_DEF_REG" +check plugin_test_2.err "two_file_test_1.o.syms: v2: RESOLVED_DYN" +check plugin_test_2.err "two_file_test_1.o.syms: t17data: RESOLVED_DYN" check plugin_test_2.err "two_file_test_1.o: adding new input file" check plugin_test_2.err "two_file_test_1b.o: adding new input file" check plugin_test_2.err "cleanup hook called" diff --git a/binutils-2.25/gold/testsuite/plugin_test_3.sh b/binutils-2.25/gold/testsuite/plugin_test_3.sh index 61a7d956..c61a662d 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_3.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_3.sh @@ -2,7 +2,7 @@ # plugin_test_3.sh -- a test case for the plugin API. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. @@ -43,14 +43,14 @@ check plugin_test_3.err "API version:" check plugin_test_3.err "gold version:" check plugin_test_3.err "option: _Z4f13iv" check plugin_test_3.err "two_file_test_main.o: claim file hook called" -check plugin_test_3.err "two_file_test_1.syms: claim file hook called" -check plugin_test_3.err "two_file_test_1b.syms: claim file hook called" -check plugin_test_3.err "two_file_test_2.syms: claim file hook called" -check plugin_test_3.err "two_file_test_1.syms: _Z4f13iv: PREVAILING_DEF_IRONLY_EXP" -check plugin_test_3.err "two_file_test_1.syms: _Z2t2v: PREVAILING_DEF_REG" -check plugin_test_3.err "two_file_test_1.syms: v2: RESOLVED_IR" -check plugin_test_3.err "two_file_test_1.syms: t17data: RESOLVED_IR" -check plugin_test_3.err "two_file_test_2.syms: _Z4f13iv: PREEMPTED_IR" +check plugin_test_3.err "two_file_test_1.o.syms: claim file hook called" +check plugin_test_3.err "two_file_test_1b.o.syms: claim file hook called" +check plugin_test_3.err "two_file_test_2.o.syms: claim file hook called" +check plugin_test_3.err "two_file_test_1.o.syms: _Z4f13iv: PREVAILING_DEF_IRONLY_EXP" +check plugin_test_3.err "two_file_test_1.o.syms: _Z2t2v: PREVAILING_DEF_REG" +check plugin_test_3.err "two_file_test_1.o.syms: v2: RESOLVED_IR" +check plugin_test_3.err "two_file_test_1.o.syms: t17data: RESOLVED_IR" +check plugin_test_3.err "two_file_test_2.o.syms: _Z4f13iv: PREEMPTED_IR" check plugin_test_3.err "two_file_test_1.o: adding new input file" check plugin_test_3.err "two_file_test_1b.o: adding new input file" check plugin_test_3.err "two_file_test_2.o: adding new input file" diff --git a/binutils-2.25/gold/testsuite/plugin_test_4.sh b/binutils-2.25/gold/testsuite/plugin_test_4.sh index 9500e410..dae96886 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_4.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_4.sh @@ -2,7 +2,7 @@ # plugin_test_4.sh -- a test case for the plugin API. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_test_6.sh b/binutils-2.25/gold/testsuite/plugin_test_6.sh index 1edb4619..b81ef3e7 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_6.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_6.sh @@ -2,7 +2,7 @@ # plugin_test_6.sh -- a test case for the plugin API. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. @@ -41,18 +41,18 @@ check() check plugin_test_6.err "API version:" check plugin_test_6.err "gold version:" -check plugin_test_6.err "plugin_common_test_1.syms: claim file hook called" -check plugin_test_6.err "plugin_common_test_2.syms: claim file hook called" -check plugin_test_6.err "plugin_common_test_1.syms: c1: PREVAILING_DEF_IRONLY" -check plugin_test_6.err "plugin_common_test_1.syms: c2: PREVAILING_DEF_IRONLY" -check plugin_test_6.err "plugin_common_test_1.syms: c3: RESOLVED_IR" -check plugin_test_6.err "plugin_common_test_1.syms: c4: RESOLVED_IR" -check plugin_test_6.err "plugin_common_test_1.syms: c5: PREVAILING_DEF_IRONLY" -check plugin_test_6.err "plugin_common_test_2.syms: c1: RESOLVED_IR" -check plugin_test_6.err "plugin_common_test_2.syms: c2: RESOLVED_IR" -check plugin_test_6.err "plugin_common_test_2.syms: c3: PREVAILING_DEF_IRONLY" -check plugin_test_6.err "plugin_common_test_2.syms: c4: PREVAILING_DEF_IRONLY" -check plugin_test_6.err "plugin_common_test_2.syms: c5: RESOLVED_IR" +check plugin_test_6.err "plugin_common_test_1.o.syms: claim file hook called" +check plugin_test_6.err "plugin_common_test_2.o.syms: claim file hook called" +check plugin_test_6.err "plugin_common_test_1.o.syms: c1: PREVAILING_DEF_IRONLY" +check plugin_test_6.err "plugin_common_test_1.o.syms: c2: PREVAILING_DEF_IRONLY" +check plugin_test_6.err "plugin_common_test_1.o.syms: c3: RESOLVED_IR" +check plugin_test_6.err "plugin_common_test_1.o.syms: c4: RESOLVED_IR" +check plugin_test_6.err "plugin_common_test_1.o.syms: c5: PREVAILING_DEF_IRONLY" +check plugin_test_6.err "plugin_common_test_2.o.syms: c1: RESOLVED_IR" +check plugin_test_6.err "plugin_common_test_2.o.syms: c2: RESOLVED_IR" +check plugin_test_6.err "plugin_common_test_2.o.syms: c3: PREVAILING_DEF_IRONLY" +check plugin_test_6.err "plugin_common_test_2.o.syms: c4: PREVAILING_DEF_IRONLY" +check plugin_test_6.err "plugin_common_test_2.o.syms: c5: RESOLVED_IR" check plugin_test_6.err "cleanup hook called" exit 0 diff --git a/binutils-2.25/gold/testsuite/plugin_test_7.sh b/binutils-2.25/gold/testsuite/plugin_test_7.sh index 04a554a3..6ecd78f6 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_7.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_7.sh @@ -2,7 +2,7 @@ # plugin_test_7.sh -- a test case for the plugin API with GC. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Rafael Avila de Espindola . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_test_7_1.c b/binutils-2.25/gold/testsuite/plugin_test_7_1.c index fdb00748..61aaffc0 100644 --- a/binutils-2.25/gold/testsuite/plugin_test_7_1.c +++ b/binutils-2.25/gold/testsuite/plugin_test_7_1.c @@ -1,6 +1,6 @@ /* plugin_test_7_1.c -- a test case for the plugin API with GC. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Rafael Avila de Espindola . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_test_7_2.c b/binutils-2.25/gold/testsuite/plugin_test_7_2.c index e2ca4261..8e02520c 100644 --- a/binutils-2.25/gold/testsuite/plugin_test_7_2.c +++ b/binutils-2.25/gold/testsuite/plugin_test_7_2.c @@ -1,6 +1,6 @@ /* plugin_test_7_1.c -- a test case for the plugin API with GC. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Rafael Avila de Espindola . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/plugin_test_tls.sh b/binutils-2.25/gold/testsuite/plugin_test_tls.sh index fe30cf4e..9873f2e8 100755 --- a/binutils-2.25/gold/testsuite/plugin_test_tls.sh +++ b/binutils-2.25/gold/testsuite/plugin_test_tls.sh @@ -2,7 +2,7 @@ # plugin_test_tls.sh -- a test case for the plugin API. -# Copyright (C) 2013-2014 Free Software Foundation, Inc. +# Copyright (C) 2013-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. @@ -43,15 +43,15 @@ check plugin_test_tls.err "API version:" check plugin_test_tls.err "gold version:" check plugin_test_tls.err "option: _Z4f13iv" check plugin_test_tls.err "two_file_test_tls.o: claim file hook called" -check plugin_test_tls.err "two_file_test_1.syms: claim file hook called" -check plugin_test_tls.err "two_file_test_1b.syms: claim file hook called" -check plugin_test_tls.err "two_file_test_2_tls.syms: claim file hook called" -check plugin_test_tls.err "two_file_test_1.syms: _Z4f13iv: PREVAILING_DEF_IRONLY" -check plugin_test_tls.err "two_file_test_1.syms: _Z2t2v: PREVAILING_DEF_REG" -check plugin_test_tls.err "two_file_test_1.syms: v2: RESOLVED_IR" -check plugin_test_tls.err "two_file_test_1.syms: t17data: RESOLVED_IR" -check plugin_test_tls.err "two_file_test_2_tls.syms: _Z4f13iv: PREEMPTED_IR" -check plugin_test_tls.err "two_file_test_2_tls.syms: tls1: PREVAILING_DEF_REG" +check plugin_test_tls.err "two_file_test_1.o.syms: claim file hook called" +check plugin_test_tls.err "two_file_test_1b.o.syms: claim file hook called" +check plugin_test_tls.err "two_file_test_2_tls.o.syms: claim file hook called" +check plugin_test_tls.err "two_file_test_1.o.syms: _Z4f13iv: PREVAILING_DEF_IRONLY" +check plugin_test_tls.err "two_file_test_1.o.syms: _Z2t2v: PREVAILING_DEF_REG" +check plugin_test_tls.err "two_file_test_1.o.syms: v2: RESOLVED_IR" +check plugin_test_tls.err "two_file_test_1.o.syms: t17data: RESOLVED_IR" +check plugin_test_tls.err "two_file_test_2_tls.o.syms: _Z4f13iv: PREEMPTED_IR" +check plugin_test_tls.err "two_file_test_2_tls.o.syms: tls1: PREVAILING_DEF_REG" check plugin_test_tls.err "two_file_test_1.o: adding new input file" check plugin_test_tls.err "two_file_test_1b.o: adding new input file" check plugin_test_tls.err "two_file_test_2_tls.o: adding new input file" diff --git a/binutils-2.25/gold/testsuite/pr12826.sh b/binutils-2.25/gold/testsuite/pr12826.sh index bd3e3a9c..9ec4d739 100755 --- a/binutils-2.25/gold/testsuite/pr12826.sh +++ b/binutils-2.25/gold/testsuite/pr12826.sh @@ -2,7 +2,7 @@ # pr12826.sh -- a test case for combining ARM arch attributes. -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/pr14265.sh b/binutils-2.25/gold/testsuite/pr14265.sh index c82875fa..137c5952 100755 --- a/binutils-2.25/gold/testsuite/pr14265.sh +++ b/binutils-2.25/gold/testsuite/pr14265.sh @@ -2,7 +2,7 @@ # pr14265.sh -- test --gc-sections with KEEP -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Nick Clifton # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/protected_1.cc b/binutils-2.25/gold/testsuite/protected_1.cc index e9725a95..32c46866 100644 --- a/binutils-2.25/gold/testsuite/protected_1.cc +++ b/binutils-2.25/gold/testsuite/protected_1.cc @@ -1,6 +1,6 @@ // protected_1.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/protected_2.cc b/binutils-2.25/gold/testsuite/protected_2.cc index 44bd9afb..e966c3a2 100644 --- a/binutils-2.25/gold/testsuite/protected_2.cc +++ b/binutils-2.25/gold/testsuite/protected_2.cc @@ -1,6 +1,6 @@ // protected_2.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/protected_3.cc b/binutils-2.25/gold/testsuite/protected_3.cc index b22181cd..4b9469b0 100644 --- a/binutils-2.25/gold/testsuite/protected_3.cc +++ b/binutils-2.25/gold/testsuite/protected_3.cc @@ -1,6 +1,6 @@ // protected_2.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/protected_4.cc b/binutils-2.25/gold/testsuite/protected_4.cc index 918d7c13..bdeb483b 100644 --- a/binutils-2.25/gold/testsuite/protected_4.cc +++ b/binutils-2.25/gold/testsuite/protected_4.cc @@ -1,6 +1,6 @@ // protected_4.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/protected_main_1.cc b/binutils-2.25/gold/testsuite/protected_main_1.cc index b1c3b87e..bf95fd8c 100644 --- a/binutils-2.25/gold/testsuite/protected_main_1.cc +++ b/binutils-2.25/gold/testsuite/protected_main_1.cc @@ -1,6 +1,6 @@ // protected_main_1.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/protected_main_2.cc b/binutils-2.25/gold/testsuite/protected_main_2.cc index 29bfcfa3..f4d5bf9c 100644 --- a/binutils-2.25/gold/testsuite/protected_main_2.cc +++ b/binutils-2.25/gold/testsuite/protected_main_2.cc @@ -1,6 +1,6 @@ // protected_main_2.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/protected_main_3.cc b/binutils-2.25/gold/testsuite/protected_main_3.cc index 02f4c948..82a5f6e3 100644 --- a/binutils-2.25/gold/testsuite/protected_main_3.cc +++ b/binutils-2.25/gold/testsuite/protected_main_3.cc @@ -1,6 +1,6 @@ // protected_main_3.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/relro_script_test.t b/binutils-2.25/gold/testsuite/relro_script_test.t index e4af879b..f940ebd1 100644 --- a/binutils-2.25/gold/testsuite/relro_script_test.t +++ b/binutils-2.25/gold/testsuite/relro_script_test.t @@ -1,6 +1,6 @@ /* relro_test.t -- relro script test for gold - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/relro_test.cc b/binutils-2.25/gold/testsuite/relro_test.cc index b64e5cf2..2eadf6e5 100644 --- a/binutils-2.25/gold/testsuite/relro_test.cc +++ b/binutils-2.25/gold/testsuite/relro_test.cc @@ -1,6 +1,6 @@ // relro_test.cc -- test -z relro for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/relro_test.sh b/binutils-2.25/gold/testsuite/relro_test.sh index 69f0ff7c..c721d011 100755 --- a/binutils-2.25/gold/testsuite/relro_test.sh +++ b/binutils-2.25/gold/testsuite/relro_test.sh @@ -2,7 +2,7 @@ # relro_test.sh -- test -z relro -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/relro_test_main.cc b/binutils-2.25/gold/testsuite/relro_test_main.cc index 8a142742..2106b5ed 100644 --- a/binutils-2.25/gold/testsuite/relro_test_main.cc +++ b/binutils-2.25/gold/testsuite/relro_test_main.cc @@ -1,6 +1,6 @@ // relro_test_main.cc -- test -z relro for gold, main function -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/retain_symbols_file_test.sh b/binutils-2.25/gold/testsuite/retain_symbols_file_test.sh index 21373d10..d36a1bd1 100755 --- a/binutils-2.25/gold/testsuite/retain_symbols_file_test.sh +++ b/binutils-2.25/gold/testsuite/retain_symbols_file_test.sh @@ -2,7 +2,7 @@ # retain_symbols_file_test.sh -- a test case for -retain-symbols-file -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Craig Silverstein . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_1.cc b/binutils-2.25/gold/testsuite/script_test_1.cc index ecdf67e2..32ff1023 100644 --- a/binutils-2.25/gold/testsuite/script_test_1.cc +++ b/binutils-2.25/gold/testsuite/script_test_1.cc @@ -1,6 +1,6 @@ // script_test_1.cc -- linker script test 1 for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_1.t b/binutils-2.25/gold/testsuite/script_test_1.t index 22a1e393..53c6b904 100644 --- a/binutils-2.25/gold/testsuite/script_test_1.t +++ b/binutils-2.25/gold/testsuite/script_test_1.t @@ -1,6 +1,6 @@ /* script_test_1.t -- linker script test 1 for gold - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_10.sh b/binutils-2.25/gold/testsuite/script_test_10.sh index 41b2bc75..c565c481 100755 --- a/binutils-2.25/gold/testsuite/script_test_10.sh +++ b/binutils-2.25/gold/testsuite/script_test_10.sh @@ -2,7 +2,7 @@ # script_test_10.sh -- test for the section order. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Viktor Kutuzov . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_10.t b/binutils-2.25/gold/testsuite/script_test_10.t index 14b0578f..185b8261 100644 --- a/binutils-2.25/gold/testsuite/script_test_10.t +++ b/binutils-2.25/gold/testsuite/script_test_10.t @@ -1,6 +1,6 @@ /* script_test_10.t -- test section order for gold. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Viktor Kutuzov . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_2.cc b/binutils-2.25/gold/testsuite/script_test_2.cc index 59c007c2..80ca2467 100644 --- a/binutils-2.25/gold/testsuite/script_test_2.cc +++ b/binutils-2.25/gold/testsuite/script_test_2.cc @@ -1,6 +1,6 @@ // script_test_2.cc -- linker script test 2 for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_2.t b/binutils-2.25/gold/testsuite/script_test_2.t index eabf4ec3..e852e38e 100644 --- a/binutils-2.25/gold/testsuite/script_test_2.t +++ b/binutils-2.25/gold/testsuite/script_test_2.t @@ -1,6 +1,6 @@ /* script_test_2.t -- linker script test 2 for gold - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_2a.cc b/binutils-2.25/gold/testsuite/script_test_2a.cc index 7c1990db..31293736 100644 --- a/binutils-2.25/gold/testsuite/script_test_2a.cc +++ b/binutils-2.25/gold/testsuite/script_test_2a.cc @@ -1,6 +1,6 @@ // script_test_2a.cc -- linker script test 2, file 1 -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_2b.cc b/binutils-2.25/gold/testsuite/script_test_2b.cc index c99d10d2..c3529578 100644 --- a/binutils-2.25/gold/testsuite/script_test_2b.cc +++ b/binutils-2.25/gold/testsuite/script_test_2b.cc @@ -1,6 +1,6 @@ // script_test_2a.cc -- linker script test 2, file 2 -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_3.sh b/binutils-2.25/gold/testsuite/script_test_3.sh index a24505e1..dec0d117 100755 --- a/binutils-2.25/gold/testsuite/script_test_3.sh +++ b/binutils-2.25/gold/testsuite/script_test_3.sh @@ -2,7 +2,7 @@ # script_test_3.sh -- test PHDRS -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_3.t b/binutils-2.25/gold/testsuite/script_test_3.t index 22a0c6f3..c4b4fd69 100644 --- a/binutils-2.25/gold/testsuite/script_test_3.t +++ b/binutils-2.25/gold/testsuite/script_test_3.t @@ -1,6 +1,6 @@ /* script_test_3.t -- linker script test 3 for gold - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_4.sh b/binutils-2.25/gold/testsuite/script_test_4.sh index 6a0a26b8..074b3d33 100755 --- a/binutils-2.25/gold/testsuite/script_test_4.sh +++ b/binutils-2.25/gold/testsuite/script_test_4.sh @@ -2,7 +2,7 @@ # script_test_4.sh -- test load segment -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_4.t b/binutils-2.25/gold/testsuite/script_test_4.t index c441ad5b..169b9507 100644 --- a/binutils-2.25/gold/testsuite/script_test_4.t +++ b/binutils-2.25/gold/testsuite/script_test_4.t @@ -1,6 +1,6 @@ /* script_test_4.t -- linker script test 4 for gold - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_5.cc b/binutils-2.25/gold/testsuite/script_test_5.cc index d90477c7..9ed612b3 100644 --- a/binutils-2.25/gold/testsuite/script_test_5.cc +++ b/binutils-2.25/gold/testsuite/script_test_5.cc @@ -1,6 +1,6 @@ // script_test_5.cc -- a test case for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_5.sh b/binutils-2.25/gold/testsuite/script_test_5.sh index 9ff94861..d5f644ea 100755 --- a/binutils-2.25/gold/testsuite/script_test_5.sh +++ b/binutils-2.25/gold/testsuite/script_test_5.sh @@ -2,7 +2,7 @@ # script_test_5.sh -- test linker script with uncovered sections -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Cary Coutant . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_5.t b/binutils-2.25/gold/testsuite/script_test_5.t index 65ada933..fa6a0e72 100644 --- a/binutils-2.25/gold/testsuite/script_test_5.t +++ b/binutils-2.25/gold/testsuite/script_test_5.t @@ -1,6 +1,6 @@ /* script_test_5.t -- linker script test 5 for gold - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Cary Coutant . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_6.sh b/binutils-2.25/gold/testsuite/script_test_6.sh index fc8d5049..263e686b 100755 --- a/binutils-2.25/gold/testsuite/script_test_6.sh +++ b/binutils-2.25/gold/testsuite/script_test_6.sh @@ -2,7 +2,7 @@ # script_test_6.sh -- test for -Ttext, -Tdata and -Tbss with a script. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_6.t b/binutils-2.25/gold/testsuite/script_test_6.t index e123a1e0..31fdd9ea 100644 --- a/binutils-2.25/gold/testsuite/script_test_6.t +++ b/binutils-2.25/gold/testsuite/script_test_6.t @@ -1,6 +1,6 @@ /* script_test_5.t -- linker script test 5 for gold - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Cary Coutant . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_7.sh b/binutils-2.25/gold/testsuite/script_test_7.sh index efcbb4c5..1e5c9d0e 100755 --- a/binutils-2.25/gold/testsuite/script_test_7.sh +++ b/binutils-2.25/gold/testsuite/script_test_7.sh @@ -2,7 +2,7 @@ # script_test_7.sh -- test for SEGMENT_START expressions. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_7.t b/binutils-2.25/gold/testsuite/script_test_7.t index 575225d0..96adceaf 100644 --- a/binutils-2.25/gold/testsuite/script_test_7.t +++ b/binutils-2.25/gold/testsuite/script_test_7.t @@ -1,6 +1,6 @@ /* script_test_5.t -- linker script test 5 for gold - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Cary Coutant . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_8.sh b/binutils-2.25/gold/testsuite/script_test_8.sh index 02531d27..0533545c 100755 --- a/binutils-2.25/gold/testsuite/script_test_8.sh +++ b/binutils-2.25/gold/testsuite/script_test_8.sh @@ -3,7 +3,7 @@ # script_test_8.sh -- test for SEGMENT_START expressions with # -Ttext, -Tdata and -Tbss in a script. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_9.cc b/binutils-2.25/gold/testsuite/script_test_9.cc index 19d71530..691bc4a9 100644 --- a/binutils-2.25/gold/testsuite/script_test_9.cc +++ b/binutils-2.25/gold/testsuite/script_test_9.cc @@ -1,6 +1,6 @@ // script_test_9.cc -- a test case for gold -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Rafael Avila de Espindola . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/script_test_9.sh b/binutils-2.25/gold/testsuite/script_test_9.sh index 29a8efe4..c149bf0a 100755 --- a/binutils-2.25/gold/testsuite/script_test_9.sh +++ b/binutils-2.25/gold/testsuite/script_test_9.sh @@ -3,7 +3,7 @@ # script_test_9.sh -- Check that the script_test_9.t script has placed # .init and .text in the same segment. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Rafael Avila de Espindola . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/searched_file_test.cc b/binutils-2.25/gold/testsuite/searched_file_test.cc index 31277f11..ece362fa 100644 --- a/binutils-2.25/gold/testsuite/searched_file_test.cc +++ b/binutils-2.25/gold/testsuite/searched_file_test.cc @@ -1,6 +1,6 @@ // searched_file_test.cc -- test -l:foo.a for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Chris Demetriou . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/searched_file_test_lib.cc b/binutils-2.25/gold/testsuite/searched_file_test_lib.cc index 340afc42..038130b4 100644 --- a/binutils-2.25/gold/testsuite/searched_file_test_lib.cc +++ b/binutils-2.25/gold/testsuite/searched_file_test_lib.cc @@ -1,6 +1,6 @@ // searched_file_test_lib.cc -- test -l:foo.a for gold -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Chris Demetriou . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/section_sorting_name.cc b/binutils-2.25/gold/testsuite/section_sorting_name.cc index cb7260c8..b198fe42 100644 --- a/binutils-2.25/gold/testsuite/section_sorting_name.cc +++ b/binutils-2.25/gold/testsuite/section_sorting_name.cc @@ -1,6 +1,6 @@ // section_sorting_name.cc -- a test case for gold -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013-2015 Free Software Foundation, Inc. // Written by Alexander Ivchenko . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/section_sorting_name.sh b/binutils-2.25/gold/testsuite/section_sorting_name.sh index b4132995..19f908b1 100755 --- a/binutils-2.25/gold/testsuite/section_sorting_name.sh +++ b/binutils-2.25/gold/testsuite/section_sorting_name.sh @@ -2,7 +2,7 @@ # section_sorting_name.sh -- test -# Copyright (C) 2013-2014 Free Software Foundation, Inc. +# Copyright (C) 2013-2015 Free Software Foundation, Inc. # Written by Alexander Ivchenko . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/split_i386.sh b/binutils-2.25/gold/testsuite/split_i386.sh index f48ea5dd..0499cc9a 100755 --- a/binutils-2.25/gold/testsuite/split_i386.sh +++ b/binutils-2.25/gold/testsuite/split_i386.sh @@ -2,7 +2,7 @@ # split_i386.sh -- test -fstack-split for i386 -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/split_x32.sh b/binutils-2.25/gold/testsuite/split_x32.sh new file mode 100755 index 00000000..0bc0cf36 --- /dev/null +++ b/binutils-2.25/gold/testsuite/split_x32.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +# split_x32.sh -- test -fstack-split for x32 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# Written by Ian Lance Taylor . +# Modified by H.J. Lu . + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +match() +{ + if ! egrep "$1" "$2" >/dev/null 2>&1; then + echo 1>&2 "could not find '$1' in $2" + exit 1 + fi +} + +nomatch() +{ + if egrep "$1" "$2" >/dev/null 2>&1; then + echo 1>&2 "found unexpected '$1' in $2" + exit 1 + fi +} + +match 'cmp.*+%fs:[^,]*,%esp' split_x32_1.stdout +match 'callq.*__morestack>?$' split_x32_1.stdout +match 'lea.*-0x200\(%rsp\),' split_x32_1.stdout + +match 'stc' split_x32_2.stdout +match 'callq.*__morestack_non_split>?$' split_x32_2.stdout +nomatch 'callq.*__morestack>?$' split_x32_2.stdout +match 'lea.*-0x4200\(%rsp\),' split_x32_2.stdout + +match 'failed to match' split_x32_3.stdout + +match 'callq.*__morestack>?$' split_x32_4.stdout + +match 'cannot mix' split_x32_r.stdout diff --git a/binutils-2.25/gold/testsuite/split_x32_1.s b/binutils-2.25/gold/testsuite/split_x32_1.s new file mode 100644 index 00000000..b78936eb --- /dev/null +++ b/binutils-2.25/gold/testsuite/split_x32_1.s @@ -0,0 +1,33 @@ +# split_x32_1.s: x32 specific test case for -fsplit-stack. + + .text + + .global fn1 + .type fn1,@function +fn1: + cmp %fs:0x40,%esp + jae 1f + callq __morestack + retq +1: + callq fn2 + retq + + .size fn1,. - fn1 + + .global fn2 + .type fn2,@function +fn2: + lea -0x200(%rsp),%r10d + cmp %fs:0x40,%r10d + jae 1f + callq __morestack + retq +1: + callq fn1 + retq + + .size fn2,. - fn2 + + .section .note.GNU-stack,"",@progbits + .section .note.GNU-split-stack,"",@progbits diff --git a/binutils-2.25/gold/testsuite/split_x32_2.s b/binutils-2.25/gold/testsuite/split_x32_2.s new file mode 100644 index 00000000..b789afd8 --- /dev/null +++ b/binutils-2.25/gold/testsuite/split_x32_2.s @@ -0,0 +1,33 @@ +# split_x32_2.s: x32 specific, -fsplit-stack calling non-split + + .text + + .global fn1 + .type fn1,@function +fn1: + cmp %fs:0x40,%esp + jae 1f + callq __morestack + retq +1: + callq fn3 + retq + + .size fn1,. - fn1 + + .global fn2 + .type fn2,@function +fn2: + lea -0x200(%rsp),%r10d + cmp %fs:0x40,%r10d + jae 1f + callq __morestack + retq +1: + callq fn3 + retq + + .size fn2,. - fn2 + + .section .note.GNU-stack,"",@progbits + .section .note.GNU-split-stack,"",@progbits diff --git a/binutils-2.25/gold/testsuite/split_x32_3.s b/binutils-2.25/gold/testsuite/split_x32_3.s new file mode 100644 index 00000000..d7b09bdc --- /dev/null +++ b/binutils-2.25/gold/testsuite/split_x32_3.s @@ -0,0 +1,22 @@ +# split_x32_3.s: x32 specific, adjustment failure + + .text + + .global fn1 + .type fn1,@function +fn1: + push %rbp + mov %esp,%ebp + cmp %fs:0x40,%esp + jae 1f + callq __morestack + retq +1: + callq fn3 + leaveq + retq + + .size fn1,. - fn1 + + .section .note.GNU-stack,"",@progbits + .section .note.GNU-split-stack,"",@progbits diff --git a/binutils-2.25/gold/testsuite/split_x32_4.s b/binutils-2.25/gold/testsuite/split_x32_4.s new file mode 100644 index 00000000..1f4eece4 --- /dev/null +++ b/binutils-2.25/gold/testsuite/split_x32_4.s @@ -0,0 +1,23 @@ +# split_x32_4.s: x32 specific, permitted adjustment failure + + .text + + .global fn1 + .type fn1,@function +fn1: + push %rbp + mov %esp,%ebp + cmp %fs:0x40,%esp + jae 1f + callq __morestack + retq +1: + callq fn3 + leaveq + retq + + .size fn1,. - fn1 + + .section .note.GNU-stack,"",@progbits + .section .note.GNU-split-stack,"",@progbits + .section .note.GNU-no-split-stack,"",@progbits diff --git a/binutils-2.25/gold/testsuite/split_x32_n.s b/binutils-2.25/gold/testsuite/split_x32_n.s new file mode 100644 index 00000000..54c0db69 --- /dev/null +++ b/binutils-2.25/gold/testsuite/split_x32_n.s @@ -0,0 +1,12 @@ +# split_x32_n.s: x32 specific, -fsplit-stack calling non-split + + .text + + .global fn3 + .type fn3,@function +fn3: + retq + + .size fn3,. - fn3 + + .section .note.GNU-stack,"",@progbits diff --git a/binutils-2.25/gold/testsuite/split_x86_64.sh b/binutils-2.25/gold/testsuite/split_x86_64.sh index 530c4b1b..fdba1f80 100755 --- a/binutils-2.25/gold/testsuite/split_x86_64.sh +++ b/binutils-2.25/gold/testsuite/split_x86_64.sh @@ -2,7 +2,7 @@ # split_x86_64.sh -- test -fstack-split for x86_64 -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/start_lib_test_1.c b/binutils-2.25/gold/testsuite/start_lib_test_1.c index 3cd8a51b..bc7c508c 100644 --- a/binutils-2.25/gold/testsuite/start_lib_test_1.c +++ b/binutils-2.25/gold/testsuite/start_lib_test_1.c @@ -1,6 +1,6 @@ /* start_lib_test_1.c -- test --start-lib/--end-lib. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/start_lib_test_2.c b/binutils-2.25/gold/testsuite/start_lib_test_2.c index b6a99a14..b08eaa62 100644 --- a/binutils-2.25/gold/testsuite/start_lib_test_2.c +++ b/binutils-2.25/gold/testsuite/start_lib_test_2.c @@ -1,6 +1,6 @@ /* start_lib_test_2.c -- test --start-lib/--end-lib. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/start_lib_test_3.c b/binutils-2.25/gold/testsuite/start_lib_test_3.c index 64a1ebf5..04a72aeb 100644 --- a/binutils-2.25/gold/testsuite/start_lib_test_3.c +++ b/binutils-2.25/gold/testsuite/start_lib_test_3.c @@ -1,6 +1,6 @@ /* start_lib_test_3.c -- test --start-lib/--end-lib. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/start_lib_test_main.c b/binutils-2.25/gold/testsuite/start_lib_test_main.c index 6531ba91..256ff25d 100644 --- a/binutils-2.25/gold/testsuite/start_lib_test_main.c +++ b/binutils-2.25/gold/testsuite/start_lib_test_main.c @@ -1,6 +1,6 @@ /* start_lib_test_main.c -- test --start-lib/--end-lib. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Cary Coutant This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/strong_ref_weak_def.sh b/binutils-2.25/gold/testsuite/strong_ref_weak_def.sh index d5b766fd..f22410e5 100755 --- a/binutils-2.25/gold/testsuite/strong_ref_weak_def.sh +++ b/binutils-2.25/gold/testsuite/strong_ref_weak_def.sh @@ -3,7 +3,7 @@ # strong_ref_weak_def.sh -- test non-weak reference to a weak symbol defined # in a DSO. -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # Written by Doug Kwan . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/strong_ref_weak_def_1.c b/binutils-2.25/gold/testsuite/strong_ref_weak_def_1.c index 61493f25..d04b1cca 100644 --- a/binutils-2.25/gold/testsuite/strong_ref_weak_def_1.c +++ b/binutils-2.25/gold/testsuite/strong_ref_weak_def_1.c @@ -1,7 +1,7 @@ // strong_ref_weak_def_1.c -- test a strong reference to a weak definition // in a DSO. -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/strong_ref_weak_def_2.c b/binutils-2.25/gold/testsuite/strong_ref_weak_def_2.c index c7c9edec..f6c8067c 100644 --- a/binutils-2.25/gold/testsuite/strong_ref_weak_def_2.c +++ b/binutils-2.25/gold/testsuite/strong_ref_weak_def_2.c @@ -1,7 +1,7 @@ // strong_ref_weak_def_2.c -- test a strong reference to a weak definition // in a DSO. -// Copyright (C) 2010-2014 Free Software Foundation, Inc. +// Copyright (C) 2010-2015 Free Software Foundation, Inc. // Written by Doug Kwan . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/test.cc b/binutils-2.25/gold/testsuite/test.cc index 80f2ab55..ced8f3d3 100644 --- a/binutils-2.25/gold/testsuite/test.cc +++ b/binutils-2.25/gold/testsuite/test.cc @@ -1,6 +1,6 @@ // test.cc -- simplistic test framework for gold. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/test.h b/binutils-2.25/gold/testsuite/test.h index 1522bcf1..9952acdc 100644 --- a/binutils-2.25/gold/testsuite/test.h +++ b/binutils-2.25/gold/testsuite/test.h @@ -1,6 +1,6 @@ // test.h -- simplistic test framework for gold unittests -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/testfile.cc b/binutils-2.25/gold/testsuite/testfile.cc index 3defb4d3..c67caff4 100644 --- a/binutils-2.25/gold/testsuite/testfile.cc +++ b/binutils-2.25/gold/testsuite/testfile.cc @@ -1,6 +1,6 @@ // testfile.cc -- Dummy ELF objects for testing purposes. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/testfile.h b/binutils-2.25/gold/testsuite/testfile.h index dac02ff2..582cd67f 100644 --- a/binutils-2.25/gold/testsuite/testfile.h +++ b/binutils-2.25/gold/testsuite/testfile.h @@ -1,6 +1,6 @@ // testfile.h -- test input files -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/testmain.cc b/binutils-2.25/gold/testsuite/testmain.cc index a3a105c0..b11eefbf 100644 --- a/binutils-2.25/gold/testsuite/testmain.cc +++ b/binutils-2.25/gold/testsuite/testmain.cc @@ -1,6 +1,6 @@ // testmain.cc -- main function for simplisitic gold test framework. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/text_section_grouping.cc b/binutils-2.25/gold/testsuite/text_section_grouping.cc index dc29a1f0..3a6fcba2 100644 --- a/binutils-2.25/gold/testsuite/text_section_grouping.cc +++ b/binutils-2.25/gold/testsuite/text_section_grouping.cc @@ -1,6 +1,6 @@ // text_section_grouping.cc -- a test case for gold -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/text_section_grouping.sh b/binutils-2.25/gold/testsuite/text_section_grouping.sh index a819e57a..6bbbd314 100755 --- a/binutils-2.25/gold/testsuite/text_section_grouping.sh +++ b/binutils-2.25/gold/testsuite/text_section_grouping.sh @@ -2,7 +2,7 @@ # text_section_grouping.sh -- test -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # Written by Sriraman Tallam . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/thin_archive_main.cc b/binutils-2.25/gold/testsuite/thin_archive_main.cc index 6f19c0a9..31e9db26 100644 --- a/binutils-2.25/gold/testsuite/thin_archive_main.cc +++ b/binutils-2.25/gold/testsuite/thin_archive_main.cc @@ -1,6 +1,6 @@ // thin_archive_main.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/thin_archive_test_1.cc b/binutils-2.25/gold/testsuite/thin_archive_test_1.cc index f44b3dd0..be60fd53 100644 --- a/binutils-2.25/gold/testsuite/thin_archive_test_1.cc +++ b/binutils-2.25/gold/testsuite/thin_archive_test_1.cc @@ -1,6 +1,6 @@ // thin_archive_test_1.cc -- part of a test case for thin archives -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/thin_archive_test_2.cc b/binutils-2.25/gold/testsuite/thin_archive_test_2.cc index 15c9a7a1..518e3162 100644 --- a/binutils-2.25/gold/testsuite/thin_archive_test_2.cc +++ b/binutils-2.25/gold/testsuite/thin_archive_test_2.cc @@ -1,6 +1,6 @@ // thin_archive_test_2.cc -- part of a test case for thin archives -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/thin_archive_test_3.cc b/binutils-2.25/gold/testsuite/thin_archive_test_3.cc index 96cd79d4..fda886d0 100644 --- a/binutils-2.25/gold/testsuite/thin_archive_test_3.cc +++ b/binutils-2.25/gold/testsuite/thin_archive_test_3.cc @@ -1,6 +1,6 @@ // thin_archive_test_3.cc -- part of a test case for thin archives -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/thin_archive_test_4.cc b/binutils-2.25/gold/testsuite/thin_archive_test_4.cc index 903de113..77db724e 100644 --- a/binutils-2.25/gold/testsuite/thin_archive_test_4.cc +++ b/binutils-2.25/gold/testsuite/thin_archive_test_4.cc @@ -1,6 +1,6 @@ // thin_archive_test_4.cc -- part of a test case for thin archives -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/thumb2_branch_range.t b/binutils-2.25/gold/testsuite/thumb2_branch_range.t index 2002fb9e..2cc5dff1 100644 --- a/binutils-2.25/gold/testsuite/thumb2_branch_range.t +++ b/binutils-2.25/gold/testsuite/thumb2_branch_range.t @@ -1,6 +1,6 @@ /* thumb2_banch_range.t -- linker script to test THUMB-2 branch range. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Doug Kwan . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/thumb_branch_range.t b/binutils-2.25/gold/testsuite/thumb_branch_range.t index 2b0e54e4..4feed83f 100644 --- a/binutils-2.25/gold/testsuite/thumb_branch_range.t +++ b/binutils-2.25/gold/testsuite/thumb_branch_range.t @@ -1,6 +1,6 @@ /* thumb_banch_range.t -- linker script to test ARM branch range. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Written by Doug Kwan . This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/tls_test.cc b/binutils-2.25/gold/testsuite/tls_test.cc index 7d386582..8864320a 100644 --- a/binutils-2.25/gold/testsuite/tls_test.cc +++ b/binutils-2.25/gold/testsuite/tls_test.cc @@ -1,6 +1,6 @@ // tls_test.cc -- test TLS variables for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/tls_test.h b/binutils-2.25/gold/testsuite/tls_test.h index b70c0eee..be569155 100644 --- a/binutils-2.25/gold/testsuite/tls_test.h +++ b/binutils-2.25/gold/testsuite/tls_test.h @@ -1,6 +1,6 @@ // tls_test.h -- test TLS variables for gold, header file -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/tls_test_c.c b/binutils-2.25/gold/testsuite/tls_test_c.c index 918a5b27..0e680705 100644 --- a/binutils-2.25/gold/testsuite/tls_test_c.c +++ b/binutils-2.25/gold/testsuite/tls_test_c.c @@ -1,6 +1,6 @@ /* tls_test_c.c -- test TLS common symbol - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/tls_test_file2.cc b/binutils-2.25/gold/testsuite/tls_test_file2.cc index 86cee67f..01156cb8 100644 --- a/binutils-2.25/gold/testsuite/tls_test_file2.cc +++ b/binutils-2.25/gold/testsuite/tls_test_file2.cc @@ -1,6 +1,6 @@ // tls_test.cc -- test TLS variables for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/tls_test_main.cc b/binutils-2.25/gold/testsuite/tls_test_main.cc index 42db36f2..dc358400 100644 --- a/binutils-2.25/gold/testsuite/tls_test_main.cc +++ b/binutils-2.25/gold/testsuite/tls_test_main.cc @@ -1,6 +1,6 @@ // tls_test.cc -- test TLS variables for gold, main function -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_shared.sh b/binutils-2.25/gold/testsuite/two_file_shared.sh index 84465f85..32b8706a 100755 --- a/binutils-2.25/gold/testsuite/two_file_shared.sh +++ b/binutils-2.25/gold/testsuite/two_file_shared.sh @@ -2,7 +2,7 @@ # two_file_shared.sh -- check that debug info gets symbol addresses -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test.h b/binutils-2.25/gold/testsuite/two_file_test.h index 617b8d2a..49255523 100644 --- a/binutils-2.25/gold/testsuite/two_file_test.h +++ b/binutils-2.25/gold/testsuite/two_file_test.h @@ -1,6 +1,6 @@ // two_file_test.h -- a two file test case for gold, header file -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_1.cc b/binutils-2.25/gold/testsuite/two_file_test_1.cc index fdcb7d54..b0c7e488 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_1.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_1.cc @@ -1,6 +1,6 @@ // two_file_test_1.cc -- a two file test case for gold, file 1 of 2 -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_1_v1.cc b/binutils-2.25/gold/testsuite/two_file_test_1_v1.cc index 2518479a..a7ea4c82 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_1_v1.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_1_v1.cc @@ -1,6 +1,6 @@ // two_file_test_1_v1.cc -- a two file test case for gold, file 1 of 2 -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_1b.cc b/binutils-2.25/gold/testsuite/two_file_test_1b.cc index 4083f0b9..d72b5e26 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_1b.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_1b.cc @@ -1,7 +1,7 @@ // two_file_test_1b.cc -- supplementary file for a three-file test case // for gold. -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_1b_v1.cc b/binutils-2.25/gold/testsuite/two_file_test_1b_v1.cc index 3306e9cc..b6f2413b 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_1b_v1.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_1b_v1.cc @@ -1,7 +1,7 @@ // two_file_test_1b_v1.cc -- supplementary file for a three-file test case // for gold. -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_2.cc b/binutils-2.25/gold/testsuite/two_file_test_2.cc index e3818f98..ab56b217 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_2.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_2.cc @@ -1,6 +1,6 @@ // two_file_test_2.cc -- a two file test case for gold, file 2 of 2 -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_2_tls.cc b/binutils-2.25/gold/testsuite/two_file_test_2_tls.cc index 3f6dc0b3..4b49f01a 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_2_tls.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_2_tls.cc @@ -1,6 +1,6 @@ // two_file_test_2_tls.cc -- a two file test case for gold, with a TLS symbol -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_2_v1.cc b/binutils-2.25/gold/testsuite/two_file_test_2_v1.cc index 664380bf..c5467924 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_2_v1.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_2_v1.cc @@ -1,6 +1,6 @@ // two_file_test_2_v1.cc -- a two file test case for gold, file 2 of 2 -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_main.cc b/binutils-2.25/gold/testsuite/two_file_test_main.cc index 6c1c52c2..21c6f5e0 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_main.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_main.cc @@ -1,6 +1,6 @@ // two_file_test_main.cc -- a two file test case for gold, main function -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/two_file_test_tls.cc b/binutils-2.25/gold/testsuite/two_file_test_tls.cc index 5f450a40..56e8bd10 100644 --- a/binutils-2.25/gold/testsuite/two_file_test_tls.cc +++ b/binutils-2.25/gold/testsuite/two_file_test_tls.cc @@ -1,6 +1,6 @@ // two_file_test_tls.cc -- a two file test case for gold, main function, with TLS -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/undef_symbol.cc b/binutils-2.25/gold/testsuite/undef_symbol.cc index 306f29a8..24908a38 100644 --- a/binutils-2.25/gold/testsuite/undef_symbol.cc +++ b/binutils-2.25/gold/testsuite/undef_symbol.cc @@ -1,6 +1,6 @@ // undef_symbol.cc -- a test case for undefined references -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/undef_symbol.sh b/binutils-2.25/gold/testsuite/undef_symbol.sh index 4f6308f4..661b8036 100755 --- a/binutils-2.25/gold/testsuite/undef_symbol.sh +++ b/binutils-2.25/gold/testsuite/undef_symbol.sh @@ -2,7 +2,7 @@ # undef_symbol.sh -- a test case for undefined symbols in shared libraries -# Copyright (C) 2007-2014 Free Software Foundation, Inc. +# Copyright (C) 2007-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/undef_symbol_main.cc b/binutils-2.25/gold/testsuite/undef_symbol_main.cc index 537eed82..bed71c1f 100644 --- a/binutils-2.25/gold/testsuite/undef_symbol_main.cc +++ b/binutils-2.25/gold/testsuite/undef_symbol_main.cc @@ -1,6 +1,6 @@ // undef_symbol_1.cc -- a test case for undefined references -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_matching_def.cc b/binutils-2.25/gold/testsuite/ver_matching_def.cc index ee2edc34..1024af9a 100644 --- a/binutils-2.25/gold/testsuite/ver_matching_def.cc +++ b/binutils-2.25/gold/testsuite/ver_matching_def.cc @@ -1,6 +1,6 @@ // ver_matching_def.cc - test matching rules in version_script.map -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_matching_test.sh b/binutils-2.25/gold/testsuite/ver_matching_test.sh index 9c7722ec..9cde23b9 100755 --- a/binutils-2.25/gold/testsuite/ver_matching_test.sh +++ b/binutils-2.25/gold/testsuite/ver_matching_test.sh @@ -2,7 +2,7 @@ # ver_matching_test.sh -- a test case for version script matching -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test.h b/binutils-2.25/gold/testsuite/ver_test.h index 62a4b374..947b5baa 100644 --- a/binutils-2.25/gold/testsuite/ver_test.h +++ b/binutils-2.25/gold/testsuite/ver_test.h @@ -1,6 +1,6 @@ // ver_test.h -- a test case for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_1.cc b/binutils-2.25/gold/testsuite/ver_test_1.cc index 63362340..8162461c 100644 --- a/binutils-2.25/gold/testsuite/ver_test_1.cc +++ b/binutils-2.25/gold/testsuite/ver_test_1.cc @@ -1,6 +1,6 @@ // ver_test_1.cc -- a test case for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_1.sh b/binutils-2.25/gold/testsuite/ver_test_1.sh index 63d5d499..35dd5762 100755 --- a/binutils-2.25/gold/testsuite/ver_test_1.sh +++ b/binutils-2.25/gold/testsuite/ver_test_1.sh @@ -2,7 +2,7 @@ # ver_test_1.sh -- check that protected symbols are local -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_10.script b/binutils-2.25/gold/testsuite/ver_test_10.script index 720220cf..e21c1e77 100644 --- a/binutils-2.25/gold/testsuite/ver_test_10.script +++ b/binutils-2.25/gold/testsuite/ver_test_10.script @@ -1,6 +1,6 @@ ## ver_test_10.script -- a test case for gold -## Copyright (C) 2008-2014 Free Software Foundation, Inc. +## Copyright (C) 2008-2015 Free Software Foundation, Inc. ## Written by Ian Lance Taylor . ## This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_10.sh b/binutils-2.25/gold/testsuite/ver_test_10.sh index 11044f3c..3127ef32 100755 --- a/binutils-2.25/gold/testsuite/ver_test_10.sh +++ b/binutils-2.25/gold/testsuite/ver_test_10.sh @@ -2,7 +2,7 @@ # ver_test_10.sh -- test global/local symbols -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_2.cc b/binutils-2.25/gold/testsuite/ver_test_2.cc index bf230d33..ca635558 100644 --- a/binutils-2.25/gold/testsuite/ver_test_2.cc +++ b/binutils-2.25/gold/testsuite/ver_test_2.cc @@ -1,6 +1,6 @@ // ver_test_2.cc -- a test case for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_2.script b/binutils-2.25/gold/testsuite/ver_test_2.script index bd62fc1f..ed4e8abf 100644 --- a/binutils-2.25/gold/testsuite/ver_test_2.script +++ b/binutils-2.25/gold/testsuite/ver_test_2.script @@ -1,6 +1,6 @@ ## ver_test_2.script -- a test case for gold -## Copyright (C) 2007-2014 Free Software Foundation, Inc. +## Copyright (C) 2007-2015 Free Software Foundation, Inc. ## Written by Cary Coutant . ## This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_2.sh b/binutils-2.25/gold/testsuite/ver_test_2.sh index bd973bce..978c8c79 100755 --- a/binutils-2.25/gold/testsuite/ver_test_2.sh +++ b/binutils-2.25/gold/testsuite/ver_test_2.sh @@ -2,7 +2,7 @@ # ver_test_2.sh -- test that symbol has correct version -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_3.cc b/binutils-2.25/gold/testsuite/ver_test_3.cc index ec057926..d4c40895 100644 --- a/binutils-2.25/gold/testsuite/ver_test_3.cc +++ b/binutils-2.25/gold/testsuite/ver_test_3.cc @@ -1,6 +1,6 @@ // ver_test_3.cc -- a test case for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_4.cc b/binutils-2.25/gold/testsuite/ver_test_4.cc index ef06e2cf..7a5544e7 100644 --- a/binutils-2.25/gold/testsuite/ver_test_4.cc +++ b/binutils-2.25/gold/testsuite/ver_test_4.cc @@ -1,6 +1,6 @@ // ver_test_4.cc -- a test case for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_4.script b/binutils-2.25/gold/testsuite/ver_test_4.script index 071e3f61..23c1a76f 100644 --- a/binutils-2.25/gold/testsuite/ver_test_4.script +++ b/binutils-2.25/gold/testsuite/ver_test_4.script @@ -1,6 +1,6 @@ ## ver_test_4.script -- a test case for gold -## Copyright (C) 2007-2014 Free Software Foundation, Inc. +## Copyright (C) 2007-2015 Free Software Foundation, Inc. ## Written by Cary Coutant . ## This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_4.sh b/binutils-2.25/gold/testsuite/ver_test_4.sh index f125f2b5..05305b1f 100755 --- a/binutils-2.25/gold/testsuite/ver_test_4.sh +++ b/binutils-2.25/gold/testsuite/ver_test_4.sh @@ -2,7 +2,7 @@ # ver_test_4.sh -- test that version symbol is visible. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_5.cc b/binutils-2.25/gold/testsuite/ver_test_5.cc index d861d487..96d69fb2 100644 --- a/binutils-2.25/gold/testsuite/ver_test_5.cc +++ b/binutils-2.25/gold/testsuite/ver_test_5.cc @@ -1,6 +1,6 @@ // ver_test_5.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_5.script b/binutils-2.25/gold/testsuite/ver_test_5.script index 950adc84..f773b571 100644 --- a/binutils-2.25/gold/testsuite/ver_test_5.script +++ b/binutils-2.25/gold/testsuite/ver_test_5.script @@ -1,6 +1,6 @@ ## ver_test_5.script -- a test case for gold -## Copyright (C) 2008-2014 Free Software Foundation, Inc. +## Copyright (C) 2008-2015 Free Software Foundation, Inc. ## Written by Ian Lance Taylor ## This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_5.sh b/binutils-2.25/gold/testsuite/ver_test_5.sh index 0c9b0244..e69b0654 100755 --- a/binutils-2.25/gold/testsuite/ver_test_5.sh +++ b/binutils-2.25/gold/testsuite/ver_test_5.sh @@ -2,7 +2,7 @@ # ver_test_5.sh -- test that symbol has correct version -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_6.c b/binutils-2.25/gold/testsuite/ver_test_6.c index fb96c771..2270650f 100644 --- a/binutils-2.25/gold/testsuite/ver_test_6.c +++ b/binutils-2.25/gold/testsuite/ver_test_6.c @@ -1,6 +1,6 @@ /* ver_test_6.c -- test common symbol with shared library version - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_7.cc b/binutils-2.25/gold/testsuite/ver_test_7.cc index 2badceab..1dd489c2 100644 --- a/binutils-2.25/gold/testsuite/ver_test_7.cc +++ b/binutils-2.25/gold/testsuite/ver_test_7.cc @@ -1,6 +1,6 @@ // ver_test_7.cc -- test weak duplicate symbol with version -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_7.sh b/binutils-2.25/gold/testsuite/ver_test_7.sh index f0fe8f65..b336d832 100755 --- a/binutils-2.25/gold/testsuite/ver_test_7.sh +++ b/binutils-2.25/gold/testsuite/ver_test_7.sh @@ -2,7 +2,7 @@ # ver_test_7.sh -- test that symbol has correct version -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_8.script b/binutils-2.25/gold/testsuite/ver_test_8.script index 9e48e38f..92b96b6b 100644 --- a/binutils-2.25/gold/testsuite/ver_test_8.script +++ b/binutils-2.25/gold/testsuite/ver_test_8.script @@ -1,6 +1,6 @@ ## ver_test_8.script -- a test case for gold -## Copyright (C) 2008-2014 Free Software Foundation, Inc. +## Copyright (C) 2008-2015 Free Software Foundation, Inc. ## Written by Ian Lance Taylor ## This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_9.cc b/binutils-2.25/gold/testsuite/ver_test_9.cc index d0cc4e70..fac97991 100644 --- a/binutils-2.25/gold/testsuite/ver_test_9.cc +++ b/binutils-2.25/gold/testsuite/ver_test_9.cc @@ -1,6 +1,6 @@ // ver_test_9.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_main.cc b/binutils-2.25/gold/testsuite/ver_test_main.cc index c24beb45..410aa5be 100644 --- a/binutils-2.25/gold/testsuite/ver_test_main.cc +++ b/binutils-2.25/gold/testsuite/ver_test_main.cc @@ -1,6 +1,6 @@ // ver_test_main.cc -- a test case for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/ver_test_main_2.cc b/binutils-2.25/gold/testsuite/ver_test_main_2.cc index 9a031913..b2d515c1 100644 --- a/binutils-2.25/gold/testsuite/ver_test_main_2.cc +++ b/binutils-2.25/gold/testsuite/ver_test_main_2.cc @@ -1,6 +1,6 @@ // ver_test_main_2.cc -- a test case for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_alias_test_1.cc b/binutils-2.25/gold/testsuite/weak_alias_test_1.cc index 67c709dd..8665391e 100644 --- a/binutils-2.25/gold/testsuite/weak_alias_test_1.cc +++ b/binutils-2.25/gold/testsuite/weak_alias_test_1.cc @@ -1,6 +1,6 @@ // weak_alias_test_1.cc -- test weak aliases for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_alias_test_2.cc b/binutils-2.25/gold/testsuite/weak_alias_test_2.cc index 5933314c..c18b0f71 100644 --- a/binutils-2.25/gold/testsuite/weak_alias_test_2.cc +++ b/binutils-2.25/gold/testsuite/weak_alias_test_2.cc @@ -1,6 +1,6 @@ // weak_alias_test_2.cc -- test weak aliases for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_alias_test_3.cc b/binutils-2.25/gold/testsuite/weak_alias_test_3.cc index ef7b252d..82056a51 100644 --- a/binutils-2.25/gold/testsuite/weak_alias_test_3.cc +++ b/binutils-2.25/gold/testsuite/weak_alias_test_3.cc @@ -1,6 +1,6 @@ // weak_alias_test_3.cc -- test weak aliases for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_alias_test_4.cc b/binutils-2.25/gold/testsuite/weak_alias_test_4.cc index 04a00988..e4383e60 100644 --- a/binutils-2.25/gold/testsuite/weak_alias_test_4.cc +++ b/binutils-2.25/gold/testsuite/weak_alias_test_4.cc @@ -1,6 +1,6 @@ // weak_alias_test_4.cc -- test weak aliases for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_alias_test_5.cc b/binutils-2.25/gold/testsuite/weak_alias_test_5.cc index c3e746e7..8bb13c7e 100644 --- a/binutils-2.25/gold/testsuite/weak_alias_test_5.cc +++ b/binutils-2.25/gold/testsuite/weak_alias_test_5.cc @@ -1,6 +1,6 @@ // weak_alias_test_5.cc -- test versioned weak aliases for gold -// Copyright (C) 2011-2014 Free Software Foundation, Inc. +// Copyright (C) 2011-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_alias_test_main.cc b/binutils-2.25/gold/testsuite/weak_alias_test_main.cc index 1b4778dd..abc3d88c 100644 --- a/binutils-2.25/gold/testsuite/weak_alias_test_main.cc +++ b/binutils-2.25/gold/testsuite/weak_alias_test_main.cc @@ -1,6 +1,6 @@ // weak_alias_test_main.cc -- test weak aliases for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_plt.sh b/binutils-2.25/gold/testsuite/weak_plt.sh index 20980112..9d334f60 100755 --- a/binutils-2.25/gold/testsuite/weak_plt.sh +++ b/binutils-2.25/gold/testsuite/weak_plt.sh @@ -2,7 +2,7 @@ # weak_plt.sh -- test calling a weak undefined function. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # Written by Ian Lance Taylor . # This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_plt_main.cc b/binutils-2.25/gold/testsuite/weak_plt_main.cc index 39fe46f1..0c4ebfb7 100644 --- a/binutils-2.25/gold/testsuite/weak_plt_main.cc +++ b/binutils-2.25/gold/testsuite/weak_plt_main.cc @@ -1,6 +1,6 @@ // weak_plt_main.cc -- test call to weak undefined function for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_plt_shared.cc b/binutils-2.25/gold/testsuite/weak_plt_shared.cc index 0275a2e0..ca774fda 100644 --- a/binutils-2.25/gold/testsuite/weak_plt_shared.cc +++ b/binutils-2.25/gold/testsuite/weak_plt_shared.cc @@ -1,6 +1,6 @@ // weak_plt_shared.cc -- test call to weak undefined function for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_test.cc b/binutils-2.25/gold/testsuite/weak_test.cc index 67c44386..e0c2d126 100644 --- a/binutils-2.25/gold/testsuite/weak_test.cc +++ b/binutils-2.25/gold/testsuite/weak_test.cc @@ -1,6 +1,6 @@ // weak_test.cc -- test handling of weak symbols for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_undef.h b/binutils-2.25/gold/testsuite/weak_undef.h index 796dca56..c7a898a2 100644 --- a/binutils-2.25/gold/testsuite/weak_undef.h +++ b/binutils-2.25/gold/testsuite/weak_undef.h @@ -1,6 +1,6 @@ // weak_undef.h -- test handling of weak undefined symbols for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_undef_file1.cc b/binutils-2.25/gold/testsuite/weak_undef_file1.cc index 60cf5c34..b5656f5d 100644 --- a/binutils-2.25/gold/testsuite/weak_undef_file1.cc +++ b/binutils-2.25/gold/testsuite/weak_undef_file1.cc @@ -1,6 +1,6 @@ // weak_undef_file1.cc -- test handling of weak undefined symbols for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_undef_file2.cc b/binutils-2.25/gold/testsuite/weak_undef_file2.cc index 7ceff001..79e5da1f 100644 --- a/binutils-2.25/gold/testsuite/weak_undef_file2.cc +++ b/binutils-2.25/gold/testsuite/weak_undef_file2.cc @@ -1,6 +1,6 @@ // weak_undef_file2.cc -- test handling of weak undefined symbols for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_undef_file3.cc b/binutils-2.25/gold/testsuite/weak_undef_file3.cc index 15974473..87ad01f1 100644 --- a/binutils-2.25/gold/testsuite/weak_undef_file3.cc +++ b/binutils-2.25/gold/testsuite/weak_undef_file3.cc @@ -1,6 +1,6 @@ // weak_undef_file3.cc -- test handling of weak undefined symbols for gold -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_undef_file4.cc b/binutils-2.25/gold/testsuite/weak_undef_file4.cc index a82a49ff..f8730301 100644 --- a/binutils-2.25/gold/testsuite/weak_undef_file4.cc +++ b/binutils-2.25/gold/testsuite/weak_undef_file4.cc @@ -1,6 +1,6 @@ // weak_undef_file4.cc -- test handling of weak undefined symbols for gold -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_undef_test.cc b/binutils-2.25/gold/testsuite/weak_undef_test.cc index 16277a24..07f373ec 100644 --- a/binutils-2.25/gold/testsuite/weak_undef_test.cc +++ b/binutils-2.25/gold/testsuite/weak_undef_test.cc @@ -1,6 +1,6 @@ // weak_undef_test.cc -- test handling of weak undefined symbols for gold -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/testsuite/weak_undef_test_2.cc b/binutils-2.25/gold/testsuite/weak_undef_test_2.cc index 549bd3fd..bfaaec8c 100644 --- a/binutils-2.25/gold/testsuite/weak_undef_test_2.cc +++ b/binutils-2.25/gold/testsuite/weak_undef_test_2.cc @@ -1,6 +1,6 @@ // weak_undef_test_2.cc -- test handling of weak undefined symbols for gold -// Copyright (C) 2014 Free Software Foundation, Inc. +// Copyright (C) 2014-2015 Free Software Foundation, Inc. // Written by Cary Coutant . // This file is part of gold. diff --git a/binutils-2.25/gold/tilegx.cc b/binutils-2.25/gold/tilegx.cc index 1a14deaf..5d972715 100644 --- a/binutils-2.25/gold/tilegx.cc +++ b/binutils-2.25/gold/tilegx.cc @@ -1,6 +1,6 @@ // tilegx.cc -- tilegx target support for gold. -// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// Copyright (C) 2012-2015 Free Software Foundation, Inc. // Written by Jiong Wang (jiwang@tilera.com) // This file is part of gold. diff --git a/binutils-2.25/gold/timer.cc b/binutils-2.25/gold/timer.cc index 671439f4..1744ade6 100644 --- a/binutils-2.25/gold/timer.cc +++ b/binutils-2.25/gold/timer.cc @@ -1,6 +1,6 @@ // timer.cc -- helper class for time accounting -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Rafael Avila de Espindola . // This file is part of gold. diff --git a/binutils-2.25/gold/timer.h b/binutils-2.25/gold/timer.h index fca5b125..32e3ec33 100644 --- a/binutils-2.25/gold/timer.h +++ b/binutils-2.25/gold/timer.h @@ -1,6 +1,6 @@ // timer.h -- helper class for time accounting -*- C++ -*- -// Copyright (C) 2009-2014 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Rafael Avila de Espindola . // This file is part of gold. diff --git a/binutils-2.25/gold/tls.h b/binutils-2.25/gold/tls.h index 1a287ad5..351032c9 100644 --- a/binutils-2.25/gold/tls.h +++ b/binutils-2.25/gold/tls.h @@ -1,6 +1,6 @@ // tls.h -- Thread-Local Storage utility routines for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/token.h b/binutils-2.25/gold/token.h index 47091cb0..090aee1c 100644 --- a/binutils-2.25/gold/token.h +++ b/binutils-2.25/gold/token.h @@ -1,6 +1,6 @@ // token.h -- lock tokens for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/version.cc b/binutils-2.25/gold/version.cc index 23695412..486a85a1 100644 --- a/binutils-2.25/gold/version.cc +++ b/binutils-2.25/gold/version.cc @@ -1,6 +1,6 @@ // version.c -- print gold version information -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -62,7 +62,7 @@ print_version(bool print_short) if (!print_short) { // This output is intended to follow the GNU standards. - printf(_("Copyright (C) 2014 Free Software Foundation, Inc.\n")); + printf(_("Copyright (C) 2015 Free Software Foundation, Inc.\n")); printf(_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License version 3 or (at your option) a later version.\n\ diff --git a/binutils-2.25/gold/workqueue-internal.h b/binutils-2.25/gold/workqueue-internal.h index f27d075c..937651aa 100644 --- a/binutils-2.25/gold/workqueue-internal.h +++ b/binutils-2.25/gold/workqueue-internal.h @@ -1,6 +1,6 @@ // workqueue-internal.h -- internal work queue header for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/workqueue-threads.cc b/binutils-2.25/gold/workqueue-threads.cc index 41f0543a..52931c04 100644 --- a/binutils-2.25/gold/workqueue-threads.cc +++ b/binutils-2.25/gold/workqueue-threads.cc @@ -1,6 +1,6 @@ // workqueue-threads.cc -- the threaded workqueue for gold -// Copyright (C) 2007-2014 Free Software Foundation, Inc. +// Copyright (C) 2007-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/workqueue.cc b/binutils-2.25/gold/workqueue.cc index 2d5684e5..bdd3233d 100644 --- a/binutils-2.25/gold/workqueue.cc +++ b/binutils-2.25/gold/workqueue.cc @@ -1,6 +1,6 @@ // workqueue.cc -- the workqueue for gold -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/workqueue.h b/binutils-2.25/gold/workqueue.h index d62071ee..8609142d 100644 --- a/binutils-2.25/gold/workqueue.h +++ b/binutils-2.25/gold/workqueue.h @@ -1,6 +1,6 @@ // workqueue.h -- the work queue for gold -*- C++ -*- -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. diff --git a/binutils-2.25/gold/x86_64.cc b/binutils-2.25/gold/x86_64.cc index f58c8430..4543c8a8 100644 --- a/binutils-2.25/gold/x86_64.cc +++ b/binutils-2.25/gold/x86_64.cc @@ -1,6 +1,6 @@ // x86_64.cc -- x86_64 target support for gold. -// Copyright (C) 2006-2014 Free Software Foundation, Inc. +// Copyright (C) 2006-2015 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -1516,11 +1516,16 @@ Output_data_plt_x86_64_standard::do_fill_plt_entry( unsigned int plt_offset, unsigned int plt_index) { + // Check PC-relative offset overflow in PLT entry. + uint64_t plt_got_pcrel_offset = (got_address + got_offset + - (plt_address + plt_offset + 6)); + if (Bits<32>::has_overflow(plt_got_pcrel_offset)) + gold_error(_("PC-relative offset overflow in PLT entry %d"), + plt_index + 1); + memcpy(pov, plt_entry, plt_entry_size); elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, - (got_address + got_offset - - (plt_address + plt_offset - + 6))); + plt_got_pcrel_offset); elfcpp::Swap_unaligned<32, false>::writeval(pov + 7, plt_index); elfcpp::Swap<32, false>::writeval(pov + 12, @@ -2923,11 +2928,6 @@ Target_x86_64::Scan::global(Symbol_table* symtab, } } } - // For GOTPLT64, we also need a PLT entry (but only if the - // symbol is not fully resolved). - if (r_type == elfcpp::R_X86_64_GOTPLT64 - && !gsym->final_value_is_known()) - target->make_plt_entry(symtab, layout, gsym); } break; @@ -2983,7 +2983,12 @@ Target_x86_64::Scan::global(Symbol_table* symtab, case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec case elfcpp::R_X86_64_TPOFF32: // Local-exec { - const bool is_final = gsym->final_value_is_known(); + // For the Initial-Exec model, we can treat undef symbols as final + // when building an executable. + const bool is_final = (gsym->final_value_is_known() || + (r_type == elfcpp::R_X86_64_GOTTPOFF && + gsym->is_undefined() && + parameters->options().output_is_executable())); const tls::Tls_optimization optimized_type = Target_x86_64::optimize_tls_reloc(is_final, r_type); switch (r_type) @@ -3454,9 +3459,9 @@ Target_x86_64::Relocate::relocate( break; case elfcpp::R_X86_64_GOT64: - // The ABI doc says "Like GOT64, but indicates a PLT entry is needed." - // Since we always add a PLT entry, this is equivalent. case elfcpp::R_X86_64_GOTPLT64: + // R_X86_64_GOTPLT64 is obsolete and treated the the same as + // GOT64. gold_assert(have_got_offset); Relocate_functions::rela64(view, got_offset, addend); break; @@ -3779,7 +3784,17 @@ Target_x86_64::Relocate::relocate_tls( break; case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec - if (optimized_type == tls::TLSOPT_TO_LE) + if (gsym != NULL + && gsym->is_undefined() + && parameters->options().output_is_executable()) + { + Target_x86_64::Relocate::tls_ie_to_le(relinfo, relnum, + NULL, rela, + r_type, value, view, + view_size); + break; + } + else if (optimized_type == tls::TLSOPT_TO_LE) { if (tls_segment == NULL) { @@ -4100,6 +4115,8 @@ Target_x86_64::Relocate::tls_ie_to_le( // movq if (op1 == 0x4c) view[-3] = 0x49; + else if (size == 32 && op1 == 0x44) + view[-3] = 0x41; view[-2] = 0xc7; view[-1] = 0xc0 | reg; } @@ -4108,6 +4125,8 @@ Target_x86_64::Relocate::tls_ie_to_le( // Special handling for %rsp. if (op1 == 0x4c) view[-3] = 0x49; + else if (size == 32 && op1 == 0x44) + view[-3] = 0x41; view[-2] = 0x81; view[-1] = 0xc0 | reg; } @@ -4116,11 +4135,14 @@ Target_x86_64::Relocate::tls_ie_to_le( // addq if (op1 == 0x4c) view[-3] = 0x4d; + else if (size == 32 && op1 == 0x44) + view[-3] = 0x45; view[-2] = 0x8d; view[-1] = 0x80 | reg | (reg << 3); } - value -= tls_segment->memsz(); + if (tls_segment != NULL) + value -= tls_segment->memsz(); Relocate_functions::rela32(view, value, 0); } @@ -4457,6 +4479,14 @@ Target_x86_64::do_ehframe_datarel_base() const // code. We have to change the function so that it always ensures // that it has enough stack space to run some random function. +static const unsigned char cmp_insn_32[] = { 0x64, 0x3b, 0x24, 0x25 }; +static const unsigned char lea_r10_insn_32[] = { 0x44, 0x8d, 0x94, 0x24 }; +static const unsigned char lea_r11_insn_32[] = { 0x44, 0x8d, 0x9c, 0x24 }; + +static const unsigned char cmp_insn_64[] = { 0x64, 0x48, 0x3b, 0x24, 0x25 }; +static const unsigned char lea_r10_insn_64[] = { 0x4c, 0x8d, 0x94, 0x24 }; +static const unsigned char lea_r11_insn_64[] = { 0x4c, 0x8d, 0x9c, 0x24 }; + template void Target_x86_64::do_calls_non_split(Relobj* object, unsigned int shndx, @@ -4467,25 +4497,40 @@ Target_x86_64::do_calls_non_split(Relobj* object, unsigned int shndx, std::string* from, std::string* to) const { + const char* const cmp_insn = reinterpret_cast + (size == 32 ? cmp_insn_32 : cmp_insn_64); + const char* const lea_r10_insn = reinterpret_cast + (size == 32 ? lea_r10_insn_32 : lea_r10_insn_64); + const char* const lea_r11_insn = reinterpret_cast + (size == 32 ? lea_r11_insn_32 : lea_r11_insn_64); + + const size_t cmp_insn_len = + (size == 32 ? sizeof(cmp_insn_32) : sizeof(cmp_insn_64)); + const size_t lea_r10_insn_len = + (size == 32 ? sizeof(lea_r10_insn_32) : sizeof(lea_r10_insn_64)); + const size_t lea_r11_insn_len = + (size == 32 ? sizeof(lea_r11_insn_32) : sizeof(lea_r11_insn_64)); + const size_t nop_len = (size == 32 ? 7 : 8); + // The function starts with a comparison of the stack pointer and a // field in the TCB. This is followed by a jump. // cmp %fs:NN,%rsp - if (this->match_view(view, view_size, fnoffset, "\x64\x48\x3b\x24\x25", 5) - && fnsize > 9) + if (this->match_view(view, view_size, fnoffset, cmp_insn, cmp_insn_len) + && fnsize > nop_len + 1) { // We will call __morestack if the carry flag is set after this // comparison. We turn the comparison into an stc instruction // and some nops. view[fnoffset] = '\xf9'; - this->set_view_to_nop(view, view_size, fnoffset + 1, 8); + this->set_view_to_nop(view, view_size, fnoffset + 1, nop_len); } // lea NN(%rsp),%r10 // lea NN(%rsp),%r11 else if ((this->match_view(view, view_size, fnoffset, - "\x4c\x8d\x94\x24", 4) + lea_r10_insn, lea_r10_insn_len) || this->match_view(view, view_size, fnoffset, - "\x4c\x8d\x9c\x24", 4)) + lea_r11_insn, lea_r11_insn_len)) && fnsize > 8) { // This is loading an offset from the stack pointer for a diff --git a/binutils-2.25/gold/yyscript.y b/binutils-2.25/gold/yyscript.y index 37b2670a..87aab582 100644 --- a/binutils-2.25/gold/yyscript.y +++ b/binutils-2.25/gold/yyscript.y @@ -1,6 +1,6 @@ /* yyscript.y -- linker script grammar for gold. */ -/* Copyright (C) 2006-2014 Free Software Foundation, Inc. +/* Copyright (C) 2006-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. -- cgit v1.2.3