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