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