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