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