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