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