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