1 2016-03-08 Cary Coutant <ccoutant@gmail.com>
4 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
5 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
7 2016-03-08 Cary Coutant <ccoutant@gmail.com>
8 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
10 * output.cc (Output_reloc_writer): New type.
11 (Output_data_reloc_base::do_write): Move implementation to template
12 in output.h and replace with invocation of template.
13 * output.h (Output_file): Move to top of file.
14 (Output_reloc::get_symbol_index): Move to public interface.
15 (Output_reloc::get_address): Likewise.
16 (Output_data_reloc_base::do_write_generic): New function template.
18 2016-03-04 Cary Coutant <ccoutant@gmail.com>
22 * symtab.cc: Instantiate Sized_symbol::init_constant and
23 Sized_symbol::init_undefined.
25 2016-03-03 Cary Coutant <ccoutant@gmail.com>
28 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
29 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
30 * mips.cc (Target_mips::make_symbol): Adjust function signature.
31 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
32 (Target_sparc::do_is_defined_by_abi): Remove test for
34 (Target_sparc::Register_symbol): New struct type.
35 (Target_sparc::register_syms_): New data member.
36 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
37 (Target_sparc::make_symbol): New function.
38 (Target_sparc::do_finalize_sections): Add register symbols and new
39 dynamic table entries.
40 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
41 (Symbol_table::add_target_global_symbol): New function.
42 (Symbol_table::target_symbols_): New data member.
43 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
44 (Symbol_table::Symbol_table): Initialize target_symbols_.
45 (Symbol_table::add_from_object): Pass additional parameters to
47 (Symbol_table::define_special_symbol): Likewise.
48 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
49 undefined symbol value.
50 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
51 (Symbol_table::sized_finalize): Likewise.
52 (Symbol_table::sized_write_globals): Likewise.
53 * target.h (Sized_target::make_symbol): Add name, st_type, object,
54 st_shndx, and value parameters.
56 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
58 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
59 LDPK_WEAKUNDEF symbols.
61 2016-03-03 Than McIntosh <thanm@google.com>
63 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
64 and get_input_section_alignment in transfer vector.
65 (get_input_section_alignment): New function.
66 (get_input_section_size): New function.
67 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
68 * testsuite/Makefile.in: [Regenerate.]
69 * testsuite/plugin_section_alignment.cc: New test file.
70 * testsuite/plugin_layout_with_alignment.cc: New test file.
71 * testsuite/plugin_layout_with_alignment.sh: New test file.
73 2016-03-03 Evgenii Stepanov <eugenis@google.com>
75 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
77 * plugin.cc (get_symbols_v3): New function.
78 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
79 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
82 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
83 Cary Coutant <ccoutant@gmail.com>
86 * ehframe.h (Cie::fde_encoding): New method.
87 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
90 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
92 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
93 -mrelax-relocations=yes to $(TEST_AS).
94 (x86_64_mov_to_lea6.o): Likewise.
95 (x86_64_overflow_pc32.o): Remove duplicated target.
96 * testsuite/Makefile.in: Regenerated.
98 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
100 * s390.cc (Target_s390::match_view_u): New helper method.
101 (Target_s390::do_is_call_to_non_split): New method.
102 (Target_s390::ss_code_st_r14): New const.
103 (Target_s390::ss_code_l_r14): New const.
104 (Target_s390::ss_code_bras_8): New const.
105 (Target_s390::ss_code_l_basr): New const.
106 (Target_s390::ss_code_a_basr): New const.
107 (Target_s390::ss_code_ear): New const.
108 (Target_s390::ss_code_c): New const.
109 (Target_s390::ss_code_larl): New const.
110 (Target_s390::ss_code_brasl): New const.
111 (Target_s390::ss_code_jg): New const.
112 (Target_s390::ss_code_jgl): New const.
113 (Target_s390::ss_match_mcount): New helper method.
114 (Target_s390::ss_match_l): New helper method.
115 (Target_s390::ss_match_ahi): New helper method.
116 (Target_s390::ss_match_alfi): New helper method.
117 (Target_s390::ss_match_cr): New helper method.
118 (Target_s390::do_calls_non_split): New method.
119 * testsuite/Makefile.am: Added new tests.
120 * testsuite/Makefile.in: Regenerate.
121 * testsuite/split_s390.sh: New test.
122 * testsuite/split_s390_1_a1.s: New test.
123 * testsuite/split_s390_1_a2.s: New test.
124 * testsuite/split_s390_1_n1.s: New test.
125 * testsuite/split_s390_1_n2.s: New test.
126 * testsuite/split_s390_1_z1.s: New test.
127 * testsuite/split_s390_1_z2.s: New test.
128 * testsuite/split_s390_1_z3.s: New test.
129 * testsuite/split_s390_1_z4.s: New test.
130 * testsuite/split_s390_2_ns.s: New test.
131 * testsuite/split_s390_2_s.s: New test.
132 * testsuite/split_s390x_1_a1.s: New test.
133 * testsuite/split_s390x_1_a2.s: New test.
134 * testsuite/split_s390x_1_n1.s: New test.
135 * testsuite/split_s390x_1_n2.s: New test.
136 * testsuite/split_s390x_1_z1.s: New test.
137 * testsuite/split_s390x_1_z2.s: New test.
138 * testsuite/split_s390x_1_z3.s: New test.
139 * testsuite/split_s390x_1_z4.s: New test.
140 * testsuite/split_s390x_2_ns.s: New test.
141 * testsuite/split_s390x_2_s.s: New test.
143 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
145 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
146 info message for every erratum 843419 found and fixed.
148 2016-02-07 Cary Coutant <ccoutant@gmail.com>
151 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
152 information to relocation overflow errors.
154 2016-02-06 Cary Coutant <ccoutant@gmail.com>
157 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
158 overflow checking when symbol value + addend < 0.
160 2016-02-06 Cary Coutant <ccoutant@gmail.com>
163 * reloc.h (Limits): New class.
164 (Bits::has_overflow32): Use min/max values from Limits.
165 (Bits::has_unsigned_overflow32): Likewise.
166 (Bits::has_signed_unsigned_overflow32): Likewise.
167 (Bits::has_overflow): Likewise.
168 (Bits::has_unsigned_overflow): Likewise.
169 (Bits::has_signed_unsigned_overflow64): Likewise.
171 2016-02-06 Cary Coutant <ccoutant@gmail.com>
174 * reloc.h (Relocate_functions::Overflow_check): Add comments.
175 * x86_64.cc (X86_64_relocate_functions): New class.
176 (Target_x86_64::Relocate::relocate): Use the new class.
177 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
178 (x32_overflow_pc32): New test case.
179 * testsuite/Makefile.in: Regenerate.
180 * testsuite/x32_overflow_pc32.sh: New script.
181 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
183 2016-02-06 Cary Coutant <ccoutant@gmail.com>
186 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
187 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
189 2016-02-06 Cary Coutant <ccoutant@gmail.com>
192 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
194 (Bits::has_unsigned_overflow): Likewise.
196 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
198 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
200 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
201 and view_size to is_call_to_non_split.
202 * target.cc (Target::is_call_to_non_split): Add view and view_size
204 * target.h (class Target): Likewise.
206 2016-02-05 Sriraman Tallam <tmsriram@google.com>
208 * icf.cc (get_rel_addend): New function.
209 (get_section_contents): Move merge section addend computation to a
210 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
211 Fix bug to not read past the length of the section.
213 2016-02-05 Cary Coutant <ccoutant@gmail.com>
214 Andrew Senkevich <andrew.senkevich@intel.com>
217 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
218 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
220 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
221 * testsuite/x86_64_overflow_pc32.sh: New test script.
222 * testsuite/x86_64_overflow_pc32.s: New source file.
224 2016-02-05 Cary Coutant <ccoutant@gmail.com>
227 * reloc.h (Relocate_functions::Address): New typedef.
228 (Relocate_functions::Addendtype): New typedef.
229 (Relocate_functions::Overflow_check): New enum type.
230 (Relocate_functions::Reloc_status): New enum type.
231 (Relocate_functions::check_overflow): New function template.
232 (Relocate_functions::rel): Add check parameter; check for overflow.
233 (Relocate_functions::rel_unaligned): Likewise.
234 (Relocate_functions::rela): Likewise.
235 (Relocate_functions::pcrel): Likewise.
236 (Relocate_functions::pcrel_unaligned): Likewise.
237 (Relocate_functions::pcrela): Likewise.
238 (Relocate_functions::rel8): Adjust parameter types.
239 (Relocate_functions::rela8): Likewise.
240 (Relocate_functions::pcrel8): Likewise.
241 (Relocate_functions::pcrela8): Likewise.
242 (Relocate_functions::rel16): Likewise.
243 (Relocate_functions::rela168): Likewise.
244 (Relocate_functions::pcrel16): Likewise.
245 (Relocate_functions::pcrela16): Likewise.
246 (Relocate_functions::rel32): Likewise.
247 (Relocate_functions::rel32_unaligned): Likewise.
248 (Relocate_functions::rela32): Likewise.
249 (Relocate_functions::pcrel32): Likewise.
250 (Relocate_functions::pcrel32_unaligned): Likewise.
251 (Relocate_functions::pcrela32): Likewise.
252 (Relocate_functions::rel8_check): New function.
253 (Relocate_functions::rela8_check): New function.
254 (Relocate_functions::pcrel8_check): New function.
255 (Relocate_functions::pcrela8_check): New function.
256 (Relocate_functions::rel16_check): New function.
257 (Relocate_functions::rela168_check): New function.
258 (Relocate_functions::pcrel16_check): New function.
259 (Relocate_functions::pcrela16_check): New function.
260 (Relocate_functions::rel32_check): New function.
261 (Relocate_functions::rel32_unaligned_check): New function.
262 (Relocate_functions::rela32_check): New function.
263 (Relocate_functions::pcrel32_check): New function.
264 (Relocate_functions::pcrel32_unaligned_check): New function.
265 (Relocate_functions::pcrela32_check): New function.
266 (Bits::has_unsigned_overflow32): New function.
267 (Bits::has_unsigned_overflow): New function.
268 * testsuite/Makefile.am (overflow_unittest): New test.
269 * testsuite/Makefile.in: Regenerate.
270 * testsuite/overflow_unittest.cc: New source file.
272 2016-02-04 Alan Modra <amodra@gmail.com>
274 * powerpc.cc (relocate): Adjust last patch for big-endian.
276 2016-02-02 Alan Modra <amodra@gmail.com>
278 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
280 2016-01-15 Han Shen <shenhan@google.com>
282 PR gold/19472 - need pc-relative stubs.
284 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
285 stub type for DSOs and pie executables.
287 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
289 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
292 2016-01-12 Cary Coutant <ccoutant@gmail.com>
294 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
295 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
296 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
297 specializations) New method.
299 2016-01-11 Cary Coutant <ccoutant@gmail.com>
302 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
303 we have a TLS segment for GD-to-IE optimization.
304 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
306 (Target_i386::tls_desc_gd_to_ie): Likewise.
307 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
308 for TLSDESC GD-to-IE optimizations.
309 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
311 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
312 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
313 for TLSDESC GD-to-IE optimizations.
315 2016-01-11 Cary Coutant <ccoutant@gmail.com>
317 Refactor gold to enable support for MIPS-64 relocation format.
319 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
320 (gc_process_relocs): Remove sh_type template parameter.
321 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
322 * object.h (Sized_relobj_file::split_stack_adjust): Add target
324 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
325 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
326 specializations) Remove.
327 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
328 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
329 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
330 (Sized_relobj_file::split_stack_adjust): Add target parameter.
332 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
333 Target::get_r_sym() to get r_sym field from relocations.
334 (Track_relocs::next_symndx): Call Target::get_r_sym().
335 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
336 add Classify_reloc template parameter. Use for accessing r_sym and
338 (relocate_section): Likewise.
339 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
340 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
341 (Default_scan_relocatable_relocs::Reltype): New typedef.
342 (Default_scan_relocatable_relocs::reloc_size): New const.
343 (Default_scan_relocatable_relocs::sh_type): New const.
344 (Default_scan_relocatable_relocs::get_r_sym): New method.
345 (Default_scan_relocatable_relocs::get_r_type): New method.
346 (Default_emit_relocs_strategy): New class.
347 (scan_relocatable_relocs): Replace sh_type template parameter with
348 Scan_relocatable_relocs class. Use it to access r_sym and r_type
350 (relocate_relocs): Replace sh_type template parameter with
351 Classify_reloc class. Use it to access r_sym and r_type fields.
352 * target.h (Target::is_call_to_non_split): Replace r_type parameter
353 with pointer to relocation. Adjust all callers.
354 (Target::do_is_call_to_non_split): Likewise.
355 (Target::emit_relocs_scan): New virtual method.
356 (Sized_target::get_r_sym): New virtual method.
357 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
358 with pointer to relocation.
360 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
361 (Target_aarch64::Relocatable_size_for_reloc): Remove.
362 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
363 (Target_aarch64::scan_relocs): Likewise.
364 (Target_aarch64::relocate_section): Likewise.
365 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
367 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
368 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
369 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
371 (Target_arm::emit_relocs_scan): New method.
372 (Target_arm::Relocatable_size_for_reloc): Replace with...
373 (Target_arm::Classify_reloc): ...this.
374 (Target_arm::gc_process_relocs): Use Classify_reloc.
375 (Target_arm::scan_relocs): Likewise.
376 (Target_arm::relocate_section): Likewise.
377 (Target_arm::scan_relocatable_relocs): Likewise.
378 (Target_arm::relocate_relocs): Likewise.
379 * i386.cc (Target_i386::emit_relocs_scan): New method.
380 (Target_i386::Relocatable_size_for_reloc): Replace with...
381 (Target_i386::Classify_reloc): ...this.
382 (Target_i386::gc_process_relocs): Use Classify_reloc.
383 (Target_i386::scan_relocs): Likewise.
384 (Target_i386::relocate_section): Likewise.
385 (Target_i386::scan_relocatable_relocs): Likewise.
386 (Target_i386::relocate_relocs): Likewise.
387 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
389 (Mips_reloc_types): New class template.
390 (Mips_classify_reloc): New class template.
391 (Target_mips::Reltype): New typedef.
392 (Target_mips::Relatype): New typedef.
393 (Target_mips::emit_relocs_scan): New method.
394 (Target_mips::get_r_sym): New method.
395 (Target_mips::Relocatable_size_for_reloc): Replace with
397 (Target_mips::copy_reloc): Use Mips_classify_reloc.
398 (Target_mips::gc_process_relocs): Likewise.
399 (Target_mips::scan_relocs): Likewise.
400 (Target_mips::relocate_section): Likewise.
401 (Target_mips::scan_relocatable_relocs): Likewise.
402 (Target_mips::relocate_relocs): Likewise.
403 (mips_get_size_for_reloc): New function, factored out from
404 Relocatable_size_for_reloc::get_size_for_reloc.
405 (Target_mips::Scan::local): Use Mips_classify_reloc.
406 (Target_mips::Scan::global): Likewise.
407 (Target_mips::Relocate::relocate): Likewise.
408 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
409 (Target_powerpc::Relocatable_size_for_reloc): Remove.
410 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
411 (Target_powerpc::scan_relocs): Likewise.
412 (Target_powerpc::relocate_section): Likewise.
413 (Powerpc_scan_relocatable_reloc): Convert to class template.
414 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
415 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
416 (Powerpc_scan_relocatable_reloc::sh_type): New const.
417 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
418 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
419 (Target_powerpc::scan_relocatable_relocs): Use
420 Powerpc_scan_relocatable_reloc.
421 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
422 * s390.cc (Target_s390::emit_relocs_scan): New method.
423 (Target_s390::Relocatable_size_for_reloc): Remove.
424 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
425 (Target_s390::scan_relocs): Likewise.
426 (Target_s390::relocate_section): Likewise.
427 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
429 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
430 (Target_s390::relocate_relocs): Use Default_classify_reloc.
431 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
432 (Target_sparc::Relocatable_size_for_reloc): Remove.
433 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
434 (Target_sparc::scan_relocs): Likewise.
435 (Target_sparc::relocate_section): Likewise.
436 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
438 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
439 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
440 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
441 (Target_tilegx::Relocatable_size_for_reloc): Remove.
442 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
443 (Target_tilegx::scan_relocs): Likewise.
444 (Target_tilegx::relocate_section): Likewise.
445 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
447 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
448 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
449 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
450 (Target_x86_64::Relocatable_size_for_reloc): Remove.
451 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
452 (Target_x86_64::scan_relocs): Likewise.
453 (Target_x86_64::relocate_section): Likewise.
454 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
456 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
457 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
459 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
461 2016-01-01 Alan Modra <amodra@gmail.com>
463 Update year range in copyright notice of all files.
465 For older changes see ChangeLog-0815
467 Copyright (C) 2016 Free Software Foundation, Inc.
469 Copying and distribution of this file, with or without modification,
470 are permitted in any medium without royalty provided the copyright
471 notice and this notice are preserved.
477 version-control: never