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