1 2016-05-06 Han Shen <shenhan@google.com>
5 * aarch64-reloc.def: New relocation type.
6 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
7 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
8 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
9 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
11 2016-04-28 Nick Clifton <nickc@redhat.com>
13 * po/zh_CN.po: Updated Chinese (simplified) translation.
15 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
17 * Makefile.in: Regenerated with automake 1.11.6.
18 * aclocal.m4: Likewise.
19 * testsuite/Makefile.in: Likewise.
21 2016-03-30 Cary Coutant <ccoutant@gmail.com>
24 * symtab.cc (Symbol_table::define_default_version): Check for case
25 where symbols are both in different shared objects.
27 2016-03-27 Cary Coutant <ccoutant@gmail.com>
30 * i386.cc (Target_i386): Add check for fully-resolved symbol for
33 2016-03-22 Nick Clifton <nickc@redhat.com>
35 * configure: Regenerate.
37 2016-03-21 Cary Coutant <ccoutant@gmail.com>
40 * errors.cc (Errors::undefined_symbol): Add info message when
41 symbol should have been provided by a plugin.
42 * target-reloc.h (issue_undefined_symbol_error): Check for
43 placeholder symbols defined in discarded sections.
44 * testsuite/Makefile.am (plugin_test_9b): New test case.
45 * testsuite/Makefile.in: Regenerate.
46 * testsuite/plugin_test_9b_elf.cc: New test source file.
47 * testsuite/plugin_test_9b_ir.cc: New test source file.
49 2016-03-20 Cary Coutant <ccoutant@gmail.com>
52 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
53 * testsuite/Makefile.am (eh_test_2): New test.
54 * testsuite/Makefile.in: Regenerate.
55 * testsuite/eh_test_2.sh: New test script.
56 * testsuite/eh_test_a.cc (bar): Make it comdat.
57 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
59 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
61 * mips.cc (Mips_relobj::is_n64_): Remove.
62 (Target_mips::ei_class_): Likewise.
63 (Mips_relobj::is_newabi): Call methods.
64 (Mips_relobj::is_n64): Change checking for N64 ABI.
65 (Target_mips::is_output_n64): Likewise.
66 (Target_mips::merge_processor_specific_flags): Remove ei_class
67 argument, and remove comparing ei_class.
68 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
70 (Target_mips::do_finalize_sections): Don't pass ei_class argument
71 to merge_processor_specific_flags.
72 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
73 change checking for N64 ABI.
75 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
77 * mips.cc (enum Special_relocation_symbol): New enum type.
78 (is_readonly_section): New function.
80 (Mips_got_entry::is_section_symbol_): New member.
81 (Mips_got_entry::is_section_symbol): New method.
82 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
84 (Mips_relobj::mips_elf_options_section_name): New method.
85 (Mips_output_data_got::record_local_got_symbol): Add
86 is_section_symbol argument, and pass it to
87 Mips_got_info::record_local_got_symbol.
88 (Mips_output_data_got::got_offset): Add addend argument, and pass
89 it to Relobj::local_got_offset.
90 (struct Mips_output_reloc_writer): New type.
91 (class Mips_output_data_reloc): New class.
92 (Mips_output_data_plt::Reloc_section): Change type to
93 Mips_output_data_reloc.
94 (Target_mips::Reloc_section): Likewise.
95 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
96 (Mips_classify_reloc::get_r_type2): New method.
97 (Mips_classify_reloc::get_r_type3): Likewise.
98 (Mips_classify_reloc::get_r_ssym): Likewise.
99 (Target_mips::Reloca_section): Remove.
100 (Relocate::should_apply_static_reloc): Rename from
101 should_apply_r_mips_32_reloc.
102 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
104 (Mips_relocate_functions::Valtype): New type.
105 (Mips_relocate_functions::Valtype64): New type.
106 (Mips_relocate_functions::check_overflow): New method.
107 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
109 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
110 (Mips_relocate_functions::rel16): Add support for resolving
111 relocations for Mips64.
112 (Mips_relocate_functions::rel32): Likewise.
113 (Mips_relocate_functions::reljalr): Likewise.
114 (Mips_relocate_functions::relpc32): Likewise.
115 (Mips_relocate_functions::rel26): Likewise.
116 (Mips_relocate_functions::relpc16): Likewise.
117 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
118 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
119 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
120 (Mips_relocate_functions::do_relhi16): Likewise.
121 (Mips_relocate_functions::do_relgot16_local): Likewise.
122 (Mips_relocate_functions::rello16): Likewise.
123 (Mips_relocate_functions::relgot): Likewise.
124 (Mips_relocate_functions::relgotpage): Likewise.
125 (Mips_relocate_functions::relgotofst): Likewise.
126 (Mips_relocate_functions::relgot_hi16): Likewise.
127 (Mips_relocate_functions::relgot_lo16): Likewise.
128 (Mips_relocate_functions::relgprel): Likewise.
129 (Mips_relocate_functions::relgprel32): Likewise.
130 (Mips_relocate_functions::tlsrelhi16): Likewise.
131 (Mips_relocate_functions::tlsrello16): Likewise.
132 (Mips_relocate_functions::tlsrel32): Likewise.
133 (Mips_relocate_functions::relsub): Likewise.
134 (Mips_relocate_functions::releh): New method.
135 (Mips_relocate_functions::rel64): Likewise.
136 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
137 pass it to Mips_got_entry.
138 (Mips_got_info::add_local_entries): Pass addend argument
139 to code functions, and for STT_SECTION symbols call
140 add_symbolless_local_addend.
141 (Mips_got_info::add_tls_entries): Pass addend argument to code
143 (Mips_relobj::do_read_symbols): Read gp value that was used to
145 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
146 instruction. Opcode for instruction will be selected later.
147 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
148 (Target_mips::scan_relocatable_relocs): Likewise.
149 (Target_mips::emit_relocs_scan): Likewise.
150 (Target_mips::relocate_relocs): Likewise.
151 (Target_mips::do_finalize_sections): Skip objects for merging
152 processor specific flags in which all input sections will be
154 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
155 (Target_mips::Scan::get_reference_flags): Likewise.
156 (Target_mips::relocate_special_relocatable): Call rel26 method with
157 calculate_only and calculated_value arguments.
158 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
159 dynamic relocation against a readonly sections, and pass
160 is_section_symbol to Mips_got_info::record_local_got_symbol.
161 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
162 dynamic relocation against a readonly sections, and pass r_type
163 and r_offset to Target_mips::copy_reloc.
164 (Target_mips::Relocate::relocate): Add support for resolving
165 relocations for Mips64.
166 (Target_mips::mips_info): Add case for Mips64 default dynamic
168 (Target_selector_mips): Correct emulation names.
170 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
172 * mips.cc (class Mips_output_data_la25_stub): Add
173 do_print_to_mapfile function.
175 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
177 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
180 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
182 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
183 * testsuite/plugin_layout_with_alignment.c: This.
184 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
185 (plugin_layout_with_alignment): Likewise.
186 * testsuite/Makefile.in: Regenerated.
188 2016-03-08 Cary Coutant <ccoutant@gmail.com>
191 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
193 * testsuite/Makefile.in: Regenerate.
194 * testsuite/dynamic_list.sh: Likewise.
195 * testsuite/retain_symbols_file_test.sh: Likewise.
197 2016-03-08 Cary Coutant <ccoutant@gmail.com>
200 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
201 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
203 2016-03-08 Cary Coutant <ccoutant@gmail.com>
204 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
206 * output.cc (Output_reloc_writer): New type.
207 (Output_data_reloc_base::do_write): Move implementation to template
208 in output.h and replace with invocation of template.
209 * output.h (Output_file): Move to top of file.
210 (Output_reloc::get_symbol_index): Move to public interface.
211 (Output_reloc::get_address): Likewise.
212 (Output_data_reloc_base::do_write_generic): New function template.
214 2016-03-04 Cary Coutant <ccoutant@gmail.com>
218 * symtab.cc: Instantiate Sized_symbol::init_constant and
219 Sized_symbol::init_undefined.
221 2016-03-03 Cary Coutant <ccoutant@gmail.com>
224 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
225 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
226 * mips.cc (Target_mips::make_symbol): Adjust function signature.
227 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
228 (Target_sparc::do_is_defined_by_abi): Remove test for
230 (Target_sparc::Register_symbol): New struct type.
231 (Target_sparc::register_syms_): New data member.
232 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
233 (Target_sparc::make_symbol): New function.
234 (Target_sparc::do_finalize_sections): Add register symbols and new
235 dynamic table entries.
236 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
237 (Symbol_table::add_target_global_symbol): New function.
238 (Symbol_table::target_symbols_): New data member.
239 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
240 (Symbol_table::Symbol_table): Initialize target_symbols_.
241 (Symbol_table::add_from_object): Pass additional parameters to
243 (Symbol_table::define_special_symbol): Likewise.
244 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
245 undefined symbol value.
246 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
247 (Symbol_table::sized_finalize): Likewise.
248 (Symbol_table::sized_write_globals): Likewise.
249 * target.h (Sized_target::make_symbol): Add name, st_type, object,
250 st_shndx, and value parameters.
252 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
254 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
255 LDPK_WEAKUNDEF symbols.
257 2016-03-03 Than McIntosh <thanm@google.com>
259 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
260 and get_input_section_alignment in transfer vector.
261 (get_input_section_alignment): New function.
262 (get_input_section_size): New function.
263 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
264 * testsuite/Makefile.in: [Regenerate.]
265 * testsuite/plugin_section_alignment.cc: New test file.
266 * testsuite/plugin_layout_with_alignment.cc: New test file.
267 * testsuite/plugin_layout_with_alignment.sh: New test file.
269 2016-03-03 Evgenii Stepanov <eugenis@google.com>
271 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
273 * plugin.cc (get_symbols_v3): New function.
274 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
275 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
278 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
279 Cary Coutant <ccoutant@gmail.com>
282 * ehframe.h (Cie::fde_encoding): New method.
283 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
286 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
288 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
289 -mrelax-relocations=yes to $(TEST_AS).
290 (x86_64_mov_to_lea6.o): Likewise.
291 (x86_64_overflow_pc32.o): Remove duplicated target.
292 * testsuite/Makefile.in: Regenerated.
294 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
296 * s390.cc (Target_s390::match_view_u): New helper method.
297 (Target_s390::do_is_call_to_non_split): New method.
298 (Target_s390::ss_code_st_r14): New const.
299 (Target_s390::ss_code_l_r14): New const.
300 (Target_s390::ss_code_bras_8): New const.
301 (Target_s390::ss_code_l_basr): New const.
302 (Target_s390::ss_code_a_basr): New const.
303 (Target_s390::ss_code_ear): New const.
304 (Target_s390::ss_code_c): New const.
305 (Target_s390::ss_code_larl): New const.
306 (Target_s390::ss_code_brasl): New const.
307 (Target_s390::ss_code_jg): New const.
308 (Target_s390::ss_code_jgl): New const.
309 (Target_s390::ss_match_mcount): New helper method.
310 (Target_s390::ss_match_l): New helper method.
311 (Target_s390::ss_match_ahi): New helper method.
312 (Target_s390::ss_match_alfi): New helper method.
313 (Target_s390::ss_match_cr): New helper method.
314 (Target_s390::do_calls_non_split): New method.
315 * testsuite/Makefile.am: Added new tests.
316 * testsuite/Makefile.in: Regenerate.
317 * testsuite/split_s390.sh: New test.
318 * testsuite/split_s390_1_a1.s: New test.
319 * testsuite/split_s390_1_a2.s: New test.
320 * testsuite/split_s390_1_n1.s: New test.
321 * testsuite/split_s390_1_n2.s: New test.
322 * testsuite/split_s390_1_z1.s: New test.
323 * testsuite/split_s390_1_z2.s: New test.
324 * testsuite/split_s390_1_z3.s: New test.
325 * testsuite/split_s390_1_z4.s: New test.
326 * testsuite/split_s390_2_ns.s: New test.
327 * testsuite/split_s390_2_s.s: New test.
328 * testsuite/split_s390x_1_a1.s: New test.
329 * testsuite/split_s390x_1_a2.s: New test.
330 * testsuite/split_s390x_1_n1.s: New test.
331 * testsuite/split_s390x_1_n2.s: New test.
332 * testsuite/split_s390x_1_z1.s: New test.
333 * testsuite/split_s390x_1_z2.s: New test.
334 * testsuite/split_s390x_1_z3.s: New test.
335 * testsuite/split_s390x_1_z4.s: New test.
336 * testsuite/split_s390x_2_ns.s: New test.
337 * testsuite/split_s390x_2_s.s: New test.
339 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
341 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
342 info message for every erratum 843419 found and fixed.
344 2016-02-07 Cary Coutant <ccoutant@gmail.com>
347 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
348 information to relocation overflow errors.
350 2016-02-06 Cary Coutant <ccoutant@gmail.com>
353 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
354 overflow checking when symbol value + addend < 0.
356 2016-02-06 Cary Coutant <ccoutant@gmail.com>
359 * reloc.h (Limits): New class.
360 (Bits::has_overflow32): Use min/max values from Limits.
361 (Bits::has_unsigned_overflow32): Likewise.
362 (Bits::has_signed_unsigned_overflow32): Likewise.
363 (Bits::has_overflow): Likewise.
364 (Bits::has_unsigned_overflow): Likewise.
365 (Bits::has_signed_unsigned_overflow64): Likewise.
367 2016-02-06 Cary Coutant <ccoutant@gmail.com>
370 * reloc.h (Relocate_functions::Overflow_check): Add comments.
371 * x86_64.cc (X86_64_relocate_functions): New class.
372 (Target_x86_64::Relocate::relocate): Use the new class.
373 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
374 (x32_overflow_pc32): New test case.
375 * testsuite/Makefile.in: Regenerate.
376 * testsuite/x32_overflow_pc32.sh: New script.
377 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
379 2016-02-06 Cary Coutant <ccoutant@gmail.com>
382 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
383 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
385 2016-02-06 Cary Coutant <ccoutant@gmail.com>
388 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
390 (Bits::has_unsigned_overflow): Likewise.
392 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
394 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
396 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
397 and view_size to is_call_to_non_split.
398 * target.cc (Target::is_call_to_non_split): Add view and view_size
400 * target.h (class Target): Likewise.
402 2016-02-05 Sriraman Tallam <tmsriram@google.com>
404 * icf.cc (get_rel_addend): New function.
405 (get_section_contents): Move merge section addend computation to a
406 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
407 Fix bug to not read past the length of the section.
409 2016-02-05 Cary Coutant <ccoutant@gmail.com>
410 Andrew Senkevich <andrew.senkevich@intel.com>
413 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
414 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
416 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
417 * testsuite/x86_64_overflow_pc32.sh: New test script.
418 * testsuite/x86_64_overflow_pc32.s: New source file.
420 2016-02-05 Cary Coutant <ccoutant@gmail.com>
423 * reloc.h (Relocate_functions::Address): New typedef.
424 (Relocate_functions::Addendtype): New typedef.
425 (Relocate_functions::Overflow_check): New enum type.
426 (Relocate_functions::Reloc_status): New enum type.
427 (Relocate_functions::check_overflow): New function template.
428 (Relocate_functions::rel): Add check parameter; check for overflow.
429 (Relocate_functions::rel_unaligned): Likewise.
430 (Relocate_functions::rela): Likewise.
431 (Relocate_functions::pcrel): Likewise.
432 (Relocate_functions::pcrel_unaligned): Likewise.
433 (Relocate_functions::pcrela): Likewise.
434 (Relocate_functions::rel8): Adjust parameter types.
435 (Relocate_functions::rela8): Likewise.
436 (Relocate_functions::pcrel8): Likewise.
437 (Relocate_functions::pcrela8): Likewise.
438 (Relocate_functions::rel16): Likewise.
439 (Relocate_functions::rela168): Likewise.
440 (Relocate_functions::pcrel16): Likewise.
441 (Relocate_functions::pcrela16): Likewise.
442 (Relocate_functions::rel32): Likewise.
443 (Relocate_functions::rel32_unaligned): Likewise.
444 (Relocate_functions::rela32): Likewise.
445 (Relocate_functions::pcrel32): Likewise.
446 (Relocate_functions::pcrel32_unaligned): Likewise.
447 (Relocate_functions::pcrela32): Likewise.
448 (Relocate_functions::rel8_check): New function.
449 (Relocate_functions::rela8_check): New function.
450 (Relocate_functions::pcrel8_check): New function.
451 (Relocate_functions::pcrela8_check): New function.
452 (Relocate_functions::rel16_check): New function.
453 (Relocate_functions::rela168_check): New function.
454 (Relocate_functions::pcrel16_check): New function.
455 (Relocate_functions::pcrela16_check): New function.
456 (Relocate_functions::rel32_check): New function.
457 (Relocate_functions::rel32_unaligned_check): New function.
458 (Relocate_functions::rela32_check): New function.
459 (Relocate_functions::pcrel32_check): New function.
460 (Relocate_functions::pcrel32_unaligned_check): New function.
461 (Relocate_functions::pcrela32_check): New function.
462 (Bits::has_unsigned_overflow32): New function.
463 (Bits::has_unsigned_overflow): New function.
464 * testsuite/Makefile.am (overflow_unittest): New test.
465 * testsuite/Makefile.in: Regenerate.
466 * testsuite/overflow_unittest.cc: New source file.
468 2016-02-04 Alan Modra <amodra@gmail.com>
470 * powerpc.cc (relocate): Adjust last patch for big-endian.
472 2016-02-02 Alan Modra <amodra@gmail.com>
474 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
476 2016-01-15 Han Shen <shenhan@google.com>
478 PR gold/19472 - need pc-relative stubs.
480 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
481 stub type for DSOs and pie executables.
483 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
485 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
488 2016-01-12 Cary Coutant <ccoutant@gmail.com>
490 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
491 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
492 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
493 specializations) New method.
495 2016-01-11 Cary Coutant <ccoutant@gmail.com>
498 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
499 we have a TLS segment for GD-to-IE optimization.
500 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
502 (Target_i386::tls_desc_gd_to_ie): Likewise.
503 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
504 for TLSDESC GD-to-IE optimizations.
505 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
507 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
508 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
509 for TLSDESC GD-to-IE optimizations.
511 2016-01-11 Cary Coutant <ccoutant@gmail.com>
513 Refactor gold to enable support for MIPS-64 relocation format.
515 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
516 (gc_process_relocs): Remove sh_type template parameter.
517 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
518 * object.h (Sized_relobj_file::split_stack_adjust): Add target
520 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
521 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
522 specializations) Remove.
523 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
524 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
525 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
526 (Sized_relobj_file::split_stack_adjust): Add target parameter.
528 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
529 Target::get_r_sym() to get r_sym field from relocations.
530 (Track_relocs::next_symndx): Call Target::get_r_sym().
531 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
532 add Classify_reloc template parameter. Use for accessing r_sym and
534 (relocate_section): Likewise.
535 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
536 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
537 (Default_scan_relocatable_relocs::Reltype): New typedef.
538 (Default_scan_relocatable_relocs::reloc_size): New const.
539 (Default_scan_relocatable_relocs::sh_type): New const.
540 (Default_scan_relocatable_relocs::get_r_sym): New method.
541 (Default_scan_relocatable_relocs::get_r_type): New method.
542 (Default_emit_relocs_strategy): New class.
543 (scan_relocatable_relocs): Replace sh_type template parameter with
544 Scan_relocatable_relocs class. Use it to access r_sym and r_type
546 (relocate_relocs): Replace sh_type template parameter with
547 Classify_reloc class. Use it to access r_sym and r_type fields.
548 * target.h (Target::is_call_to_non_split): Replace r_type parameter
549 with pointer to relocation. Adjust all callers.
550 (Target::do_is_call_to_non_split): Likewise.
551 (Target::emit_relocs_scan): New virtual method.
552 (Sized_target::get_r_sym): New virtual method.
553 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
554 with pointer to relocation.
556 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
557 (Target_aarch64::Relocatable_size_for_reloc): Remove.
558 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
559 (Target_aarch64::scan_relocs): Likewise.
560 (Target_aarch64::relocate_section): Likewise.
561 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
563 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
564 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
565 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
567 (Target_arm::emit_relocs_scan): New method.
568 (Target_arm::Relocatable_size_for_reloc): Replace with...
569 (Target_arm::Classify_reloc): ...this.
570 (Target_arm::gc_process_relocs): Use Classify_reloc.
571 (Target_arm::scan_relocs): Likewise.
572 (Target_arm::relocate_section): Likewise.
573 (Target_arm::scan_relocatable_relocs): Likewise.
574 (Target_arm::relocate_relocs): Likewise.
575 * i386.cc (Target_i386::emit_relocs_scan): New method.
576 (Target_i386::Relocatable_size_for_reloc): Replace with...
577 (Target_i386::Classify_reloc): ...this.
578 (Target_i386::gc_process_relocs): Use Classify_reloc.
579 (Target_i386::scan_relocs): Likewise.
580 (Target_i386::relocate_section): Likewise.
581 (Target_i386::scan_relocatable_relocs): Likewise.
582 (Target_i386::relocate_relocs): Likewise.
583 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
585 (Mips_reloc_types): New class template.
586 (Mips_classify_reloc): New class template.
587 (Target_mips::Reltype): New typedef.
588 (Target_mips::Relatype): New typedef.
589 (Target_mips::emit_relocs_scan): New method.
590 (Target_mips::get_r_sym): New method.
591 (Target_mips::Relocatable_size_for_reloc): Replace with
593 (Target_mips::copy_reloc): Use Mips_classify_reloc.
594 (Target_mips::gc_process_relocs): Likewise.
595 (Target_mips::scan_relocs): Likewise.
596 (Target_mips::relocate_section): Likewise.
597 (Target_mips::scan_relocatable_relocs): Likewise.
598 (Target_mips::relocate_relocs): Likewise.
599 (mips_get_size_for_reloc): New function, factored out from
600 Relocatable_size_for_reloc::get_size_for_reloc.
601 (Target_mips::Scan::local): Use Mips_classify_reloc.
602 (Target_mips::Scan::global): Likewise.
603 (Target_mips::Relocate::relocate): Likewise.
604 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
605 (Target_powerpc::Relocatable_size_for_reloc): Remove.
606 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
607 (Target_powerpc::scan_relocs): Likewise.
608 (Target_powerpc::relocate_section): Likewise.
609 (Powerpc_scan_relocatable_reloc): Convert to class template.
610 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
611 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
612 (Powerpc_scan_relocatable_reloc::sh_type): New const.
613 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
614 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
615 (Target_powerpc::scan_relocatable_relocs): Use
616 Powerpc_scan_relocatable_reloc.
617 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
618 * s390.cc (Target_s390::emit_relocs_scan): New method.
619 (Target_s390::Relocatable_size_for_reloc): Remove.
620 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
621 (Target_s390::scan_relocs): Likewise.
622 (Target_s390::relocate_section): Likewise.
623 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
625 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
626 (Target_s390::relocate_relocs): Use Default_classify_reloc.
627 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
628 (Target_sparc::Relocatable_size_for_reloc): Remove.
629 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
630 (Target_sparc::scan_relocs): Likewise.
631 (Target_sparc::relocate_section): Likewise.
632 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
634 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
635 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
636 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
637 (Target_tilegx::Relocatable_size_for_reloc): Remove.
638 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
639 (Target_tilegx::scan_relocs): Likewise.
640 (Target_tilegx::relocate_section): Likewise.
641 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
643 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
644 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
645 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
646 (Target_x86_64::Relocatable_size_for_reloc): Remove.
647 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
648 (Target_x86_64::scan_relocs): Likewise.
649 (Target_x86_64::relocate_section): Likewise.
650 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
652 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
653 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
655 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
657 2016-01-01 Alan Modra <amodra@gmail.com>
659 Update year range in copyright notice of all files.
661 For older changes see ChangeLog-0815
663 Copyright (C) 2016 Free Software Foundation, Inc.
665 Copying and distribution of this file, with or without modification,
666 are permitted in any medium without royalty provided the copyright
667 notice and this notice are preserved.
673 version-control: never