binutils-gdb/gold/testsuite
Alan Modra 91a65d2fe8 [GOLD] Relocate::relocate() params
Some linker code editing needs to change multiple insns.  In some
cases multiple relocations are involved and it is not sufficient to
make the changes independently as relocations are processed, because
doing so might lead to a partial edit.  So in order to safely edit we
need all the relocations available in relocate().  Also, to emit
edited relocs corresponding to the edited code sequence we need some
way to pass information from relocate() to relocate_relocs(),
particularly if the edit depends on insns.  We can't modify input
relocs in relocate() as they are mmapped PROT_READ, nor it is
particularly clean to write relocs to the output at that stage.  So
add a Relocatable_relocs* field to relinfo to mark edited relocs.

Given that relocate is passed the raw reloc pointer, it makes sense to
remove the rel/rela parameter and r_type too.  However, that means the
mips relocate() needs to know whether SHT_REL or SHT_RELA relocs are
being processed.  So add a rel_type for mips, which also has the
benefit of removing relocate() overloading there.

This patch adds the infrastructure without making use of it.

Note that relinfo->rr will be NULL if not outputting relocations.

	* object.h (struct Relocate_info): Add "rr".
	* reloc.h (Relocatable_relocs::set_strategy): New accessor.
	* reloc.cc (Sized_relobj_file::do_relocate_sections): Init
	relinfo.rr for relocate_section and relocate_relocs.
	* powerpc.cc (relocate): Add rel_type and preloc parameters.
	Delete rela and r_type params, instead recalculate these from
	preloc.
	(relocate_relocs): Delete Relocatable_relocs* param, instead
	use relinfo->rr.
	* aarch64.cc: Likewise.
	* arm.cc: Likewise.
	* i386.cc: Likewise.
	* mips.cc: Likewise.
	* s390.cc: Likewise.
	* sparc.cc: Likewise.
	* target.h: Likewise.
	* tilegx.cc: Likewise.
	* x86_64.cc: Likewise.
	* testsuite/testfile.cc: Likewise.
	* target-reloc.h (relocate_section): Adjust to suit.
	(apply_relocation, relocate_relocs): Likewise.
2015-12-09 10:36:43 +10:30
..
arm_abs_global.s
arm_abs_global.sh
arm_abs_lib.s
arm_attr_merge_6a.s
arm_attr_merge_6b.s
arm_attr_merge_7a.s
arm_attr_merge_7b.s
arm_attr_merge.sh ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
arm_bl_in_range.s
arm_bl_out_of_range.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
arm_branch_in_range.sh
arm_branch_out_of_range.sh
arm_branch_range.t
arm_cortex_a8_b_cond.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
arm_cortex_a8_b_local.s
arm_cortex_a8_b.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
arm_cortex_a8_bl.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
arm_cortex_a8_blx.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
arm_cortex_a8_local_reloc.s
arm_cortex_a8_local.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
arm_cortex_a8.sh
arm_exidx_test.s
arm_exidx_test.sh
arm_farcall_arm_arm.s
arm_farcall_arm_arm.sh
arm_farcall_arm_thumb.s
arm_farcall_arm_thumb.sh
arm_farcall_thumb_arm.s
arm_farcall_thumb_arm.sh
arm_farcall_thumb_thumb.s
arm_farcall_thumb_thumb.sh
arm_fix_1176.s
arm_fix_1176.sh
arm_fix_v4bx.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
arm_fix_v4bx.sh
arm_thm_jump8.s
arm_thm_jump8.t
arm_thm_jump11.s
arm_thm_jump11.t
arm_unaligned_reloc.s Make arm_unaligned_reloc test less sensitive to disassembler output format. 2015-07-26 00:54:26 -07:00
arm_unaligned_reloc.sh Make arm_unaligned_reloc test less sensitive to disassembler output format. 2015-07-26 00:54:26 -07:00
basic_test.cc
binary_test.cc Add __attribute__((__aligned__(1))) to unaligned symbols from scripts (for s390). 2015-10-28 16:49:13 -07:00
binary_unittest.cc
binary.in
common_test_1_v1.c
common_test_1_v2.c
common_test_1.c
common_test_2.c
common_test_3.c
constructor_test.cc
copy_test_1.cc
copy_test_2.cc
copy_test_v1.cc
copy_test.cc
debug_msg.cc
debug_msg.sh Make debug_msg.sh more open-minded about line numbers (needed for s390). 2015-10-28 16:48:46 -07:00
defsym_test.c
defsym_test.sh ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
discard_locals_relocatable_test.c
discard_locals_test.c
discard_locals_test.sh
dwp_test_1.cc
dwp_test_1.s
dwp_test_1.sh
dwp_test_1b.cc
dwp_test_1b.s
dwp_test_2.cc
dwp_test_2.s
dwp_test_2.sh
dwp_test_main.cc
dwp_test_main.s
dwp_test.h
dyn_weak_ref_1.c
dyn_weak_ref_2.c
dyn_weak_ref.sh
dynamic_list_2.cc
dynamic_list_2.t
dynamic_list_lib1.cc
dynamic_list_lib2.cc
dynamic_list.sh
dynamic_list.t
eh_test_a.cc If a range is missing, assume the input address is mapped. 2015-04-27 14:35:17 -04:00
eh_test_b.cc If a range is missing, assume the input address is mapped. 2015-04-27 14:35:17 -04:00
ehdr_start_def.cc
ehdr_start_test_4.sh
ehdr_start_test.cc
ehdr_start_test.t
exception_test_1.cc
exception_test_2.cc
exception_test_main.cc
exception_test.h
exclude_libs_test_1.c
exclude_libs_test_2.c
exclude_libs_test_3.c
exclude_libs_test.c
exclude_libs_test.sh
final_layout.cc
final_layout.sh
gc_comdat_test_1.cc
gc_comdat_test_2.cc
gc_comdat_test.sh ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
gc_dynamic_list_test.c
gc_dynamic_list_test.sh
gc_dynamic_list_test.t
gc_orphan_section_test.cc
gc_orphan_section_test.sh
gc_tls_test.cc
gc_tls_test.sh
gdb_index_test_1.sh
gdb_index_test_2_gabi.sh Add SHF_COMPRESSED section decompression to gold 2015-07-12 10:50:40 -07:00
gdb_index_test_2.sh
gdb_index_test_3.c
gdb_index_test_3.sh
gdb_index_test_4.sh
gdb_index_test_comm.sh
gdb_index_test.cc
hidden_test_1.c
hidden_test_main.c
hidden_test.sh Remove warning about references from shared objects to hidden symbols. 2015-07-20 09:19:02 -07:00
i386_mov_to_lea1.s Convert mov foo@GOT(%reg), %reg to lea foo@GOTOFF(%reg), %reg 2015-04-01 16:52:09 +03:00
i386_mov_to_lea2.s Convert mov foo@GOT(%reg), %reg to lea foo@GOTOFF(%reg), %reg 2015-04-01 16:52:09 +03:00
i386_mov_to_lea3.s Convert mov foo@GOT(%reg), %reg to lea foo@GOTOFF(%reg), %reg 2015-04-01 16:52:09 +03:00
i386_mov_to_lea4.s Convert mov foo@GOT(%reg), %reg to lea foo@GOTOFF(%reg), %reg 2015-04-01 16:52:09 +03:00
i386_mov_to_lea5.s Convert mov foo@GOT(%reg), %reg to lea foo@GOTOFF(%reg), %reg 2015-04-01 16:52:09 +03:00
i386_mov_to_lea.sh Convert mov foo@GOT(%reg), %reg to lea foo@GOTOFF(%reg), %reg 2015-04-01 16:52:09 +03:00
icf_keep_unique_test.cc
icf_keep_unique_test.sh
icf_preemptible_functions_test.cc
icf_preemptible_functions_test.sh
icf_safe_so_test.cc
icf_safe_so_test.sh
icf_safe_test.cc
icf_safe_test.sh Add s390 backend. 2015-10-28 16:47:27 -07:00
icf_sht_rel_addend_test_1.cc
icf_sht_rel_addend_test_2.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
icf_sht_rel_addend_test.sh
icf_string_merge_test.cc
icf_string_merge_test.sh
icf_test.cc
icf_test.sh
icf_virtual_function_folding_test.cc
ifunc-sel.h
ifuncdep2.c Mark global with hidden attribute 2015-07-22 03:37:50 -07:00
ifuncmain1.c
ifuncmain1vis.c
ifuncmain2.c
ifuncmain3.c
ifuncmain4.c
ifuncmain5.c
ifuncmain6pie.c
ifuncmain7.c
ifuncmod1.c Mark global with hidden attribute 2015-07-22 03:37:50 -07:00
ifuncmod3.c
ifuncmod5.c Mark global with hidden attribute 2015-07-22 03:37:50 -07:00
ifuncmod6.c
ifuncvar1.c
ifuncvar2.c
ifuncvar3.c
incr_comdat_test_1.cc
incr_comdat_test_2_v1.cc
incr_comdat_test_2_v2.cc
incr_comdat_test_2_v3.cc
incremental_test_1.c
incremental_test_2.c
incremental_test.sh
initpri1.c
initpri2.c
initpri3.c
justsyms_1.cc
justsyms_2.cc
justsyms_exec.c
justsyms_lib.c
justsyms.t
large_symbol_alignment.cc
large.c
leb128_unittest.cc
Makefile.am Feed right input object to x86_64_mov_to_lea1[12] 2015-10-20 10:46:47 -07:00
Makefile.in Feed right input object to x86_64_mov_to_lea1[12] 2015-10-20 10:46:47 -07:00
many_sections_test.cc
memory_test_inc_1.t.src PR gold/18048: Fix INCLUDE directive support for gold 2015-03-21 19:54:15 -07:00
memory_test_inc_2.t.src PR gold/18048: Fix INCLUDE directive support for gold 2015-03-21 19:54:15 -07:00
memory_test_inc_3.t.src PR gold/18048: Fix INCLUDE directive support for gold 2015-03-21 19:54:15 -07:00
memory_test_inc.t PR gold/18048: Fix INCLUDE directive support for gold 2015-03-21 19:54:15 -07:00
memory_test.s
memory_test.sh
memory_test.t
merge_string_literals_1.cc
merge_string_literals_2.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
merge_string_literals.sh ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
missing_key_func.cc
missing_key_func.sh
no_version_test.c
no_version_test.sh
object_unittest.cc
odr_header1.h
odr_header2.h
odr_violation1.cc
odr_violation2.cc
pie_copyrelocs_shared_test.cc
pie_copyrelocs_test.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
plugin_common_test_1.c
plugin_common_test_2.c
plugin_final_layout.cc
plugin_final_layout.sh
plugin_section_order.c ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
plugin_test_1.sh Fix a file descriptor leak in gold. 2015-02-03 20:03:42 -08:00
plugin_test_2.sh Fix a file descriptor leak in gold. 2015-02-03 20:03:42 -08:00
plugin_test_3.sh Fix a file descriptor leak in gold. 2015-02-03 20:03:42 -08:00
plugin_test_4.sh
plugin_test_6.sh Fix a file descriptor leak in gold. 2015-02-03 20:03:42 -08:00
plugin_test_7_1.c
plugin_test_7_2.c
plugin_test_7.sh
plugin_test_10.sh
plugin_test_11.sh Fix a file descriptor leak in gold. 2015-02-03 20:03:42 -08:00
plugin_test_tls.sh Fix a file descriptor leak in gold. 2015-02-03 20:03:42 -08:00
plugin_test.c Fix a file descriptor leak in gold. 2015-02-03 20:03:42 -08:00
pr12826_1.s
pr12826_2.s
pr12826.sh ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
pr14265.c
pr14265.sh
pr14265.t
pr18689.c Clear SHF_COMPRESSED flag bit from input to output 2015-07-20 10:14:35 -07:00
pr18689.sh Update testsuite/pr18689.sh for older GCC 2015-07-20 12:20:46 -07:00
protected_1.cc
protected_2.cc
protected_3.cc
protected_4.cc
protected_main_1.cc
protected_main_2.cc
protected_main_3.cc
relro_script_test.t
relro_test_main.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
relro_test.cc
relro_test.sh
retain_symbols_file_test.sh
script_test_1.h Don't compare symbol addresses directly 2015-07-22 03:38:00 -07:00
script_test_1.t
script_test_1a.cc Add __attribute__((__aligned__(1))) to unaligned symbols from scripts (for s390). 2015-10-28 16:49:13 -07:00
script_test_1b.cc Don't compare symbol addresses directly 2015-07-22 03:38:00 -07:00
script_test_2.cc Add __attribute__((__aligned__(1))) to unaligned symbols from scripts (for s390). 2015-10-28 16:49:13 -07:00
script_test_2.t
script_test_2a.cc
script_test_2b.cc
script_test_3.sh
script_test_3.t
script_test_4.sh
script_test_4.t
script_test_5.cc
script_test_5.sh
script_test_5.t
script_test_6.sh
script_test_6.t
script_test_7.sh
script_test_7.t
script_test_8.sh
script_test_9.cc
script_test_9.sh
script_test_9.t
script_test_10.s
script_test_10.sh
script_test_10.t
script_test_11.h Don't compare symbol addresses directly 2015-07-22 03:38:00 -07:00
script_test_11.t
script_test_11a.c Don't compare symbol addresses directly 2015-07-22 03:38:00 -07:00
script_test_11b.c Don't compare symbol addresses directly 2015-07-22 03:38:00 -07:00
script_test_12.t Fix gold to group sections correctly via linker script. 2015-06-03 19:37:49 -07:00
script_test_12a.c Add __attribute__((__aligned__(1))) to unaligned symbols from scripts (for s390). 2015-10-28 16:49:13 -07:00
script_test_12b.c Fix gold to group sections correctly via linker script. 2015-06-03 19:37:49 -07:00
script_test_12i.t Fix gold to group sections correctly via linker script. 2015-06-03 19:37:49 -07:00
searched_file_test_lib.cc
searched_file_test.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
section_sorting_name.cc
section_sorting_name.sh
split_i386_1.s
split_i386_2.s
split_i386_3.s
split_i386_4.s
split_i386_n.s
split_i386.sh ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
split_x32_1.s Handle stack split for x32 2015-01-06 15:38:25 -08:00
split_x32_2.s Handle stack split for x32 2015-01-06 15:38:25 -08:00
split_x32_3.s Handle stack split for x32 2015-01-06 15:38:25 -08:00
split_x32_4.s Handle stack split for x32 2015-01-06 15:38:25 -08:00
split_x32_n.s Handle stack split for x32 2015-01-06 15:38:25 -08:00
split_x32.sh Handle stack split for x32 2015-01-06 15:38:25 -08:00
split_x86_64_1.s
split_x86_64_2.s
split_x86_64_3.s
split_x86_64_4.s
split_x86_64_n.s
split_x86_64.sh
start_lib_test_1.c
start_lib_test_2.c
start_lib_test_3.c
start_lib_test_main.c
strong_ref_weak_def_1.c
strong_ref_weak_def_2.c
strong_ref_weak_def.sh ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
test.cc
test.h
testfile.cc [GOLD] Relocate::relocate() params 2015-12-09 10:36:43 +10:30
testfile.h
testmain.cc
text_section_grouping.cc
text_section_grouping.sh
thin_archive_main.cc
thin_archive_test_1.cc
thin_archive_test_2.cc
thin_archive_test_3.cc
thin_archive_test_4.cc
thumb2_branch_range.t
thumb_bl_in_range.s
thumb_bl_out_of_range_local.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
thumb_bl_out_of_range.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
thumb_blx_in_range.s
thumb_blx_out_of_range.s Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
thumb_branch_range.t ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
tls_pie_test.sh Allow gold to resolve defined TLS symbols in a PIE link. 2015-04-09 15:47:37 -07:00
tls_test_c.c
tls_test_file2.cc
tls_test_main.cc
tls_test.cc
tls_test.h
two_file_shared.sh
two_file_test_1_v1.cc
two_file_test_1.cc
two_file_test_1b_v1.cc
two_file_test_1b.cc
two_file_test_2_tls.cc
two_file_test_2_v1.cc
two_file_test_2.cc
two_file_test_main.cc
two_file_test_tls.cc
two_file_test.h
undef_symbol_main.cc
undef_symbol.cc
undef_symbol.sh
ver_matching_def.cc
ver_matching_test.sh
ver_test_1.cc
ver_test_1.sh
ver_test_2.cc
ver_test_2.script
ver_test_2.sh
ver_test_3.cc
ver_test_4.cc Fix symbol versioning problems in PR 18703. 2015-08-18 19:24:41 -07:00
ver_test_4.script
ver_test_4.sh Fix symbol versioning problems in PR 18703. 2015-08-18 19:24:41 -07:00
ver_test_5.cc
ver_test_5.script
ver_test_5.sh
ver_test_6.c
ver_test_7.cc
ver_test_7.sh
ver_test_8.script
ver_test_9.cc
ver_test_10.script
ver_test_10.sh
ver_test_13.c Fix symbol versioning problems in PR 18703. 2015-08-18 19:24:41 -07:00
ver_test_13.script Fix symbol versioning problems in PR 18703. 2015-08-18 19:24:41 -07:00
ver_test_13.sh Fix symbol versioning problems in PR 18703. 2015-08-18 19:24:41 -07:00
ver_test_main_2.cc
ver_test_main.cc
ver_test.h
version_script.map
weak_alias_test_1.cc
weak_alias_test_2.cc
weak_alias_test_3.cc
weak_alias_test_4.cc
weak_alias_test_5.cc
weak_alias_test_main.cc
weak_alias_test.script
weak_plt_main.cc
weak_plt_shared.cc
weak_plt.sh
weak_test.cc
weak_undef_file1.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
weak_undef_file2.cc
weak_undef_file3.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
weak_undef_file4.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
weak_undef_test_2.cc
weak_undef_test.cc ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
weak_undef.h
weak_unresolved_symbols_test.cc Add option --weak-unresolved-symbols to treat unresolved as weak references. 2015-04-23 13:50:48 -07:00
x86_64_mov_to_lea1.s [Gold,x86_64] Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %reg 2015-04-06 12:37:34 +03:00
x86_64_mov_to_lea2.s [Gold,x86_64] Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %reg 2015-04-06 12:37:34 +03:00
x86_64_mov_to_lea3.s [Gold,x86_64] Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %reg 2015-04-06 12:37:34 +03:00
x86_64_mov_to_lea4.s [Gold,x86_64] Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %reg 2015-04-06 12:37:34 +03:00
x86_64_mov_to_lea.sh [Gold,x86_64] Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %reg 2015-04-06 12:37:34 +03:00