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