1 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
4 * testsuite/script_test_2.t: Add .got.plt after .got.
6 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
8 * mips.cc (struct Mips_abiflags): New struct.
9 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
11 (Mips_relobj::~Mips_relobj): Delete object pointed by
12 attributes_section_data_.
13 (Mips_relobj::abiflags): New method.
14 (Mips_relobj::attributes_section_data): Likewise.
15 (Mips_relobj::attributes_section_data_): New data member.
16 (Mips_relobj::abiflags_): Likewise.
17 (class Mips_output_section_abiflags): New class.
18 (Target_mips::Target_mips): Initialize attributes_section_data_,
19 abiflags_ and has_abiflags_section_.
20 (Target_mips::do_should_include_section): Don't emit input
21 .MIPS.abiflags sections to output .MIPS.abiflags.
22 (Target_mips::Mips_mach): Add new enum constants.
23 (Target_mips::mips_isa_ext_mach): New method.
24 (Target_mips::mips_isa_ext): Likewise.
25 (Target_mips::update_abiflags_isa): Likewise.
26 (Target_mips::infer_abiflags): Likewise.
27 (Target_mips::create_abiflags): Likewise.
28 (Target_mips::fp_abi_string): Likewise.
29 (Target_mips::select_fp_abi): Likewise.
30 (Target_mips::merge_obj_attributes): Likewise.
31 (Target_mips::merge_obj_abiflags): Likewise.
32 (Target_mips::level_rev): Likewise.
33 (Target_mips::merge_obj_e_flags): Rename from
34 merge_processor_specific_flags. Remove dyn_obj argument,
35 call update_abiflags_isa when needed, compare NaN encodings and
37 (Target_mips::add_machine_extensions): Add two machine extensions
39 (Target_mips::attributes_section_data_): New data member.
40 (Target_mips::abiflags_): Likewise.
41 (Target_mips::has_abiflags_section_): Likewise.
42 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
43 .MIPS.abiflags sections if they exists.
44 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
45 E_MIPS_MACH_OCTEON3 support.
46 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
47 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
48 .MIPS.abiflags sections from input. Create these sections if
50 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
51 E_MIPS_MACH_OCTEON3 support, and change strings for
52 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
55 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
57 * mips.cc (Mips_relobj::Mips_relobj): Initialize
59 (Mips_relobj::has_reginfo_section_): New data member.
60 (Mips_relobj::has_reginfo_section): New method.
61 (class Mips_output_section_reginfo): Change base class to
62 Output_section_data, and set masks of the output .reginfo section
64 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
66 (Mips_output_section_reginfo::set_masks): Likewise.
67 (Mips_output_section_reginfo::set_final_data_size): Likewise.
68 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
69 (Target_mips::do_make_output_section): Remove.
70 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
71 if the object contains a .reginfo section.
72 (Target_mips::do_finalize_sections): Create a .reginfo output
75 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
77 * mips.cc (Mips_output_data_got::do_write): Add missing template
80 2016-05-30 Marcin KoĆcielnicki <koriakin@0x04.net>
83 * s390.cc (Target_s390::ss_code_st_r14): Removed.
84 (Target_s390::ss_code_l_r14): Removed.
85 (Target_s390::ss_code_ear): Removed.
86 (Target_s390::ss_code_c): Removed.
87 (Target_s390::ss_match_st_r14): New function.
88 (Target_s390::ss_match_l_r14): New function.
89 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
90 of matching code directly.
91 (Target_s390::ss_match_ear): New function.
92 (Target_s390::ss_match_c): New function.
93 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
94 of matching code directly.
96 2016-05-19 Cary Coutant <ccoutant@gmail.com>
99 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
100 parameter; check for protected symbol.
101 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
102 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
103 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
104 (Symbol_table::add_from_dynobj): Mark protected symbols.
105 * symtab.h (Symbol::is_protected): New method.
106 (Symbol::set_is_protected): New method.
107 (Symbol::is_protected_): New data member.
109 * testsuite/Makefile.am (copy_test_protected): New test.
110 * testsuite/Makefile.in: Regenerate.
111 * testsuite/copy_test.cc (main): Add legal reference to protected
113 * testsuite/copy_test_v1.cc (main): Likewise.
114 * testsuite/copy_test_2.cc (ip): Add protected symbol.
115 * testsuite/copy_test_protected.cc: New test source file.
116 * testsuite/copy_test_protected.sh: New test script.
118 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
120 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
121 for global got symbols, and set addend to 0.
122 (Mips_got_entry::hash): Change hash algorithm.
123 (Mips_got_entry::equals): Refactor.
124 (Mips_got_entry::object): Return input object for local got symbols
126 (Mips_got_entry::addend): Change return of the relocation addend.
127 (Mips_got_entry::addend_): Move from union d.
128 (Mips_got_entry::object_): Move into union d.
129 (class Mips_symbol_hash): New class.
130 (Mips_got_info::Global_got_entry_set): New type.
131 (Mips_got_info::global_got_symbols): Change return type to
132 Global_got_entry_set.
133 (Mips_got_info::global_got_symbols_): Change type to
134 Global_got_entry_set.
135 (Mips_symbol::hash): New method.
136 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
137 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
138 (Mips_output_data_mips_stubs::symbols_): Change type to
139 Mips_stubs_entry_set.
140 (Mips_got_info::record_global_got_symbol): Don't pass object
141 argument when creating global got symbol.
142 (Mips_got_info::record_got_entry): Remove find before inserting
144 (Mips_got_info::add_reloc_only_entries): Change type of iterator
145 to Global_got_entry_set.
146 (Mips_got_info::count_got_symbols): Likewise.
147 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
148 for adding entries to symbols_.
149 (Mips_output_data_la25_stub::do_write): Change type of iterator
151 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
152 of iterator to Mips_stubs_entry_set.
153 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
154 (Mips_output_data_mips_stubs::do_write): Likewise.
156 2016-05-06 Han Shen <shenhan@google.com>
160 * aarch64-reloc.def: New relocation type.
161 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
162 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
163 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
164 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
166 2016-04-28 Nick Clifton <nickc@redhat.com>
168 * po/zh_CN.po: Updated Chinese (simplified) translation.
170 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
172 * Makefile.in: Regenerated with automake 1.11.6.
173 * aclocal.m4: Likewise.
174 * testsuite/Makefile.in: Likewise.
176 2016-03-30 Cary Coutant <ccoutant@gmail.com>
179 * symtab.cc (Symbol_table::define_default_version): Check for case
180 where symbols are both in different shared objects.
182 2016-03-27 Cary Coutant <ccoutant@gmail.com>
185 * i386.cc (Target_i386): Add check for fully-resolved symbol for
188 2016-03-22 Nick Clifton <nickc@redhat.com>
190 * configure: Regenerate.
192 2016-03-21 Cary Coutant <ccoutant@gmail.com>
195 * errors.cc (Errors::undefined_symbol): Add info message when
196 symbol should have been provided by a plugin.
197 * target-reloc.h (issue_undefined_symbol_error): Check for
198 placeholder symbols defined in discarded sections.
199 * testsuite/Makefile.am (plugin_test_9b): New test case.
200 * testsuite/Makefile.in: Regenerate.
201 * testsuite/plugin_test_9b_elf.cc: New test source file.
202 * testsuite/plugin_test_9b_ir.cc: New test source file.
204 2016-03-20 Cary Coutant <ccoutant@gmail.com>
207 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
208 * testsuite/Makefile.am (eh_test_2): New test.
209 * testsuite/Makefile.in: Regenerate.
210 * testsuite/eh_test_2.sh: New test script.
211 * testsuite/eh_test_a.cc (bar): Make it comdat.
212 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
214 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
216 * mips.cc (Mips_relobj::is_n64_): Remove.
217 (Target_mips::ei_class_): Likewise.
218 (Mips_relobj::is_newabi): Call methods.
219 (Mips_relobj::is_n64): Change checking for N64 ABI.
220 (Target_mips::is_output_n64): Likewise.
221 (Target_mips::merge_processor_specific_flags): Remove ei_class
222 argument, and remove comparing ei_class.
223 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
225 (Target_mips::do_finalize_sections): Don't pass ei_class argument
226 to merge_processor_specific_flags.
227 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
228 change checking for N64 ABI.
230 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
232 * mips.cc (enum Special_relocation_symbol): New enum type.
233 (is_readonly_section): New function.
234 (eh_reloc): Likewise.
235 (Mips_got_entry::is_section_symbol_): New member.
236 (Mips_got_entry::is_section_symbol): New method.
237 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
239 (Mips_relobj::mips_elf_options_section_name): New method.
240 (Mips_output_data_got::record_local_got_symbol): Add
241 is_section_symbol argument, and pass it to
242 Mips_got_info::record_local_got_symbol.
243 (Mips_output_data_got::got_offset): Add addend argument, and pass
244 it to Relobj::local_got_offset.
245 (struct Mips_output_reloc_writer): New type.
246 (class Mips_output_data_reloc): New class.
247 (Mips_output_data_plt::Reloc_section): Change type to
248 Mips_output_data_reloc.
249 (Target_mips::Reloc_section): Likewise.
250 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
251 (Mips_classify_reloc::get_r_type2): New method.
252 (Mips_classify_reloc::get_r_type3): Likewise.
253 (Mips_classify_reloc::get_r_ssym): Likewise.
254 (Target_mips::Reloca_section): Remove.
255 (Relocate::should_apply_static_reloc): Rename from
256 should_apply_r_mips_32_reloc.
257 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
259 (Mips_relocate_functions::Valtype): New type.
260 (Mips_relocate_functions::Valtype64): New type.
261 (Mips_relocate_functions::check_overflow): New method.
262 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
264 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
265 (Mips_relocate_functions::rel16): Add support for resolving
266 relocations for Mips64.
267 (Mips_relocate_functions::rel32): Likewise.
268 (Mips_relocate_functions::reljalr): Likewise.
269 (Mips_relocate_functions::relpc32): Likewise.
270 (Mips_relocate_functions::rel26): Likewise.
271 (Mips_relocate_functions::relpc16): Likewise.
272 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
273 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
274 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
275 (Mips_relocate_functions::do_relhi16): Likewise.
276 (Mips_relocate_functions::do_relgot16_local): Likewise.
277 (Mips_relocate_functions::rello16): Likewise.
278 (Mips_relocate_functions::relgot): Likewise.
279 (Mips_relocate_functions::relgotpage): Likewise.
280 (Mips_relocate_functions::relgotofst): Likewise.
281 (Mips_relocate_functions::relgot_hi16): Likewise.
282 (Mips_relocate_functions::relgot_lo16): Likewise.
283 (Mips_relocate_functions::relgprel): Likewise.
284 (Mips_relocate_functions::relgprel32): Likewise.
285 (Mips_relocate_functions::tlsrelhi16): Likewise.
286 (Mips_relocate_functions::tlsrello16): Likewise.
287 (Mips_relocate_functions::tlsrel32): Likewise.
288 (Mips_relocate_functions::relsub): Likewise.
289 (Mips_relocate_functions::releh): New method.
290 (Mips_relocate_functions::rel64): Likewise.
291 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
292 pass it to Mips_got_entry.
293 (Mips_got_info::add_local_entries): Pass addend argument
294 to code functions, and for STT_SECTION symbols call
295 add_symbolless_local_addend.
296 (Mips_got_info::add_tls_entries): Pass addend argument to code
298 (Mips_relobj::do_read_symbols): Read gp value that was used to
300 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
301 instruction. Opcode for instruction will be selected later.
302 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
303 (Target_mips::scan_relocatable_relocs): Likewise.
304 (Target_mips::emit_relocs_scan): Likewise.
305 (Target_mips::relocate_relocs): Likewise.
306 (Target_mips::do_finalize_sections): Skip objects for merging
307 processor specific flags in which all input sections will be
309 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
310 (Target_mips::Scan::get_reference_flags): Likewise.
311 (Target_mips::relocate_special_relocatable): Call rel26 method with
312 calculate_only and calculated_value arguments.
313 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
314 dynamic relocation against a readonly sections, and pass
315 is_section_symbol to Mips_got_info::record_local_got_symbol.
316 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
317 dynamic relocation against a readonly sections, and pass r_type
318 and r_offset to Target_mips::copy_reloc.
319 (Target_mips::Relocate::relocate): Add support for resolving
320 relocations for Mips64.
321 (Target_mips::mips_info): Add case for Mips64 default dynamic
323 (Target_selector_mips): Correct emulation names.
325 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
327 * mips.cc (class Mips_output_data_la25_stub): Add
328 do_print_to_mapfile function.
330 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
332 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
335 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
337 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
338 * testsuite/plugin_layout_with_alignment.c: This.
339 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
340 (plugin_layout_with_alignment): Likewise.
341 * testsuite/Makefile.in: Regenerated.
343 2016-03-08 Cary Coutant <ccoutant@gmail.com>
346 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
348 * testsuite/Makefile.in: Regenerate.
349 * testsuite/dynamic_list.sh: Likewise.
350 * testsuite/retain_symbols_file_test.sh: Likewise.
352 2016-03-08 Cary Coutant <ccoutant@gmail.com>
355 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
356 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
358 2016-03-08 Cary Coutant <ccoutant@gmail.com>
359 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
361 * output.cc (Output_reloc_writer): New type.
362 (Output_data_reloc_base::do_write): Move implementation to template
363 in output.h and replace with invocation of template.
364 * output.h (Output_file): Move to top of file.
365 (Output_reloc::get_symbol_index): Move to public interface.
366 (Output_reloc::get_address): Likewise.
367 (Output_data_reloc_base::do_write_generic): New function template.
369 2016-03-04 Cary Coutant <ccoutant@gmail.com>
373 * symtab.cc: Instantiate Sized_symbol::init_constant and
374 Sized_symbol::init_undefined.
376 2016-03-03 Cary Coutant <ccoutant@gmail.com>
379 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
380 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
381 * mips.cc (Target_mips::make_symbol): Adjust function signature.
382 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
383 (Target_sparc::do_is_defined_by_abi): Remove test for
385 (Target_sparc::Register_symbol): New struct type.
386 (Target_sparc::register_syms_): New data member.
387 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
388 (Target_sparc::make_symbol): New function.
389 (Target_sparc::do_finalize_sections): Add register symbols and new
390 dynamic table entries.
391 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
392 (Symbol_table::add_target_global_symbol): New function.
393 (Symbol_table::target_symbols_): New data member.
394 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
395 (Symbol_table::Symbol_table): Initialize target_symbols_.
396 (Symbol_table::add_from_object): Pass additional parameters to
398 (Symbol_table::define_special_symbol): Likewise.
399 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
400 undefined symbol value.
401 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
402 (Symbol_table::sized_finalize): Likewise.
403 (Symbol_table::sized_write_globals): Likewise.
404 * target.h (Sized_target::make_symbol): Add name, st_type, object,
405 st_shndx, and value parameters.
407 2016-03-03 Rafael Ăvila de EspĂndola <rafael.espindola@gmail.com>
409 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
410 LDPK_WEAKUNDEF symbols.
412 2016-03-03 Than McIntosh <thanm@google.com>
414 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
415 and get_input_section_alignment in transfer vector.
416 (get_input_section_alignment): New function.
417 (get_input_section_size): New function.
418 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
419 * testsuite/Makefile.in: [Regenerate.]
420 * testsuite/plugin_section_alignment.cc: New test file.
421 * testsuite/plugin_layout_with_alignment.cc: New test file.
422 * testsuite/plugin_layout_with_alignment.sh: New test file.
424 2016-03-03 Evgenii Stepanov <eugenis@google.com>
426 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
428 * plugin.cc (get_symbols_v3): New function.
429 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
430 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
433 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
434 Cary Coutant <ccoutant@gmail.com>
437 * ehframe.h (Cie::fde_encoding): New method.
438 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
441 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
443 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
444 -mrelax-relocations=yes to $(TEST_AS).
445 (x86_64_mov_to_lea6.o): Likewise.
446 (x86_64_overflow_pc32.o): Remove duplicated target.
447 * testsuite/Makefile.in: Regenerated.
449 2016-02-15 Marcin KoĆcielnicki <koriakin@0x04.net>
451 * s390.cc (Target_s390::match_view_u): New helper method.
452 (Target_s390::do_is_call_to_non_split): New method.
453 (Target_s390::ss_code_st_r14): New const.
454 (Target_s390::ss_code_l_r14): New const.
455 (Target_s390::ss_code_bras_8): New const.
456 (Target_s390::ss_code_l_basr): New const.
457 (Target_s390::ss_code_a_basr): New const.
458 (Target_s390::ss_code_ear): New const.
459 (Target_s390::ss_code_c): New const.
460 (Target_s390::ss_code_larl): New const.
461 (Target_s390::ss_code_brasl): New const.
462 (Target_s390::ss_code_jg): New const.
463 (Target_s390::ss_code_jgl): New const.
464 (Target_s390::ss_match_mcount): New helper method.
465 (Target_s390::ss_match_l): New helper method.
466 (Target_s390::ss_match_ahi): New helper method.
467 (Target_s390::ss_match_alfi): New helper method.
468 (Target_s390::ss_match_cr): New helper method.
469 (Target_s390::do_calls_non_split): New method.
470 * testsuite/Makefile.am: Added new tests.
471 * testsuite/Makefile.in: Regenerate.
472 * testsuite/split_s390.sh: New test.
473 * testsuite/split_s390_1_a1.s: New test.
474 * testsuite/split_s390_1_a2.s: New test.
475 * testsuite/split_s390_1_n1.s: New test.
476 * testsuite/split_s390_1_n2.s: New test.
477 * testsuite/split_s390_1_z1.s: New test.
478 * testsuite/split_s390_1_z2.s: New test.
479 * testsuite/split_s390_1_z3.s: New test.
480 * testsuite/split_s390_1_z4.s: New test.
481 * testsuite/split_s390_2_ns.s: New test.
482 * testsuite/split_s390_2_s.s: New test.
483 * testsuite/split_s390x_1_a1.s: New test.
484 * testsuite/split_s390x_1_a2.s: New test.
485 * testsuite/split_s390x_1_n1.s: New test.
486 * testsuite/split_s390x_1_n2.s: New test.
487 * testsuite/split_s390x_1_z1.s: New test.
488 * testsuite/split_s390x_1_z2.s: New test.
489 * testsuite/split_s390x_1_z3.s: New test.
490 * testsuite/split_s390x_1_z4.s: New test.
491 * testsuite/split_s390x_2_ns.s: New test.
492 * testsuite/split_s390x_2_s.s: New test.
494 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
496 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
497 info message for every erratum 843419 found and fixed.
499 2016-02-07 Cary Coutant <ccoutant@gmail.com>
502 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
503 information to relocation overflow errors.
505 2016-02-06 Cary Coutant <ccoutant@gmail.com>
508 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
509 overflow checking when symbol value + addend < 0.
511 2016-02-06 Cary Coutant <ccoutant@gmail.com>
514 * reloc.h (Limits): New class.
515 (Bits::has_overflow32): Use min/max values from Limits.
516 (Bits::has_unsigned_overflow32): Likewise.
517 (Bits::has_signed_unsigned_overflow32): Likewise.
518 (Bits::has_overflow): Likewise.
519 (Bits::has_unsigned_overflow): Likewise.
520 (Bits::has_signed_unsigned_overflow64): Likewise.
522 2016-02-06 Cary Coutant <ccoutant@gmail.com>
525 * reloc.h (Relocate_functions::Overflow_check): Add comments.
526 * x86_64.cc (X86_64_relocate_functions): New class.
527 (Target_x86_64::Relocate::relocate): Use the new class.
528 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
529 (x32_overflow_pc32): New test case.
530 * testsuite/Makefile.in: Regenerate.
531 * testsuite/x32_overflow_pc32.sh: New script.
532 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
534 2016-02-06 Cary Coutant <ccoutant@gmail.com>
537 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
538 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
540 2016-02-06 Cary Coutant <ccoutant@gmail.com>
543 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
545 (Bits::has_unsigned_overflow): Likewise.
547 2016-02-06 Marcin KoĆcielnicki <koriakin@0x04.net>
549 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
551 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
552 and view_size to is_call_to_non_split.
553 * target.cc (Target::is_call_to_non_split): Add view and view_size
555 * target.h (class Target): Likewise.
557 2016-02-05 Sriraman Tallam <tmsriram@google.com>
559 * icf.cc (get_rel_addend): New function.
560 (get_section_contents): Move merge section addend computation to a
561 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
562 Fix bug to not read past the length of the section.
564 2016-02-05 Cary Coutant <ccoutant@gmail.com>
565 Andrew Senkevich <andrew.senkevich@intel.com>
568 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
569 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
571 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
572 * testsuite/x86_64_overflow_pc32.sh: New test script.
573 * testsuite/x86_64_overflow_pc32.s: New source file.
575 2016-02-05 Cary Coutant <ccoutant@gmail.com>
578 * reloc.h (Relocate_functions::Address): New typedef.
579 (Relocate_functions::Addendtype): New typedef.
580 (Relocate_functions::Overflow_check): New enum type.
581 (Relocate_functions::Reloc_status): New enum type.
582 (Relocate_functions::check_overflow): New function template.
583 (Relocate_functions::rel): Add check parameter; check for overflow.
584 (Relocate_functions::rel_unaligned): Likewise.
585 (Relocate_functions::rela): Likewise.
586 (Relocate_functions::pcrel): Likewise.
587 (Relocate_functions::pcrel_unaligned): Likewise.
588 (Relocate_functions::pcrela): Likewise.
589 (Relocate_functions::rel8): Adjust parameter types.
590 (Relocate_functions::rela8): Likewise.
591 (Relocate_functions::pcrel8): Likewise.
592 (Relocate_functions::pcrela8): Likewise.
593 (Relocate_functions::rel16): Likewise.
594 (Relocate_functions::rela168): Likewise.
595 (Relocate_functions::pcrel16): Likewise.
596 (Relocate_functions::pcrela16): Likewise.
597 (Relocate_functions::rel32): Likewise.
598 (Relocate_functions::rel32_unaligned): Likewise.
599 (Relocate_functions::rela32): Likewise.
600 (Relocate_functions::pcrel32): Likewise.
601 (Relocate_functions::pcrel32_unaligned): Likewise.
602 (Relocate_functions::pcrela32): Likewise.
603 (Relocate_functions::rel8_check): New function.
604 (Relocate_functions::rela8_check): New function.
605 (Relocate_functions::pcrel8_check): New function.
606 (Relocate_functions::pcrela8_check): New function.
607 (Relocate_functions::rel16_check): New function.
608 (Relocate_functions::rela168_check): New function.
609 (Relocate_functions::pcrel16_check): New function.
610 (Relocate_functions::pcrela16_check): New function.
611 (Relocate_functions::rel32_check): New function.
612 (Relocate_functions::rel32_unaligned_check): New function.
613 (Relocate_functions::rela32_check): New function.
614 (Relocate_functions::pcrel32_check): New function.
615 (Relocate_functions::pcrel32_unaligned_check): New function.
616 (Relocate_functions::pcrela32_check): New function.
617 (Bits::has_unsigned_overflow32): New function.
618 (Bits::has_unsigned_overflow): New function.
619 * testsuite/Makefile.am (overflow_unittest): New test.
620 * testsuite/Makefile.in: Regenerate.
621 * testsuite/overflow_unittest.cc: New source file.
623 2016-02-04 Alan Modra <amodra@gmail.com>
625 * powerpc.cc (relocate): Adjust last patch for big-endian.
627 2016-02-02 Alan Modra <amodra@gmail.com>
629 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
631 2016-01-15 Han Shen <shenhan@google.com>
633 PR gold/19472 - need pc-relative stubs.
635 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
636 stub type for DSOs and pie executables.
638 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
640 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
643 2016-01-12 Cary Coutant <ccoutant@gmail.com>
645 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
646 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
647 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
648 specializations) New method.
650 2016-01-11 Cary Coutant <ccoutant@gmail.com>
653 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
654 we have a TLS segment for GD-to-IE optimization.
655 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
657 (Target_i386::tls_desc_gd_to_ie): Likewise.
658 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
659 for TLSDESC GD-to-IE optimizations.
660 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
662 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
663 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
664 for TLSDESC GD-to-IE optimizations.
666 2016-01-11 Cary Coutant <ccoutant@gmail.com>
668 Refactor gold to enable support for MIPS-64 relocation format.
670 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
671 (gc_process_relocs): Remove sh_type template parameter.
672 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
673 * object.h (Sized_relobj_file::split_stack_adjust): Add target
675 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
676 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
677 specializations) Remove.
678 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
679 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
680 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
681 (Sized_relobj_file::split_stack_adjust): Add target parameter.
683 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
684 Target::get_r_sym() to get r_sym field from relocations.
685 (Track_relocs::next_symndx): Call Target::get_r_sym().
686 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
687 add Classify_reloc template parameter. Use for accessing r_sym and
689 (relocate_section): Likewise.
690 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
691 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
692 (Default_scan_relocatable_relocs::Reltype): New typedef.
693 (Default_scan_relocatable_relocs::reloc_size): New const.
694 (Default_scan_relocatable_relocs::sh_type): New const.
695 (Default_scan_relocatable_relocs::get_r_sym): New method.
696 (Default_scan_relocatable_relocs::get_r_type): New method.
697 (Default_emit_relocs_strategy): New class.
698 (scan_relocatable_relocs): Replace sh_type template parameter with
699 Scan_relocatable_relocs class. Use it to access r_sym and r_type
701 (relocate_relocs): Replace sh_type template parameter with
702 Classify_reloc class. Use it to access r_sym and r_type fields.
703 * target.h (Target::is_call_to_non_split): Replace r_type parameter
704 with pointer to relocation. Adjust all callers.
705 (Target::do_is_call_to_non_split): Likewise.
706 (Target::emit_relocs_scan): New virtual method.
707 (Sized_target::get_r_sym): New virtual method.
708 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
709 with pointer to relocation.
711 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
712 (Target_aarch64::Relocatable_size_for_reloc): Remove.
713 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
714 (Target_aarch64::scan_relocs): Likewise.
715 (Target_aarch64::relocate_section): Likewise.
716 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
718 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
719 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
720 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
722 (Target_arm::emit_relocs_scan): New method.
723 (Target_arm::Relocatable_size_for_reloc): Replace with...
724 (Target_arm::Classify_reloc): ...this.
725 (Target_arm::gc_process_relocs): Use Classify_reloc.
726 (Target_arm::scan_relocs): Likewise.
727 (Target_arm::relocate_section): Likewise.
728 (Target_arm::scan_relocatable_relocs): Likewise.
729 (Target_arm::relocate_relocs): Likewise.
730 * i386.cc (Target_i386::emit_relocs_scan): New method.
731 (Target_i386::Relocatable_size_for_reloc): Replace with...
732 (Target_i386::Classify_reloc): ...this.
733 (Target_i386::gc_process_relocs): Use Classify_reloc.
734 (Target_i386::scan_relocs): Likewise.
735 (Target_i386::relocate_section): Likewise.
736 (Target_i386::scan_relocatable_relocs): Likewise.
737 (Target_i386::relocate_relocs): Likewise.
738 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
740 (Mips_reloc_types): New class template.
741 (Mips_classify_reloc): New class template.
742 (Target_mips::Reltype): New typedef.
743 (Target_mips::Relatype): New typedef.
744 (Target_mips::emit_relocs_scan): New method.
745 (Target_mips::get_r_sym): New method.
746 (Target_mips::Relocatable_size_for_reloc): Replace with
748 (Target_mips::copy_reloc): Use Mips_classify_reloc.
749 (Target_mips::gc_process_relocs): Likewise.
750 (Target_mips::scan_relocs): Likewise.
751 (Target_mips::relocate_section): Likewise.
752 (Target_mips::scan_relocatable_relocs): Likewise.
753 (Target_mips::relocate_relocs): Likewise.
754 (mips_get_size_for_reloc): New function, factored out from
755 Relocatable_size_for_reloc::get_size_for_reloc.
756 (Target_mips::Scan::local): Use Mips_classify_reloc.
757 (Target_mips::Scan::global): Likewise.
758 (Target_mips::Relocate::relocate): Likewise.
759 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
760 (Target_powerpc::Relocatable_size_for_reloc): Remove.
761 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
762 (Target_powerpc::scan_relocs): Likewise.
763 (Target_powerpc::relocate_section): Likewise.
764 (Powerpc_scan_relocatable_reloc): Convert to class template.
765 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
766 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
767 (Powerpc_scan_relocatable_reloc::sh_type): New const.
768 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
769 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
770 (Target_powerpc::scan_relocatable_relocs): Use
771 Powerpc_scan_relocatable_reloc.
772 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
773 * s390.cc (Target_s390::emit_relocs_scan): New method.
774 (Target_s390::Relocatable_size_for_reloc): Remove.
775 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
776 (Target_s390::scan_relocs): Likewise.
777 (Target_s390::relocate_section): Likewise.
778 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
780 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
781 (Target_s390::relocate_relocs): Use Default_classify_reloc.
782 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
783 (Target_sparc::Relocatable_size_for_reloc): Remove.
784 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
785 (Target_sparc::scan_relocs): Likewise.
786 (Target_sparc::relocate_section): Likewise.
787 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
789 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
790 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
791 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
792 (Target_tilegx::Relocatable_size_for_reloc): Remove.
793 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
794 (Target_tilegx::scan_relocs): Likewise.
795 (Target_tilegx::relocate_section): Likewise.
796 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
798 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
799 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
800 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
801 (Target_x86_64::Relocatable_size_for_reloc): Remove.
802 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
803 (Target_x86_64::scan_relocs): Likewise.
804 (Target_x86_64::relocate_section): Likewise.
805 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
807 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
808 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
810 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
812 2016-01-01 Alan Modra <amodra@gmail.com>
814 Update year range in copyright notice of all files.
816 For older changes see ChangeLog-0815
818 Copyright (C) 2016 Free Software Foundation, Inc.
820 Copying and distribution of this file, with or without modification,
821 are permitted in any medium without royalty provided the copyright
822 notice and this notice are preserved.
828 version-control: never