1 2016-06-29 Alan Modra <amodra@gmail.com>
3 * script_test_12.t: Delete .plt, specify 64k page size.
4 * script_test_12i.t: Likewise.
6 2016-06-29 Alan Modra <amodra@gmail.com>
8 * testsuite/plugin_layout_with_alignment.c: Explicitly align all
11 2016-06-29 Alan Modra <amodra@gmail.com>
13 * testsuite/Makefile.am (copy_test_protected): Disable for powerpc.
14 * testsuite/Makefile.in: Regenerate.
16 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
18 * aarch64-reloc.def (NONE): New relocation.
19 * aarch64.cc (Target_aarch64::Scan::local): Handle R_AARCH64_NONE.
20 (Target_aarch64::Scan::global): Likewise.
21 * testsuite/Makefile.am (aarch64_reloc_none): New test.
22 * testsuite/Makefile.in: Regenerate.
23 * testsuite/aarch64_reloc_none.s: New test source file.
24 * testsuite/aarch64_reloc_none.sh: New test script.
26 2016-06-28 Sriraman Tallam <tmsriram@google.com>
28 * x86_64.cc (Lazy_view): New class.
29 (can_convert_mov_to_lea): Templatize function. Make the function
30 check for appropriate relocation types and use the view parameter
31 to get section contents.
32 (can_convert_callq_to_direct): New function.
33 (Target_x86_64<size>::Scan::global): Refactor.
34 (Target_x86_64<size>::Relocate::relocate): Refactor. Change any indirect
35 call via GOT that can be converted.
36 * testsuite/Makefile.am (x86_64_indirect_call_to_direct.sh): New test.
37 * testsuite/Makefile.in: Regenerate.
38 * testsuite/x86_64_indirect_call_to_direct1.s: New file.
39 * testsuite/x86_64_indirect_jump_to_direct1.s: New file.
41 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
43 * aarch64.cc (Target_aarch64::Scan::local): Move the call to got_section
44 from the top level to the places of its use.
46 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
49 * script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
50 * script-sections.cc (Input_section_sorter::get_init_priority): New method.
51 (Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
52 (Output_section_element_input::print): Likewise.
53 * script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
54 * yyscript.y (SORT_BY_INIT_PRIORITY): New token.
55 (wildcard_section): Handle SORT_BY_INIT_PRIORITY.
57 * testsuite/Makefile.am (script_test_14): New test.
58 * testsuite/Makefile.in: Regenerate.
59 * testsuite/script_test_14.s: New test source file.
60 * testsuite/script_test_14.sh: New test script.
61 * testsuite/script_test_14.t: New test linker script.
63 2016-06-28 James Clarke <jrtc27@jrtc27.com>
65 * sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
66 to R_SPARC_RELATIVE if class is ELFCLASS64.
67 (Target_sparc::Scan::global): Likewise.
69 2016-06-23 Cary Coutant <ccoutant@gmail.com>
70 Igor Kudrin <ikudrin@accesssoftek.com>
74 (Output_section_element_input::set_section_addresses): Keep bin_count
75 separate from input_pattern_count.
76 * testsuite/script_test_12.t: Add another section .x4.
77 * testsuite/script_test_12i.t: Likewise.
78 * testsuite/script_test_12a.c: Likewise.
79 * testsuite/script_test_12b.c: Likewise.
81 2016-06-23 Igor Kudrin <ikudrin@accesssoftek.com>
83 * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
85 2016-06-22 H.J. Lu <hongjiu.lu@intel.com>
88 * NEWS: Mention --enable-relro.
89 * configure.ac: Add --enable-relro.
90 (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
92 * config.in: Regenerated.
93 * configure: Likewise.
94 * options.h (General_options::relro): Default to
97 2016-06-20 Cary Coutant <ccoutant@gmail.com>
99 * NEWS: Add new features in 1.12.
100 * version.cc (version_string): Bump to 1.12.
102 2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
105 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if
107 (Target_i386::plt_entry_size): Likewise.
108 (Target_x86_64<size>::first_plt_entry_offset): Likewise.
109 (Target_x86_64<size>::plt_entry_size): Likewise.
111 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
113 * mips.cc (Target_mips::Target_mips): Initialize rld_map_.
114 (Target_mips::rld_map_): New data member.
115 (Target_mips::do_finalize_sections): Add support for
116 DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
117 .rld_map section, and __RLD_MAP symbol.
118 (Target_mips::do_dynamic_tag_custom_value): Add support for
119 DT_MIPS_RLD_MAP_REL dynamic tag.
120 * output.cc (Output_data_dynamic::get_entry_offset): New method
122 * output.h (Output_data_dynamic::get_entry_offset): New method
125 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
127 * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
129 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
131 * mips.cc (relocation_needs_la25_stub): Add support for relocs:
132 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
133 (hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
134 (is_matching_lo16_reloc): Likewise.
135 (lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
136 (Mips_output_data_plt::plt_entry_r6): New static data member for
138 (Target_mips::is_output_r6): New method.
139 (Target_mips::Mips_mach): Add new enum constants.
140 (Mips_relocate_functions::Status): Likewise.
141 (Mips_relocate_functions::pchi16_relocs): New static data member.
142 (Mips_relocate_functions::relpc21): New method.
143 (Mips_relocate_functions::relpc26): Likewise.
144 (Mips_relocate_functions::relpc18): Likewise.
145 (Mips_relocate_functions::relpc19): Likewise.
146 (Mips_relocate_functions::relpchi16): Likewise.
147 (Mips_relocate_functions::do_relpchi16): Likewise.
148 (Mips_relocate_functions::relpclo16): Likewise.
149 (Mips_output_data_plt::do_write): Add support for Mips r6 plt
151 (Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
152 (Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
153 E_MIPS_ARCH_64R6 support.
154 (Target_mips::update_abiflags_isa): Likewise.
155 (mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
156 R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
158 (Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
160 (Target_mips::Scan::global): Add support for relocs:
161 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
162 (Target_mips::Relocate::relocate): Call functions for resolving
163 Mips32r6 and Mips64r6 relocations, and print error message for
164 STATUS_PCREL_UNALIGNED.
165 (Target_mips::Scan::get_reference_flags): Add support for relocs:
166 R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
167 R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
168 (Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
169 E_MIPS_ARCH_64R6 support.
171 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
174 * testsuite/script_test_2.t: Add .got.plt after .got.
176 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
178 * mips.cc (struct Mips_abiflags): New struct.
179 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
181 (Mips_relobj::~Mips_relobj): Delete object pointed by
182 attributes_section_data_.
183 (Mips_relobj::abiflags): New method.
184 (Mips_relobj::attributes_section_data): Likewise.
185 (Mips_relobj::attributes_section_data_): New data member.
186 (Mips_relobj::abiflags_): Likewise.
187 (class Mips_output_section_abiflags): New class.
188 (Target_mips::Target_mips): Initialize attributes_section_data_,
189 abiflags_ and has_abiflags_section_.
190 (Target_mips::do_should_include_section): Don't emit input
191 .MIPS.abiflags sections to output .MIPS.abiflags.
192 (Target_mips::Mips_mach): Add new enum constants.
193 (Target_mips::mips_isa_ext_mach): New method.
194 (Target_mips::mips_isa_ext): Likewise.
195 (Target_mips::update_abiflags_isa): Likewise.
196 (Target_mips::infer_abiflags): Likewise.
197 (Target_mips::create_abiflags): Likewise.
198 (Target_mips::fp_abi_string): Likewise.
199 (Target_mips::select_fp_abi): Likewise.
200 (Target_mips::merge_obj_attributes): Likewise.
201 (Target_mips::merge_obj_abiflags): Likewise.
202 (Target_mips::level_rev): Likewise.
203 (Target_mips::merge_obj_e_flags): Rename from
204 merge_processor_specific_flags. Remove dyn_obj argument,
205 call update_abiflags_isa when needed, compare NaN encodings and
207 (Target_mips::add_machine_extensions): Add two machine extensions
209 (Target_mips::attributes_section_data_): New data member.
210 (Target_mips::abiflags_): Likewise.
211 (Target_mips::has_abiflags_section_): Likewise.
212 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
213 .MIPS.abiflags sections if they exists.
214 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
215 E_MIPS_MACH_OCTEON3 support.
216 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
217 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
218 .MIPS.abiflags sections from input. Create these sections if
220 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
221 E_MIPS_MACH_OCTEON3 support, and change strings for
222 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
225 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
227 * mips.cc (Mips_relobj::Mips_relobj): Initialize
228 has_reginfo_section_.
229 (Mips_relobj::has_reginfo_section_): New data member.
230 (Mips_relobj::has_reginfo_section): New method.
231 (class Mips_output_section_reginfo): Change base class to
232 Output_section_data, and set masks of the output .reginfo section
234 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
236 (Mips_output_section_reginfo::set_masks): Likewise.
237 (Mips_output_section_reginfo::set_final_data_size): Likewise.
238 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
239 (Target_mips::do_make_output_section): Remove.
240 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
241 if the object contains a .reginfo section.
242 (Target_mips::do_finalize_sections): Create a .reginfo output
245 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
247 * mips.cc (Mips_output_data_got::do_write): Add missing template
250 2016-05-30 Marcin Kościelnicki <koriakin@0x04.net>
253 * s390.cc (Target_s390::ss_code_st_r14): Removed.
254 (Target_s390::ss_code_l_r14): Removed.
255 (Target_s390::ss_code_ear): Removed.
256 (Target_s390::ss_code_c): Removed.
257 (Target_s390::ss_match_st_r14): New function.
258 (Target_s390::ss_match_l_r14): New function.
259 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
260 of matching code directly.
261 (Target_s390::ss_match_ear): New function.
262 (Target_s390::ss_match_c): New function.
263 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
264 of matching code directly.
266 2016-05-19 Cary Coutant <ccoutant@gmail.com>
269 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
270 parameter; check for protected symbol.
271 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
272 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
273 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
274 (Symbol_table::add_from_dynobj): Mark protected symbols.
275 * symtab.h (Symbol::is_protected): New method.
276 (Symbol::set_is_protected): New method.
277 (Symbol::is_protected_): New data member.
279 * testsuite/Makefile.am (copy_test_protected): New test.
280 * testsuite/Makefile.in: Regenerate.
281 * testsuite/copy_test.cc (main): Add legal reference to protected
283 * testsuite/copy_test_v1.cc (main): Likewise.
284 * testsuite/copy_test_2.cc (ip): Add protected symbol.
285 * testsuite/copy_test_protected.cc: New test source file.
286 * testsuite/copy_test_protected.sh: New test script.
288 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
290 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
291 for global got symbols, and set addend to 0.
292 (Mips_got_entry::hash): Change hash algorithm.
293 (Mips_got_entry::equals): Refactor.
294 (Mips_got_entry::object): Return input object for local got symbols
296 (Mips_got_entry::addend): Change return of the relocation addend.
297 (Mips_got_entry::addend_): Move from union d.
298 (Mips_got_entry::object_): Move into union d.
299 (class Mips_symbol_hash): New class.
300 (Mips_got_info::Global_got_entry_set): New type.
301 (Mips_got_info::global_got_symbols): Change return type to
302 Global_got_entry_set.
303 (Mips_got_info::global_got_symbols_): Change type to
304 Global_got_entry_set.
305 (Mips_symbol::hash): New method.
306 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
307 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
308 (Mips_output_data_mips_stubs::symbols_): Change type to
309 Mips_stubs_entry_set.
310 (Mips_got_info::record_global_got_symbol): Don't pass object
311 argument when creating global got symbol.
312 (Mips_got_info::record_got_entry): Remove find before inserting
314 (Mips_got_info::add_reloc_only_entries): Change type of iterator
315 to Global_got_entry_set.
316 (Mips_got_info::count_got_symbols): Likewise.
317 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
318 for adding entries to symbols_.
319 (Mips_output_data_la25_stub::do_write): Change type of iterator
321 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
322 of iterator to Mips_stubs_entry_set.
323 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
324 (Mips_output_data_mips_stubs::do_write): Likewise.
326 2016-05-06 Han Shen <shenhan@google.com>
330 * aarch64-reloc.def: New relocation type.
331 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
332 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
333 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
334 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
336 2016-04-28 Nick Clifton <nickc@redhat.com>
338 * po/zh_CN.po: Updated Chinese (simplified) translation.
340 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
342 * Makefile.in: Regenerated with automake 1.11.6.
343 * aclocal.m4: Likewise.
344 * testsuite/Makefile.in: Likewise.
346 2016-03-30 Cary Coutant <ccoutant@gmail.com>
349 * symtab.cc (Symbol_table::define_default_version): Check for case
350 where symbols are both in different shared objects.
352 2016-03-27 Cary Coutant <ccoutant@gmail.com>
355 * i386.cc (Target_i386): Add check for fully-resolved symbol for
358 2016-03-22 Nick Clifton <nickc@redhat.com>
360 * configure: Regenerate.
362 2016-03-21 Cary Coutant <ccoutant@gmail.com>
365 * errors.cc (Errors::undefined_symbol): Add info message when
366 symbol should have been provided by a plugin.
367 * target-reloc.h (issue_undefined_symbol_error): Check for
368 placeholder symbols defined in discarded sections.
369 * testsuite/Makefile.am (plugin_test_9b): New test case.
370 * testsuite/Makefile.in: Regenerate.
371 * testsuite/plugin_test_9b_elf.cc: New test source file.
372 * testsuite/plugin_test_9b_ir.cc: New test source file.
374 2016-03-20 Cary Coutant <ccoutant@gmail.com>
377 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
378 * testsuite/Makefile.am (eh_test_2): New test.
379 * testsuite/Makefile.in: Regenerate.
380 * testsuite/eh_test_2.sh: New test script.
381 * testsuite/eh_test_a.cc (bar): Make it comdat.
382 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
384 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
386 * mips.cc (Mips_relobj::is_n64_): Remove.
387 (Target_mips::ei_class_): Likewise.
388 (Mips_relobj::is_newabi): Call methods.
389 (Mips_relobj::is_n64): Change checking for N64 ABI.
390 (Target_mips::is_output_n64): Likewise.
391 (Target_mips::merge_processor_specific_flags): Remove ei_class
392 argument, and remove comparing ei_class.
393 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
395 (Target_mips::do_finalize_sections): Don't pass ei_class argument
396 to merge_processor_specific_flags.
397 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
398 change checking for N64 ABI.
400 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
402 * mips.cc (enum Special_relocation_symbol): New enum type.
403 (is_readonly_section): New function.
404 (eh_reloc): Likewise.
405 (Mips_got_entry::is_section_symbol_): New member.
406 (Mips_got_entry::is_section_symbol): New method.
407 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
409 (Mips_relobj::mips_elf_options_section_name): New method.
410 (Mips_output_data_got::record_local_got_symbol): Add
411 is_section_symbol argument, and pass it to
412 Mips_got_info::record_local_got_symbol.
413 (Mips_output_data_got::got_offset): Add addend argument, and pass
414 it to Relobj::local_got_offset.
415 (struct Mips_output_reloc_writer): New type.
416 (class Mips_output_data_reloc): New class.
417 (Mips_output_data_plt::Reloc_section): Change type to
418 Mips_output_data_reloc.
419 (Target_mips::Reloc_section): Likewise.
420 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
421 (Mips_classify_reloc::get_r_type2): New method.
422 (Mips_classify_reloc::get_r_type3): Likewise.
423 (Mips_classify_reloc::get_r_ssym): Likewise.
424 (Target_mips::Reloca_section): Remove.
425 (Relocate::should_apply_static_reloc): Rename from
426 should_apply_r_mips_32_reloc.
427 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
429 (Mips_relocate_functions::Valtype): New type.
430 (Mips_relocate_functions::Valtype64): New type.
431 (Mips_relocate_functions::check_overflow): New method.
432 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
434 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
435 (Mips_relocate_functions::rel16): Add support for resolving
436 relocations for Mips64.
437 (Mips_relocate_functions::rel32): Likewise.
438 (Mips_relocate_functions::reljalr): Likewise.
439 (Mips_relocate_functions::relpc32): Likewise.
440 (Mips_relocate_functions::rel26): Likewise.
441 (Mips_relocate_functions::relpc16): Likewise.
442 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
443 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
444 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
445 (Mips_relocate_functions::do_relhi16): Likewise.
446 (Mips_relocate_functions::do_relgot16_local): Likewise.
447 (Mips_relocate_functions::rello16): Likewise.
448 (Mips_relocate_functions::relgot): Likewise.
449 (Mips_relocate_functions::relgotpage): Likewise.
450 (Mips_relocate_functions::relgotofst): Likewise.
451 (Mips_relocate_functions::relgot_hi16): Likewise.
452 (Mips_relocate_functions::relgot_lo16): Likewise.
453 (Mips_relocate_functions::relgprel): Likewise.
454 (Mips_relocate_functions::relgprel32): Likewise.
455 (Mips_relocate_functions::tlsrelhi16): Likewise.
456 (Mips_relocate_functions::tlsrello16): Likewise.
457 (Mips_relocate_functions::tlsrel32): Likewise.
458 (Mips_relocate_functions::relsub): Likewise.
459 (Mips_relocate_functions::releh): New method.
460 (Mips_relocate_functions::rel64): Likewise.
461 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
462 pass it to Mips_got_entry.
463 (Mips_got_info::add_local_entries): Pass addend argument
464 to code functions, and for STT_SECTION symbols call
465 add_symbolless_local_addend.
466 (Mips_got_info::add_tls_entries): Pass addend argument to code
468 (Mips_relobj::do_read_symbols): Read gp value that was used to
470 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
471 instruction. Opcode for instruction will be selected later.
472 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
473 (Target_mips::scan_relocatable_relocs): Likewise.
474 (Target_mips::emit_relocs_scan): Likewise.
475 (Target_mips::relocate_relocs): Likewise.
476 (Target_mips::do_finalize_sections): Skip objects for merging
477 processor specific flags in which all input sections will be
479 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
480 (Target_mips::Scan::get_reference_flags): Likewise.
481 (Target_mips::relocate_special_relocatable): Call rel26 method with
482 calculate_only and calculated_value arguments.
483 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
484 dynamic relocation against a readonly sections, and pass
485 is_section_symbol to Mips_got_info::record_local_got_symbol.
486 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
487 dynamic relocation against a readonly sections, and pass r_type
488 and r_offset to Target_mips::copy_reloc.
489 (Target_mips::Relocate::relocate): Add support for resolving
490 relocations for Mips64.
491 (Target_mips::mips_info): Add case for Mips64 default dynamic
493 (Target_selector_mips): Correct emulation names.
495 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
497 * mips.cc (class Mips_output_data_la25_stub): Add
498 do_print_to_mapfile function.
500 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
502 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
505 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
507 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
508 * testsuite/plugin_layout_with_alignment.c: This.
509 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
510 (plugin_layout_with_alignment): Likewise.
511 * testsuite/Makefile.in: Regenerated.
513 2016-03-08 Cary Coutant <ccoutant@gmail.com>
516 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
518 * testsuite/Makefile.in: Regenerate.
519 * testsuite/dynamic_list.sh: Likewise.
520 * testsuite/retain_symbols_file_test.sh: Likewise.
522 2016-03-08 Cary Coutant <ccoutant@gmail.com>
525 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
526 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
528 2016-03-08 Cary Coutant <ccoutant@gmail.com>
529 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
531 * output.cc (Output_reloc_writer): New type.
532 (Output_data_reloc_base::do_write): Move implementation to template
533 in output.h and replace with invocation of template.
534 * output.h (Output_file): Move to top of file.
535 (Output_reloc::get_symbol_index): Move to public interface.
536 (Output_reloc::get_address): Likewise.
537 (Output_data_reloc_base::do_write_generic): New function template.
539 2016-03-04 Cary Coutant <ccoutant@gmail.com>
543 * symtab.cc: Instantiate Sized_symbol::init_constant and
544 Sized_symbol::init_undefined.
546 2016-03-03 Cary Coutant <ccoutant@gmail.com>
549 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
550 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
551 * mips.cc (Target_mips::make_symbol): Adjust function signature.
552 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
553 (Target_sparc::do_is_defined_by_abi): Remove test for
555 (Target_sparc::Register_symbol): New struct type.
556 (Target_sparc::register_syms_): New data member.
557 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
558 (Target_sparc::make_symbol): New function.
559 (Target_sparc::do_finalize_sections): Add register symbols and new
560 dynamic table entries.
561 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
562 (Symbol_table::add_target_global_symbol): New function.
563 (Symbol_table::target_symbols_): New data member.
564 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
565 (Symbol_table::Symbol_table): Initialize target_symbols_.
566 (Symbol_table::add_from_object): Pass additional parameters to
568 (Symbol_table::define_special_symbol): Likewise.
569 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
570 undefined symbol value.
571 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
572 (Symbol_table::sized_finalize): Likewise.
573 (Symbol_table::sized_write_globals): Likewise.
574 * target.h (Sized_target::make_symbol): Add name, st_type, object,
575 st_shndx, and value parameters.
577 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
579 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
580 LDPK_WEAKUNDEF symbols.
582 2016-03-03 Than McIntosh <thanm@google.com>
584 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
585 and get_input_section_alignment in transfer vector.
586 (get_input_section_alignment): New function.
587 (get_input_section_size): New function.
588 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
589 * testsuite/Makefile.in: [Regenerate.]
590 * testsuite/plugin_section_alignment.cc: New test file.
591 * testsuite/plugin_layout_with_alignment.cc: New test file.
592 * testsuite/plugin_layout_with_alignment.sh: New test file.
594 2016-03-03 Evgenii Stepanov <eugenis@google.com>
596 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
598 * plugin.cc (get_symbols_v3): New function.
599 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
600 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
603 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
604 Cary Coutant <ccoutant@gmail.com>
607 * ehframe.h (Cie::fde_encoding): New method.
608 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
611 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
613 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
614 -mrelax-relocations=yes to $(TEST_AS).
615 (x86_64_mov_to_lea6.o): Likewise.
616 (x86_64_overflow_pc32.o): Remove duplicated target.
617 * testsuite/Makefile.in: Regenerated.
619 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
621 * s390.cc (Target_s390::match_view_u): New helper method.
622 (Target_s390::do_is_call_to_non_split): New method.
623 (Target_s390::ss_code_st_r14): New const.
624 (Target_s390::ss_code_l_r14): New const.
625 (Target_s390::ss_code_bras_8): New const.
626 (Target_s390::ss_code_l_basr): New const.
627 (Target_s390::ss_code_a_basr): New const.
628 (Target_s390::ss_code_ear): New const.
629 (Target_s390::ss_code_c): New const.
630 (Target_s390::ss_code_larl): New const.
631 (Target_s390::ss_code_brasl): New const.
632 (Target_s390::ss_code_jg): New const.
633 (Target_s390::ss_code_jgl): New const.
634 (Target_s390::ss_match_mcount): New helper method.
635 (Target_s390::ss_match_l): New helper method.
636 (Target_s390::ss_match_ahi): New helper method.
637 (Target_s390::ss_match_alfi): New helper method.
638 (Target_s390::ss_match_cr): New helper method.
639 (Target_s390::do_calls_non_split): New method.
640 * testsuite/Makefile.am: Added new tests.
641 * testsuite/Makefile.in: Regenerate.
642 * testsuite/split_s390.sh: New test.
643 * testsuite/split_s390_1_a1.s: New test.
644 * testsuite/split_s390_1_a2.s: New test.
645 * testsuite/split_s390_1_n1.s: New test.
646 * testsuite/split_s390_1_n2.s: New test.
647 * testsuite/split_s390_1_z1.s: New test.
648 * testsuite/split_s390_1_z2.s: New test.
649 * testsuite/split_s390_1_z3.s: New test.
650 * testsuite/split_s390_1_z4.s: New test.
651 * testsuite/split_s390_2_ns.s: New test.
652 * testsuite/split_s390_2_s.s: New test.
653 * testsuite/split_s390x_1_a1.s: New test.
654 * testsuite/split_s390x_1_a2.s: New test.
655 * testsuite/split_s390x_1_n1.s: New test.
656 * testsuite/split_s390x_1_n2.s: New test.
657 * testsuite/split_s390x_1_z1.s: New test.
658 * testsuite/split_s390x_1_z2.s: New test.
659 * testsuite/split_s390x_1_z3.s: New test.
660 * testsuite/split_s390x_1_z4.s: New test.
661 * testsuite/split_s390x_2_ns.s: New test.
662 * testsuite/split_s390x_2_s.s: New test.
664 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
666 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
667 info message for every erratum 843419 found and fixed.
669 2016-02-07 Cary Coutant <ccoutant@gmail.com>
672 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
673 information to relocation overflow errors.
675 2016-02-06 Cary Coutant <ccoutant@gmail.com>
678 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
679 overflow checking when symbol value + addend < 0.
681 2016-02-06 Cary Coutant <ccoutant@gmail.com>
684 * reloc.h (Limits): New class.
685 (Bits::has_overflow32): Use min/max values from Limits.
686 (Bits::has_unsigned_overflow32): Likewise.
687 (Bits::has_signed_unsigned_overflow32): Likewise.
688 (Bits::has_overflow): Likewise.
689 (Bits::has_unsigned_overflow): Likewise.
690 (Bits::has_signed_unsigned_overflow64): Likewise.
692 2016-02-06 Cary Coutant <ccoutant@gmail.com>
695 * reloc.h (Relocate_functions::Overflow_check): Add comments.
696 * x86_64.cc (X86_64_relocate_functions): New class.
697 (Target_x86_64::Relocate::relocate): Use the new class.
698 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
699 (x32_overflow_pc32): New test case.
700 * testsuite/Makefile.in: Regenerate.
701 * testsuite/x32_overflow_pc32.sh: New script.
702 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
704 2016-02-06 Cary Coutant <ccoutant@gmail.com>
707 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
708 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
710 2016-02-06 Cary Coutant <ccoutant@gmail.com>
713 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
715 (Bits::has_unsigned_overflow): Likewise.
717 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
719 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
721 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
722 and view_size to is_call_to_non_split.
723 * target.cc (Target::is_call_to_non_split): Add view and view_size
725 * target.h (class Target): Likewise.
727 2016-02-05 Sriraman Tallam <tmsriram@google.com>
729 * icf.cc (get_rel_addend): New function.
730 (get_section_contents): Move merge section addend computation to a
731 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
732 Fix bug to not read past the length of the section.
734 2016-02-05 Cary Coutant <ccoutant@gmail.com>
735 Andrew Senkevich <andrew.senkevich@intel.com>
738 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
739 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
741 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
742 * testsuite/x86_64_overflow_pc32.sh: New test script.
743 * testsuite/x86_64_overflow_pc32.s: New source file.
745 2016-02-05 Cary Coutant <ccoutant@gmail.com>
748 * reloc.h (Relocate_functions::Address): New typedef.
749 (Relocate_functions::Addendtype): New typedef.
750 (Relocate_functions::Overflow_check): New enum type.
751 (Relocate_functions::Reloc_status): New enum type.
752 (Relocate_functions::check_overflow): New function template.
753 (Relocate_functions::rel): Add check parameter; check for overflow.
754 (Relocate_functions::rel_unaligned): Likewise.
755 (Relocate_functions::rela): Likewise.
756 (Relocate_functions::pcrel): Likewise.
757 (Relocate_functions::pcrel_unaligned): Likewise.
758 (Relocate_functions::pcrela): Likewise.
759 (Relocate_functions::rel8): Adjust parameter types.
760 (Relocate_functions::rela8): Likewise.
761 (Relocate_functions::pcrel8): Likewise.
762 (Relocate_functions::pcrela8): Likewise.
763 (Relocate_functions::rel16): Likewise.
764 (Relocate_functions::rela168): Likewise.
765 (Relocate_functions::pcrel16): Likewise.
766 (Relocate_functions::pcrela16): Likewise.
767 (Relocate_functions::rel32): Likewise.
768 (Relocate_functions::rel32_unaligned): Likewise.
769 (Relocate_functions::rela32): Likewise.
770 (Relocate_functions::pcrel32): Likewise.
771 (Relocate_functions::pcrel32_unaligned): Likewise.
772 (Relocate_functions::pcrela32): Likewise.
773 (Relocate_functions::rel8_check): New function.
774 (Relocate_functions::rela8_check): New function.
775 (Relocate_functions::pcrel8_check): New function.
776 (Relocate_functions::pcrela8_check): New function.
777 (Relocate_functions::rel16_check): New function.
778 (Relocate_functions::rela168_check): New function.
779 (Relocate_functions::pcrel16_check): New function.
780 (Relocate_functions::pcrela16_check): New function.
781 (Relocate_functions::rel32_check): New function.
782 (Relocate_functions::rel32_unaligned_check): New function.
783 (Relocate_functions::rela32_check): New function.
784 (Relocate_functions::pcrel32_check): New function.
785 (Relocate_functions::pcrel32_unaligned_check): New function.
786 (Relocate_functions::pcrela32_check): New function.
787 (Bits::has_unsigned_overflow32): New function.
788 (Bits::has_unsigned_overflow): New function.
789 * testsuite/Makefile.am (overflow_unittest): New test.
790 * testsuite/Makefile.in: Regenerate.
791 * testsuite/overflow_unittest.cc: New source file.
793 2016-02-04 Alan Modra <amodra@gmail.com>
795 * powerpc.cc (relocate): Adjust last patch for big-endian.
797 2016-02-02 Alan Modra <amodra@gmail.com>
799 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
801 2016-01-15 Han Shen <shenhan@google.com>
803 PR gold/19472 - need pc-relative stubs.
805 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
806 stub type for DSOs and pie executables.
808 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
810 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
813 2016-01-12 Cary Coutant <ccoutant@gmail.com>
815 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
816 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
817 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
818 specializations) New method.
820 2016-01-11 Cary Coutant <ccoutant@gmail.com>
823 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
824 we have a TLS segment for GD-to-IE optimization.
825 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
827 (Target_i386::tls_desc_gd_to_ie): Likewise.
828 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
829 for TLSDESC GD-to-IE optimizations.
830 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
832 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
833 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
834 for TLSDESC GD-to-IE optimizations.
836 2016-01-11 Cary Coutant <ccoutant@gmail.com>
838 Refactor gold to enable support for MIPS-64 relocation format.
840 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
841 (gc_process_relocs): Remove sh_type template parameter.
842 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
843 * object.h (Sized_relobj_file::split_stack_adjust): Add target
845 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
846 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
847 specializations) Remove.
848 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
849 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
850 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
851 (Sized_relobj_file::split_stack_adjust): Add target parameter.
853 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
854 Target::get_r_sym() to get r_sym field from relocations.
855 (Track_relocs::next_symndx): Call Target::get_r_sym().
856 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
857 add Classify_reloc template parameter. Use for accessing r_sym and
859 (relocate_section): Likewise.
860 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
861 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
862 (Default_scan_relocatable_relocs::Reltype): New typedef.
863 (Default_scan_relocatable_relocs::reloc_size): New const.
864 (Default_scan_relocatable_relocs::sh_type): New const.
865 (Default_scan_relocatable_relocs::get_r_sym): New method.
866 (Default_scan_relocatable_relocs::get_r_type): New method.
867 (Default_emit_relocs_strategy): New class.
868 (scan_relocatable_relocs): Replace sh_type template parameter with
869 Scan_relocatable_relocs class. Use it to access r_sym and r_type
871 (relocate_relocs): Replace sh_type template parameter with
872 Classify_reloc class. Use it to access r_sym and r_type fields.
873 * target.h (Target::is_call_to_non_split): Replace r_type parameter
874 with pointer to relocation. Adjust all callers.
875 (Target::do_is_call_to_non_split): Likewise.
876 (Target::emit_relocs_scan): New virtual method.
877 (Sized_target::get_r_sym): New virtual method.
878 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
879 with pointer to relocation.
881 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
882 (Target_aarch64::Relocatable_size_for_reloc): Remove.
883 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
884 (Target_aarch64::scan_relocs): Likewise.
885 (Target_aarch64::relocate_section): Likewise.
886 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
888 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
889 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
890 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
892 (Target_arm::emit_relocs_scan): New method.
893 (Target_arm::Relocatable_size_for_reloc): Replace with...
894 (Target_arm::Classify_reloc): ...this.
895 (Target_arm::gc_process_relocs): Use Classify_reloc.
896 (Target_arm::scan_relocs): Likewise.
897 (Target_arm::relocate_section): Likewise.
898 (Target_arm::scan_relocatable_relocs): Likewise.
899 (Target_arm::relocate_relocs): Likewise.
900 * i386.cc (Target_i386::emit_relocs_scan): New method.
901 (Target_i386::Relocatable_size_for_reloc): Replace with...
902 (Target_i386::Classify_reloc): ...this.
903 (Target_i386::gc_process_relocs): Use Classify_reloc.
904 (Target_i386::scan_relocs): Likewise.
905 (Target_i386::relocate_section): Likewise.
906 (Target_i386::scan_relocatable_relocs): Likewise.
907 (Target_i386::relocate_relocs): Likewise.
908 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
910 (Mips_reloc_types): New class template.
911 (Mips_classify_reloc): New class template.
912 (Target_mips::Reltype): New typedef.
913 (Target_mips::Relatype): New typedef.
914 (Target_mips::emit_relocs_scan): New method.
915 (Target_mips::get_r_sym): New method.
916 (Target_mips::Relocatable_size_for_reloc): Replace with
918 (Target_mips::copy_reloc): Use Mips_classify_reloc.
919 (Target_mips::gc_process_relocs): Likewise.
920 (Target_mips::scan_relocs): Likewise.
921 (Target_mips::relocate_section): Likewise.
922 (Target_mips::scan_relocatable_relocs): Likewise.
923 (Target_mips::relocate_relocs): Likewise.
924 (mips_get_size_for_reloc): New function, factored out from
925 Relocatable_size_for_reloc::get_size_for_reloc.
926 (Target_mips::Scan::local): Use Mips_classify_reloc.
927 (Target_mips::Scan::global): Likewise.
928 (Target_mips::Relocate::relocate): Likewise.
929 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
930 (Target_powerpc::Relocatable_size_for_reloc): Remove.
931 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
932 (Target_powerpc::scan_relocs): Likewise.
933 (Target_powerpc::relocate_section): Likewise.
934 (Powerpc_scan_relocatable_reloc): Convert to class template.
935 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
936 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
937 (Powerpc_scan_relocatable_reloc::sh_type): New const.
938 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
939 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
940 (Target_powerpc::scan_relocatable_relocs): Use
941 Powerpc_scan_relocatable_reloc.
942 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
943 * s390.cc (Target_s390::emit_relocs_scan): New method.
944 (Target_s390::Relocatable_size_for_reloc): Remove.
945 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
946 (Target_s390::scan_relocs): Likewise.
947 (Target_s390::relocate_section): Likewise.
948 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
950 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
951 (Target_s390::relocate_relocs): Use Default_classify_reloc.
952 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
953 (Target_sparc::Relocatable_size_for_reloc): Remove.
954 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
955 (Target_sparc::scan_relocs): Likewise.
956 (Target_sparc::relocate_section): Likewise.
957 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
959 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
960 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
961 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
962 (Target_tilegx::Relocatable_size_for_reloc): Remove.
963 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
964 (Target_tilegx::scan_relocs): Likewise.
965 (Target_tilegx::relocate_section): Likewise.
966 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
968 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
969 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
970 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
971 (Target_x86_64::Relocatable_size_for_reloc): Remove.
972 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
973 (Target_x86_64::scan_relocs): Likewise.
974 (Target_x86_64::relocate_section): Likewise.
975 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
977 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
978 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
980 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
982 2016-01-01 Alan Modra <amodra@gmail.com>
984 Update year range in copyright notice of all files.
986 For older changes see ChangeLog-0815
988 Copyright (C) 2016 Free Software Foundation, Inc.
990 Copying and distribution of this file, with or without modification,
991 are permitted in any medium without royalty provided the copyright
992 notice and this notice are preserved.
998 version-control: never