1 2016-12-08 Alan Modra <amodra@gmail.com>
3 * powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather
6 2016-12-08 Alan Modra <amodra@gmail.com>
8 * options.h (--stub-group-multi): Fix typo.
10 2016-12-07 Alan Modra <amodra@gmail.com>
12 * options.h (--stub-group-multi): New PowerPC option.
13 * powerpc.cc (Stub_control): Add multi_os_ var and param
14 to constructor. Sort start_ var later. Comment State.
15 (Stub_control::can_add_to_stub_group): Heed multi_os_.
16 (Target_powerpc::group_sections): Update.
18 2016-12-07 Alan Modra <amodra@gmail.com>
21 * powerpc.cc (Stub_control): Replace stubs_always_before_branch_
22 with stubs_always_after_branch_, group_end_addr_ with
24 (Stub_control::can_add_to_stub_group): Rewrite to suit scanning
25 sections by increasing address.
26 (Target_powerpc::group_sections): Scan that way. Delete corner
28 * options.h (--stub-group-size): Update help string.
30 2016-12-07 Alan Modra <amodra@gmail.com>
32 * powerpc.cc (Stub_table_owner): Provide constructor.
33 (Powerpc_relobj::set_stub_table): Resize fill with -1.
34 (Target_powerpc::Branch_info::make_stub): Provide target debug
35 output on returning false.
37 2016-12-05 Cary Coutant <ccoutant@gmail.com>
38 Tristan Gingold <gingold@adacore.com>
40 * object.cc (Sized_relobj_file::do_count_local_symbols): Check
41 is_ordinary before using shndx.
42 * testsuite/Makefile.am (file_in_many_sections_test.sh): New test case.
43 * testsuite/Makefile.in: Regenerate.
44 * testsuite/file_in_many_sections.c: New source file.
45 * testsuite/file_in_many_sections_test.sh: New script.
47 2016-12-01 Cary Coutant <ccoutant@gmail.com>
50 * script-sections.cc (Script_sections): Set *keep to false when
53 2016-12-01 Cary Coutant <ccoutant@gmail.com>
56 * target.h (Target::default_text_segment_address): Bump default
57 start address up to ABI page size.
59 2016-12-01 Cary Coutant <ccoutant@gmail.com>
62 * options.cc (General_options::object_format_to_string): New function.
63 (General_options::copy_from_posdep_options): New function.
64 (General_options::parse_push_state): New function.
65 (General_options::parse_pop_state): New function.
66 * options.h (--push-state, --pop-state): New options.
67 (General_options::object_format_to_string): New method.
68 (General_options::set_incremental_disposition): New method.
69 (General_options::copy_from_posdep_options): New method.
70 (General_options::options_stack_): New data member.
72 2016-12-01 Cary Coutant <ccoutant@gmail.com>
75 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
76 section symbols correctly.
77 * arm.cc (Target_arm): Likewise.
78 * powerpc.cc (Target_powerpc): Likewise.
80 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
82 * aarch64-reloc.def: Fix spelling in comments.
84 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
86 * aarch64.cc: Fix spelling in comments.
87 * arm.cc: Fix spelling in comments.
88 * icf.cc: Fix spelling in comments.
89 * layout.cc: Fix spelling in comments.
90 * layout.h: Fix spelling in comments.
91 * mips.cc: Fix spelling in comments.
92 * output.h: Fix spelling in comments.
93 * plugin.h: Fix spelling in comments.
94 * script-sections.h: Fix spelling in comments.
95 * script.h: Fix spelling in comments.
96 * stringpool.h: Fix spelling in comments.
97 * tilegx.cc: Fix spelling in comments.
99 2016-11-22 Cary Coutant <ccoutant@gmail.com>
102 * options.cc (One_option::print): Print "(default)" when appropriate.
103 * options.h: Clean up and re-sort options.
104 (One_option::is_default): New data member.
105 (One_option::One_option): Add is_default parameter; adjust all calls.
106 (DEFINE_var): Add is_default__ parameter; adjust all calls.
107 (DEFINE_bool): Set is_default based on default_value__.
108 (DEFINE_bool_ignore): New macro.
109 (--no-eh-frame-hdr): New option.
110 (--enable-new-dtags): Remove mention of DT_FLAGS.
112 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
114 * configure: Regenerate.
116 2016-11-21 Cary Coutant <ccoutant@gmail.com>
119 * gold.cc (queue_middle_tasks): Force valid target earlier.
121 2016-11-21 Igor Kudrin <ikudrin@accesssoftek.com>
123 * layout.cc: Include windows.h and rpcdce.h (for MinGW32).
124 (Layout::create_build_id): Generate uuid using UuidCreate().
126 2016-11-04 Loïc Yhuel <loic.yhuel@softathome.com>
128 * configure.ac: add missing '$'.
129 * configure: Regenerate.
131 2016-10-21 Gergely Nagy <ngg@tresorit.com>
134 * icf.cc (match_sections): Add new parameter section_addraligns.
135 Check section alignment and keep the section with the strictest
137 (find_identical_sections): New local variable section_addraligns.
138 Store each section's alignment.
139 * testsuite/pr17704a_test.s: New file.
140 * testsuite/Makefile.am (pr17704a_test): New test.
141 * testsuite/Makefile.in: Regenerate.
143 2016-10-06 Alan Modra <amodra@gmail.com>
145 * powerpc.cc (Target_powerpc::Relocate::relocate): Add fall
147 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
149 2016-10-06 Alan Modra <amodra@gmail.com>
151 * aarch64.cc: Spell fall through comments as "// Fall through.".
154 * powerpc.cc: Likewise.
156 * sparc.cc: Likewise.
157 * x86_64.cc: Likewise.
158 * powerpc.cc (Target_powerpc::Relocate::relocate): Add missing
159 fall through comments.
160 * sparc.cc: (Target_sparc::Scan::global): Likewise.
161 (Target_sparc::Relocate::relocate): Likewise.
162 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
163 * resolve.cc (symbol_to_bits): Add missing break.
165 2016-09-26 Cary Coutant <ccoutant@gmail.com>
168 * symtab.cc (Symbol_table::define_default_version): Check that
169 unversioned symbol is defined.
171 2016-09-26 Vlad Zakharov <vzakhar@synopsys.com>
173 * Makefile.in: Regenerate.
174 * configure: Likewise.
175 * testsuite/Makefile.in: Likewise.
177 2016-09-26 Alan Modra <amodra@gmail.com>
179 * aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid
181 * output.cc (Output_segment::set_section_addresses): Likewise.
182 * testsuite/Makefile.in: Regenerate.
184 2016-09-02 Doug Kwan <dougkwan@google.com>
186 * arm.cc (Target_arm::Target_arm): Move method definition outside of
187 class definition. Add code to handle --target1-rel, --target1-abs
188 and --target2= options.
189 (Target_arm::get_reloc_reloc_type): Change method to be non-static
191 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
193 (Target_arm::Scan::local, Target_arm::Scan::global,
194 Target_arm::Relocate::relocate,
195 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
196 call to Target_arm::get_real_reloc_type.
197 (Target_arm::get_real_reloc_type): Use command line options to
198 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
199 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
202 2016-08-31 Alan Modra <amodra@gmail.com>
204 * powerpc.cc (class Stub_control): Delete stub14_group_size_
205 and has14_. Add group_size_.
206 (Stub_control::can_add_to_stub_group): Adjust to suit. Print
207 debug info when switching to adding sections before stubs.
209 2016-08-31 Alan Modra <amodra@gmail.com>
211 * debug.h (DEBUG_TARGET): New.
212 (DEBUG_ALL): Add DEBUG_TARGET.
213 (gold_debug): Delete FORMAT param.
214 * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
216 2016-08-30 Alan Modra <amodra@gmail.com>
219 * powerpc.cc (class Stub_control): Add has14_. Comment owner_.
220 (Stub_control::can_add_to_stub_group): Correct grouping of
221 sections containing 14-bit external branches. When returning
222 false, set state_ to reflect the fact that we have one section
223 for the next group. Rewrite most of function for clarity.
224 Add and expand comments.
225 (Target_powerpc::do_relax): Print stub group size retry in hex.
227 2016-08-26 Han Shen <shenhan@google.com>
229 PR gold/20529 - relaxing loop never ends.
231 * powerpc.cc (Stub_table::min_size_threshold_): New member to
233 (Stub_table::set_min_size_threshold): New member function.
234 (Stub_table::set_address_and_size): Add code to only allow size
236 (Target_powerpc::do_relax): Add code to record last size.
238 2016-08-23 Roland McGrath <roland@hack.frob.com>
240 * options.h (General_options): Grok -z stack-size.
241 * output.h (Output_segment::set_size): New method.
242 * layout.cc (Layout::create_executable_stack_info): Renamed to ...
243 (Layout::create_stack_segment): ... this. Always create the
244 segment if -z stack-size was used.
245 (Layout::set_segment_offsets): Don't call ->set_offset on the
246 PT_GNU_STACK segment.
248 2016-08-15 Bharathi Seshadri <bseshadr@cisco.com>
250 * options.h (General_options): Add --be8 option.
251 * arm.cc (Arm_relobj::do_relocate_sections): Add code to swap for be8.
252 (Output_data_plt_arm_standard::do_fill_first_plt_entry): Likewise.
253 (Output_data_plt_arm_short::do_fill_plt_entry): Likewise.
254 (Output_data_plt_arm_long::do_fill_plt_entry): Likewise.
255 (Target_arm::do_adjust_elf_header): Do EF_ARM_BE8 adjustment.
257 2016-08-17 Cary Coutant <ccoutant@gmail.com>
259 * i386.cc (Target_i386): Reset skip_call_tls_get_addr_ after printing
261 * testsuite/Makefile.am (pr20216a): Add missing dependencies.
262 (pr20308a): Add -Bgcctestdir/ to compile rules.
263 * testsuite/Makefile.in: Regenerate.
265 2016-08-12 Roland McGrath <roland@hack.frob.com>
268 * script-sections.cc (Script_sections::release_segments):
269 Reset this->segments_created_.
271 2016-08-12 Roland McGrath <roland@hack.frob.com>
273 * yyscript.y (HIDDEN): New %token.
274 (assignment): Handle HIDDEN(string = expr) syntax.
275 * script.cc (script_keyword_parsecodes): Add HIDDEN.
277 2016-08-10 Cary Coutant <ccoutant@gmail.com>
280 * x86_64.cc (Target_x86_64::Relocate::relocate): Add check for
281 R_X86_64_GOTPCREL. Reset skip_call_tls_get_addr_ after printing
283 * testsuite/Makefile.am (pr20216_gd.o): Add -Bgcctestdir/.
284 (pr20216_ld.o): Likewise.
285 * testsuite/Makefile.in: Regenerate.
287 2016-08-10 James Clarke <jrtc27@jrtc27.com>
290 * symtab.cc (Symbol_table::add_from_relobj): Handle NULL symbols,
291 which will be present for STT_SPARC_REGISTER.
292 (Symbol_table::add_from_pluginobj): Likewise.
293 (Symbol_table::add_from_dynobj): Likewise.
294 (Symbol_table::add_from_incrobj): Removed dead code.
296 2016-08-10 James Clarke <jrtc27@jrtc27.com>
299 * sparc.cc (Target_sparc::Relocate::relocate): R_SPARC_GOTDATA_OP_LOX10
300 should fall back on R_SPARC_GOT10, not R_SPARC_GOT13.
302 2016-08-10 James Clarke <jrtc27@jrtc27.com>
305 * sparc.cc (Target_sparc::Scan::check_non_pic): Allow R_SPARC_32 on
308 2016-06-29 Cary Coutant <ccoutant@gmail.com>
311 * testsuite/dynamic_list.sh: Remove check for _ZdlPv.
313 2016-06-29 Cary Coutant <ccoutant@gmail.com>
315 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add eh_test_2.
316 * testsuite/Makefile.in: Regenerate.
318 2016-06-30 Alan Modra <amodra@gmail.com>
320 * testsuite/Makefile.am (memory_test, memory_test_2): Pass
321 -Wl,-z to gcc, not plain -z.
322 * testsuite/Makefile.in: Regenerate.
324 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
327 * i386.cc (Target_i386::Relocate::relocate): Allow
328 R_386_GOT32X relocation against ___tls_get_addr.
329 (Target_i386::Relocate::tls_gd_to_ie): Support indirect
330 call to __tls_get_addr.
331 (Target_i386::Relocate::tls_gd_to_le): Likewise.
332 (Target_i386::Relocate::tls_ld_to_le): Likewise.
333 * testsuite/Makefile.am (check_PROGRAMS): Add pr20308a_test,
334 pr20308b_test, pr20308c_test, pr20308d_test, pr20308e_test.
335 (pr20308a_test_SOURCES): New.
336 (pr20308a_test_DEPENDENCIES): Likewise.
337 (pr20308a_test_CFLAGS): Likewise.
338 (pr20308a_test_LDFLAGS): Likewise.
339 (pr20308a_test_LDADD): Likewise.
340 (pr20308b_test_SOURCES): Likewise.
341 (pr20308b_test_DEPENDENCIES): Likewise.
342 (pr20308b_test_CFLAGS): Likewise.
343 (pr20308b_test_LDFLAGS): Likewise.
344 (pr20308b_test_LDADD): Likewise.
345 (pr20308c_test_SOURCES): Likewise.
346 (pr20308c_test_DEPENDENCIES): Likewise.
347 (pr20308c_test_CFLAGS): Likewise.
348 (pr20308c_test_LDFLAGS): Likewise.
349 (pr20308c_test_LDADD): Likewise.
350 (pr20308d_test_SOURCES): Likewise.
351 (pr20308d_test_DEPENDENCIES): Likewise.
352 (pr20308d_test_CFLAGS): Likewise.
353 (pr20308d_test_LDFLAGS): Likewise.
354 (pr20308d_test_LDADD): Likewise.
355 (pr20308e_test_SOURCES): Likewise.
356 (pr20308e_test_DEPENDENCIES): Likewise.
357 (pr20308e_test_CFLAGS): Likewise.
358 (pr20308e_test_LDFLAGS): Likewise.
359 (pr20308e_test_LDADD): Likewise.
360 (pr20308a.so): Likewise.
361 (pr20308b.so): Likewise.
362 (pr20308_gd.o): Likewise.
363 (pr20308_ld.o): Likewise.
364 (MOSTLYCLEANFILES): Add pr20308a.so pr20308b.so.
365 * testsuite/Makefile.in: Regenerated.
366 * testsuite/pr20308_def.c: New file.
367 * testsuite/pr20308_gd.S: Likewise.
368 * testsuite/pr20308_ld.S: Likewise.
369 * testsuite/pr20308_main.c: Likewise.
371 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
374 * configure.ac (DEFAULT_TARGET_X86_64_OR_X32): New
376 * configure: Regenerated.
377 * x86_64.cc (Target_x86_64<size>::Relocate::relocate): Allow
378 R_X86_64_GOTPCRELX relocation against __tls_get_addr.
379 (Target_x86_64<size>::Relocate::tls_gd_to_ie): Support indirect
380 call to __tls_get_addr.
381 (Target_x86_64<size>::Relocate::tls_gd_to_le): Likewise.
382 (Target_x86_64<size>::Relocate::tls_ld_to_le): Likewise.
383 * testsuite/Makefile.am (check_PROGRAMS): Add pr20216a_test,
384 pr20216b_test, pr20216c_test, pr20216d_test, pr20216e_test.
385 (pr20216a_test_SOURCES): New.
386 (pr20216a_test_DEPENDENCIES): Likewise.
387 (pr20216a_test_CFLAGS): Likewise.
388 (pr20216a_test_LDFLAGS): Likewise.
389 (pr20216a_test_LDADD): Likewise.
390 (pr20216b_test_SOURCES): Likewise.
391 (pr20216b_test_DEPENDENCIES): Likewise.
392 (pr20216b_test_CFLAGS): Likewise.
393 (pr20216b_test_LDFLAGS): Likewise.
394 (pr20216b_test_LDADD): Likewise.
395 (pr20216c_test_SOURCES): Likewise.
396 (pr20216c_test_DEPENDENCIES): Likewise.
397 (pr20216c_test_CFLAGS): Likewise.
398 (pr20216c_test_LDFLAGS): Likewise.
399 (pr20216c_test_LDADD): Likewise.
400 (pr20216d_test_SOURCES): Likewise.
401 (pr20216d_test_DEPENDENCIES): Likewise.
402 (pr20216d_test_CFLAGS): Likewise.
403 (pr20216d_test_LDFLAGS): Likewise.
404 (pr20216d_test_LDADD): Likewise.
405 (pr20216e_test_SOURCES): Likewise.
406 (pr20216e_test_DEPENDENCIES): Likewise.
407 (pr20216e_test_CFLAGS): Likewise.
408 (pr20216e_test_LDFLAGS): Likewise.
409 (pr20216e_test_LDADD): Likewise.
410 (pr20216a.so): Likewise.
411 (pr20216b.so): Likewise.
412 (pr20216_gd.o): Likewise.
413 (pr20216_ld.o): Likewise.
414 (MOSTLYCLEANFILES): Add pr20216a.so pr20216b.so.
415 * testsuite/Makefile.in: Regenerated.
416 * testsuite/pr20216_def.c: New file.
417 * testsuite/pr20216_gd.S: Likewise.
418 * testsuite/pr20216_ld.S: Likewise.
419 * testsuite/pr20216_main.c: Likewise.
421 2016-06-29 Alan Modra <amodra@gmail.com>
423 * script_test_12.t: Delete .plt, specify 64k page size.
424 * script_test_12i.t: Likewise.
426 2016-06-29 Alan Modra <amodra@gmail.com>
428 * testsuite/plugin_layout_with_alignment.c: Explicitly align all
431 2016-06-29 Alan Modra <amodra@gmail.com>
433 * testsuite/Makefile.am (copy_test_protected): Disable for powerpc.
434 * testsuite/Makefile.in: Regenerate.
436 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
438 * aarch64-reloc.def (NONE): New relocation.
439 * aarch64.cc (Target_aarch64::Scan::local): Handle R_AARCH64_NONE.
440 (Target_aarch64::Scan::global): Likewise.
441 * testsuite/Makefile.am (aarch64_reloc_none): New test.
442 * testsuite/Makefile.in: Regenerate.
443 * testsuite/aarch64_reloc_none.s: New test source file.
444 * testsuite/aarch64_reloc_none.sh: New test script.
446 2016-06-28 Sriraman Tallam <tmsriram@google.com>
448 * x86_64.cc (Lazy_view): New class.
449 (can_convert_mov_to_lea): Templatize function. Make the function
450 check for appropriate relocation types and use the view parameter
451 to get section contents.
452 (can_convert_callq_to_direct): New function.
453 (Target_x86_64<size>::Scan::global): Refactor.
454 (Target_x86_64<size>::Relocate::relocate): Refactor. Change any indirect
455 call via GOT that can be converted.
456 * testsuite/Makefile.am (x86_64_indirect_call_to_direct.sh): New test.
457 * testsuite/Makefile.in: Regenerate.
458 * testsuite/x86_64_indirect_call_to_direct1.s: New file.
459 * testsuite/x86_64_indirect_jump_to_direct1.s: New file.
461 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
463 * aarch64.cc (Target_aarch64::Scan::local): Move the call to got_section
464 from the top level to the places of its use.
466 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
469 * script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
470 * script-sections.cc (Input_section_sorter::get_init_priority): New method.
471 (Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
472 (Output_section_element_input::print): Likewise.
473 * script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
474 * yyscript.y (SORT_BY_INIT_PRIORITY): New token.
475 (wildcard_section): Handle SORT_BY_INIT_PRIORITY.
477 * testsuite/Makefile.am (script_test_14): New test.
478 * testsuite/Makefile.in: Regenerate.
479 * testsuite/script_test_14.s: New test source file.
480 * testsuite/script_test_14.sh: New test script.
481 * testsuite/script_test_14.t: New test linker script.
483 2016-06-28 James Clarke <jrtc27@jrtc27.com>
485 * sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
486 to R_SPARC_RELATIVE if class is ELFCLASS64.
487 (Target_sparc::Scan::global): Likewise.
489 2016-06-23 Cary Coutant <ccoutant@gmail.com>
490 Igor Kudrin <ikudrin@accesssoftek.com>
494 (Output_section_element_input::set_section_addresses): Keep bin_count
495 separate from input_pattern_count.
496 * testsuite/script_test_12.t: Add another section .x4.
497 * testsuite/script_test_12i.t: Likewise.
498 * testsuite/script_test_12a.c: Likewise.
499 * testsuite/script_test_12b.c: Likewise.
501 2016-06-23 Igor Kudrin <ikudrin@accesssoftek.com>
503 * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
505 2016-06-22 H.J. Lu <hongjiu.lu@intel.com>
508 * NEWS: Mention --enable-relro.
509 * configure.ac: Add --enable-relro.
510 (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
512 * config.in: Regenerated.
513 * configure: Likewise.
514 * options.h (General_options::relro): Default to
517 2016-06-20 Cary Coutant <ccoutant@gmail.com>
519 * NEWS: Add new features in 1.12.
520 * version.cc (version_string): Bump to 1.12.
522 2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
525 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if
527 (Target_i386::plt_entry_size): Likewise.
528 (Target_x86_64<size>::first_plt_entry_offset): Likewise.
529 (Target_x86_64<size>::plt_entry_size): Likewise.
531 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
533 * mips.cc (Target_mips::Target_mips): Initialize rld_map_.
534 (Target_mips::rld_map_): New data member.
535 (Target_mips::do_finalize_sections): Add support for
536 DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
537 .rld_map section, and __RLD_MAP symbol.
538 (Target_mips::do_dynamic_tag_custom_value): Add support for
539 DT_MIPS_RLD_MAP_REL dynamic tag.
540 * output.cc (Output_data_dynamic::get_entry_offset): New method
542 * output.h (Output_data_dynamic::get_entry_offset): New method
545 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
547 * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
549 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
551 * mips.cc (relocation_needs_la25_stub): Add support for relocs:
552 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
553 (hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
554 (is_matching_lo16_reloc): Likewise.
555 (lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
556 (Mips_output_data_plt::plt_entry_r6): New static data member for
558 (Target_mips::is_output_r6): New method.
559 (Target_mips::Mips_mach): Add new enum constants.
560 (Mips_relocate_functions::Status): Likewise.
561 (Mips_relocate_functions::pchi16_relocs): New static data member.
562 (Mips_relocate_functions::relpc21): New method.
563 (Mips_relocate_functions::relpc26): Likewise.
564 (Mips_relocate_functions::relpc18): Likewise.
565 (Mips_relocate_functions::relpc19): Likewise.
566 (Mips_relocate_functions::relpchi16): Likewise.
567 (Mips_relocate_functions::do_relpchi16): Likewise.
568 (Mips_relocate_functions::relpclo16): Likewise.
569 (Mips_output_data_plt::do_write): Add support for Mips r6 plt
571 (Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
572 (Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
573 E_MIPS_ARCH_64R6 support.
574 (Target_mips::update_abiflags_isa): Likewise.
575 (mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
576 R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
578 (Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
580 (Target_mips::Scan::global): Add support for relocs:
581 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
582 (Target_mips::Relocate::relocate): Call functions for resolving
583 Mips32r6 and Mips64r6 relocations, and print error message for
584 STATUS_PCREL_UNALIGNED.
585 (Target_mips::Scan::get_reference_flags): Add support for relocs:
586 R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
587 R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
588 (Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
589 E_MIPS_ARCH_64R6 support.
591 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
594 * testsuite/script_test_2.t: Add .got.plt after .got.
596 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
598 * mips.cc (struct Mips_abiflags): New struct.
599 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
601 (Mips_relobj::~Mips_relobj): Delete object pointed by
602 attributes_section_data_.
603 (Mips_relobj::abiflags): New method.
604 (Mips_relobj::attributes_section_data): Likewise.
605 (Mips_relobj::attributes_section_data_): New data member.
606 (Mips_relobj::abiflags_): Likewise.
607 (class Mips_output_section_abiflags): New class.
608 (Target_mips::Target_mips): Initialize attributes_section_data_,
609 abiflags_ and has_abiflags_section_.
610 (Target_mips::do_should_include_section): Don't emit input
611 .MIPS.abiflags sections to output .MIPS.abiflags.
612 (Target_mips::Mips_mach): Add new enum constants.
613 (Target_mips::mips_isa_ext_mach): New method.
614 (Target_mips::mips_isa_ext): Likewise.
615 (Target_mips::update_abiflags_isa): Likewise.
616 (Target_mips::infer_abiflags): Likewise.
617 (Target_mips::create_abiflags): Likewise.
618 (Target_mips::fp_abi_string): Likewise.
619 (Target_mips::select_fp_abi): Likewise.
620 (Target_mips::merge_obj_attributes): Likewise.
621 (Target_mips::merge_obj_abiflags): Likewise.
622 (Target_mips::level_rev): Likewise.
623 (Target_mips::merge_obj_e_flags): Rename from
624 merge_processor_specific_flags. Remove dyn_obj argument,
625 call update_abiflags_isa when needed, compare NaN encodings and
627 (Target_mips::add_machine_extensions): Add two machine extensions
629 (Target_mips::attributes_section_data_): New data member.
630 (Target_mips::abiflags_): Likewise.
631 (Target_mips::has_abiflags_section_): Likewise.
632 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
633 .MIPS.abiflags sections if they exists.
634 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
635 E_MIPS_MACH_OCTEON3 support.
636 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
637 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
638 .MIPS.abiflags sections from input. Create these sections if
640 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
641 E_MIPS_MACH_OCTEON3 support, and change strings for
642 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
645 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
647 * mips.cc (Mips_relobj::Mips_relobj): Initialize
648 has_reginfo_section_.
649 (Mips_relobj::has_reginfo_section_): New data member.
650 (Mips_relobj::has_reginfo_section): New method.
651 (class Mips_output_section_reginfo): Change base class to
652 Output_section_data, and set masks of the output .reginfo section
654 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
656 (Mips_output_section_reginfo::set_masks): Likewise.
657 (Mips_output_section_reginfo::set_final_data_size): Likewise.
658 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
659 (Target_mips::do_make_output_section): Remove.
660 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
661 if the object contains a .reginfo section.
662 (Target_mips::do_finalize_sections): Create a .reginfo output
665 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
667 * mips.cc (Mips_output_data_got::do_write): Add missing template
670 2016-05-30 Marcin Kościelnicki <koriakin@0x04.net>
673 * s390.cc (Target_s390::ss_code_st_r14): Removed.
674 (Target_s390::ss_code_l_r14): Removed.
675 (Target_s390::ss_code_ear): Removed.
676 (Target_s390::ss_code_c): Removed.
677 (Target_s390::ss_match_st_r14): New function.
678 (Target_s390::ss_match_l_r14): New function.
679 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
680 of matching code directly.
681 (Target_s390::ss_match_ear): New function.
682 (Target_s390::ss_match_c): New function.
683 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
684 of matching code directly.
686 2016-05-19 Cary Coutant <ccoutant@gmail.com>
689 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
690 parameter; check for protected symbol.
691 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
692 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
693 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
694 (Symbol_table::add_from_dynobj): Mark protected symbols.
695 * symtab.h (Symbol::is_protected): New method.
696 (Symbol::set_is_protected): New method.
697 (Symbol::is_protected_): New data member.
699 * testsuite/Makefile.am (copy_test_protected): New test.
700 * testsuite/Makefile.in: Regenerate.
701 * testsuite/copy_test.cc (main): Add legal reference to protected
703 * testsuite/copy_test_v1.cc (main): Likewise.
704 * testsuite/copy_test_2.cc (ip): Add protected symbol.
705 * testsuite/copy_test_protected.cc: New test source file.
706 * testsuite/copy_test_protected.sh: New test script.
708 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
710 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
711 for global got symbols, and set addend to 0.
712 (Mips_got_entry::hash): Change hash algorithm.
713 (Mips_got_entry::equals): Refactor.
714 (Mips_got_entry::object): Return input object for local got symbols
716 (Mips_got_entry::addend): Change return of the relocation addend.
717 (Mips_got_entry::addend_): Move from union d.
718 (Mips_got_entry::object_): Move into union d.
719 (class Mips_symbol_hash): New class.
720 (Mips_got_info::Global_got_entry_set): New type.
721 (Mips_got_info::global_got_symbols): Change return type to
722 Global_got_entry_set.
723 (Mips_got_info::global_got_symbols_): Change type to
724 Global_got_entry_set.
725 (Mips_symbol::hash): New method.
726 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
727 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
728 (Mips_output_data_mips_stubs::symbols_): Change type to
729 Mips_stubs_entry_set.
730 (Mips_got_info::record_global_got_symbol): Don't pass object
731 argument when creating global got symbol.
732 (Mips_got_info::record_got_entry): Remove find before inserting
734 (Mips_got_info::add_reloc_only_entries): Change type of iterator
735 to Global_got_entry_set.
736 (Mips_got_info::count_got_symbols): Likewise.
737 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
738 for adding entries to symbols_.
739 (Mips_output_data_la25_stub::do_write): Change type of iterator
741 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
742 of iterator to Mips_stubs_entry_set.
743 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
744 (Mips_output_data_mips_stubs::do_write): Likewise.
746 2016-05-06 Han Shen <shenhan@google.com>
750 * aarch64-reloc.def: New relocation type.
751 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
752 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
753 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
754 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
756 2016-04-28 Nick Clifton <nickc@redhat.com>
758 * po/zh_CN.po: Updated Chinese (simplified) translation.
760 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
762 * Makefile.in: Regenerated with automake 1.11.6.
763 * aclocal.m4: Likewise.
764 * testsuite/Makefile.in: Likewise.
766 2016-03-30 Cary Coutant <ccoutant@gmail.com>
769 * symtab.cc (Symbol_table::define_default_version): Check for case
770 where symbols are both in different shared objects.
772 2016-03-27 Cary Coutant <ccoutant@gmail.com>
775 * i386.cc (Target_i386): Add check for fully-resolved symbol for
778 2016-03-22 Nick Clifton <nickc@redhat.com>
780 * configure: Regenerate.
782 2016-03-21 Cary Coutant <ccoutant@gmail.com>
785 * errors.cc (Errors::undefined_symbol): Add info message when
786 symbol should have been provided by a plugin.
787 * target-reloc.h (issue_undefined_symbol_error): Check for
788 placeholder symbols defined in discarded sections.
789 * testsuite/Makefile.am (plugin_test_9b): New test case.
790 * testsuite/Makefile.in: Regenerate.
791 * testsuite/plugin_test_9b_elf.cc: New test source file.
792 * testsuite/plugin_test_9b_ir.cc: New test source file.
794 2016-03-20 Cary Coutant <ccoutant@gmail.com>
797 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
798 * testsuite/Makefile.am (eh_test_2): New test.
799 * testsuite/Makefile.in: Regenerate.
800 * testsuite/eh_test_2.sh: New test script.
801 * testsuite/eh_test_a.cc (bar): Make it comdat.
802 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
804 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
806 * mips.cc (Mips_relobj::is_n64_): Remove.
807 (Target_mips::ei_class_): Likewise.
808 (Mips_relobj::is_newabi): Call methods.
809 (Mips_relobj::is_n64): Change checking for N64 ABI.
810 (Target_mips::is_output_n64): Likewise.
811 (Target_mips::merge_processor_specific_flags): Remove ei_class
812 argument, and remove comparing ei_class.
813 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
815 (Target_mips::do_finalize_sections): Don't pass ei_class argument
816 to merge_processor_specific_flags.
817 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
818 change checking for N64 ABI.
820 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
822 * mips.cc (enum Special_relocation_symbol): New enum type.
823 (is_readonly_section): New function.
824 (eh_reloc): Likewise.
825 (Mips_got_entry::is_section_symbol_): New member.
826 (Mips_got_entry::is_section_symbol): New method.
827 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
829 (Mips_relobj::mips_elf_options_section_name): New method.
830 (Mips_output_data_got::record_local_got_symbol): Add
831 is_section_symbol argument, and pass it to
832 Mips_got_info::record_local_got_symbol.
833 (Mips_output_data_got::got_offset): Add addend argument, and pass
834 it to Relobj::local_got_offset.
835 (struct Mips_output_reloc_writer): New type.
836 (class Mips_output_data_reloc): New class.
837 (Mips_output_data_plt::Reloc_section): Change type to
838 Mips_output_data_reloc.
839 (Target_mips::Reloc_section): Likewise.
840 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
841 (Mips_classify_reloc::get_r_type2): New method.
842 (Mips_classify_reloc::get_r_type3): Likewise.
843 (Mips_classify_reloc::get_r_ssym): Likewise.
844 (Target_mips::Reloca_section): Remove.
845 (Relocate::should_apply_static_reloc): Rename from
846 should_apply_r_mips_32_reloc.
847 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
849 (Mips_relocate_functions::Valtype): New type.
850 (Mips_relocate_functions::Valtype64): New type.
851 (Mips_relocate_functions::check_overflow): New method.
852 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
854 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
855 (Mips_relocate_functions::rel16): Add support for resolving
856 relocations for Mips64.
857 (Mips_relocate_functions::rel32): Likewise.
858 (Mips_relocate_functions::reljalr): Likewise.
859 (Mips_relocate_functions::relpc32): Likewise.
860 (Mips_relocate_functions::rel26): Likewise.
861 (Mips_relocate_functions::relpc16): Likewise.
862 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
863 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
864 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
865 (Mips_relocate_functions::do_relhi16): Likewise.
866 (Mips_relocate_functions::do_relgot16_local): Likewise.
867 (Mips_relocate_functions::rello16): Likewise.
868 (Mips_relocate_functions::relgot): Likewise.
869 (Mips_relocate_functions::relgotpage): Likewise.
870 (Mips_relocate_functions::relgotofst): Likewise.
871 (Mips_relocate_functions::relgot_hi16): Likewise.
872 (Mips_relocate_functions::relgot_lo16): Likewise.
873 (Mips_relocate_functions::relgprel): Likewise.
874 (Mips_relocate_functions::relgprel32): Likewise.
875 (Mips_relocate_functions::tlsrelhi16): Likewise.
876 (Mips_relocate_functions::tlsrello16): Likewise.
877 (Mips_relocate_functions::tlsrel32): Likewise.
878 (Mips_relocate_functions::relsub): Likewise.
879 (Mips_relocate_functions::releh): New method.
880 (Mips_relocate_functions::rel64): Likewise.
881 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
882 pass it to Mips_got_entry.
883 (Mips_got_info::add_local_entries): Pass addend argument
884 to code functions, and for STT_SECTION symbols call
885 add_symbolless_local_addend.
886 (Mips_got_info::add_tls_entries): Pass addend argument to code
888 (Mips_relobj::do_read_symbols): Read gp value that was used to
890 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
891 instruction. Opcode for instruction will be selected later.
892 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
893 (Target_mips::scan_relocatable_relocs): Likewise.
894 (Target_mips::emit_relocs_scan): Likewise.
895 (Target_mips::relocate_relocs): Likewise.
896 (Target_mips::do_finalize_sections): Skip objects for merging
897 processor specific flags in which all input sections will be
899 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
900 (Target_mips::Scan::get_reference_flags): Likewise.
901 (Target_mips::relocate_special_relocatable): Call rel26 method with
902 calculate_only and calculated_value arguments.
903 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
904 dynamic relocation against a readonly sections, and pass
905 is_section_symbol to Mips_got_info::record_local_got_symbol.
906 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
907 dynamic relocation against a readonly sections, and pass r_type
908 and r_offset to Target_mips::copy_reloc.
909 (Target_mips::Relocate::relocate): Add support for resolving
910 relocations for Mips64.
911 (Target_mips::mips_info): Add case for Mips64 default dynamic
913 (Target_selector_mips): Correct emulation names.
915 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
917 * mips.cc (class Mips_output_data_la25_stub): Add
918 do_print_to_mapfile function.
920 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
922 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
925 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
927 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
928 * testsuite/plugin_layout_with_alignment.c: This.
929 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
930 (plugin_layout_with_alignment): Likewise.
931 * testsuite/Makefile.in: Regenerated.
933 2016-03-08 Cary Coutant <ccoutant@gmail.com>
936 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
938 * testsuite/Makefile.in: Regenerate.
939 * testsuite/dynamic_list.sh: Likewise.
940 * testsuite/retain_symbols_file_test.sh: Likewise.
942 2016-03-08 Cary Coutant <ccoutant@gmail.com>
945 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
946 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
948 2016-03-08 Cary Coutant <ccoutant@gmail.com>
949 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
951 * output.cc (Output_reloc_writer): New type.
952 (Output_data_reloc_base::do_write): Move implementation to template
953 in output.h and replace with invocation of template.
954 * output.h (Output_file): Move to top of file.
955 (Output_reloc::get_symbol_index): Move to public interface.
956 (Output_reloc::get_address): Likewise.
957 (Output_data_reloc_base::do_write_generic): New function template.
959 2016-03-04 Cary Coutant <ccoutant@gmail.com>
963 * symtab.cc: Instantiate Sized_symbol::init_constant and
964 Sized_symbol::init_undefined.
966 2016-03-03 Cary Coutant <ccoutant@gmail.com>
969 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
970 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
971 * mips.cc (Target_mips::make_symbol): Adjust function signature.
972 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
973 (Target_sparc::do_is_defined_by_abi): Remove test for
975 (Target_sparc::Register_symbol): New struct type.
976 (Target_sparc::register_syms_): New data member.
977 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
978 (Target_sparc::make_symbol): New function.
979 (Target_sparc::do_finalize_sections): Add register symbols and new
980 dynamic table entries.
981 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
982 (Symbol_table::add_target_global_symbol): New function.
983 (Symbol_table::target_symbols_): New data member.
984 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
985 (Symbol_table::Symbol_table): Initialize target_symbols_.
986 (Symbol_table::add_from_object): Pass additional parameters to
988 (Symbol_table::define_special_symbol): Likewise.
989 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
990 undefined symbol value.
991 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
992 (Symbol_table::sized_finalize): Likewise.
993 (Symbol_table::sized_write_globals): Likewise.
994 * target.h (Sized_target::make_symbol): Add name, st_type, object,
995 st_shndx, and value parameters.
997 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
999 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
1000 LDPK_WEAKUNDEF symbols.
1002 2016-03-03 Than McIntosh <thanm@google.com>
1004 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
1005 and get_input_section_alignment in transfer vector.
1006 (get_input_section_alignment): New function.
1007 (get_input_section_size): New function.
1008 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
1009 * testsuite/Makefile.in: [Regenerate.]
1010 * testsuite/plugin_section_alignment.cc: New test file.
1011 * testsuite/plugin_layout_with_alignment.cc: New test file.
1012 * testsuite/plugin_layout_with_alignment.sh: New test file.
1014 2016-03-03 Evgenii Stepanov <eugenis@google.com>
1016 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1018 * plugin.cc (get_symbols_v3): New function.
1019 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
1020 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
1023 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
1024 Cary Coutant <ccoutant@gmail.com>
1027 * ehframe.h (Cie::fde_encoding): New method.
1028 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
1031 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
1033 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
1034 -mrelax-relocations=yes to $(TEST_AS).
1035 (x86_64_mov_to_lea6.o): Likewise.
1036 (x86_64_overflow_pc32.o): Remove duplicated target.
1037 * testsuite/Makefile.in: Regenerated.
1039 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
1041 * s390.cc (Target_s390::match_view_u): New helper method.
1042 (Target_s390::do_is_call_to_non_split): New method.
1043 (Target_s390::ss_code_st_r14): New const.
1044 (Target_s390::ss_code_l_r14): New const.
1045 (Target_s390::ss_code_bras_8): New const.
1046 (Target_s390::ss_code_l_basr): New const.
1047 (Target_s390::ss_code_a_basr): New const.
1048 (Target_s390::ss_code_ear): New const.
1049 (Target_s390::ss_code_c): New const.
1050 (Target_s390::ss_code_larl): New const.
1051 (Target_s390::ss_code_brasl): New const.
1052 (Target_s390::ss_code_jg): New const.
1053 (Target_s390::ss_code_jgl): New const.
1054 (Target_s390::ss_match_mcount): New helper method.
1055 (Target_s390::ss_match_l): New helper method.
1056 (Target_s390::ss_match_ahi): New helper method.
1057 (Target_s390::ss_match_alfi): New helper method.
1058 (Target_s390::ss_match_cr): New helper method.
1059 (Target_s390::do_calls_non_split): New method.
1060 * testsuite/Makefile.am: Added new tests.
1061 * testsuite/Makefile.in: Regenerate.
1062 * testsuite/split_s390.sh: New test.
1063 * testsuite/split_s390_1_a1.s: New test.
1064 * testsuite/split_s390_1_a2.s: New test.
1065 * testsuite/split_s390_1_n1.s: New test.
1066 * testsuite/split_s390_1_n2.s: New test.
1067 * testsuite/split_s390_1_z1.s: New test.
1068 * testsuite/split_s390_1_z2.s: New test.
1069 * testsuite/split_s390_1_z3.s: New test.
1070 * testsuite/split_s390_1_z4.s: New test.
1071 * testsuite/split_s390_2_ns.s: New test.
1072 * testsuite/split_s390_2_s.s: New test.
1073 * testsuite/split_s390x_1_a1.s: New test.
1074 * testsuite/split_s390x_1_a2.s: New test.
1075 * testsuite/split_s390x_1_n1.s: New test.
1076 * testsuite/split_s390x_1_n2.s: New test.
1077 * testsuite/split_s390x_1_z1.s: New test.
1078 * testsuite/split_s390x_1_z2.s: New test.
1079 * testsuite/split_s390x_1_z3.s: New test.
1080 * testsuite/split_s390x_1_z4.s: New test.
1081 * testsuite/split_s390x_2_ns.s: New test.
1082 * testsuite/split_s390x_2_s.s: New test.
1084 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
1086 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
1087 info message for every erratum 843419 found and fixed.
1089 2016-02-07 Cary Coutant <ccoutant@gmail.com>
1092 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
1093 information to relocation overflow errors.
1095 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1098 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
1099 overflow checking when symbol value + addend < 0.
1101 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1104 * reloc.h (Limits): New class.
1105 (Bits::has_overflow32): Use min/max values from Limits.
1106 (Bits::has_unsigned_overflow32): Likewise.
1107 (Bits::has_signed_unsigned_overflow32): Likewise.
1108 (Bits::has_overflow): Likewise.
1109 (Bits::has_unsigned_overflow): Likewise.
1110 (Bits::has_signed_unsigned_overflow64): Likewise.
1112 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1115 * reloc.h (Relocate_functions::Overflow_check): Add comments.
1116 * x86_64.cc (X86_64_relocate_functions): New class.
1117 (Target_x86_64::Relocate::relocate): Use the new class.
1118 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
1119 (x32_overflow_pc32): New test case.
1120 * testsuite/Makefile.in: Regenerate.
1121 * testsuite/x32_overflow_pc32.sh: New script.
1122 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
1124 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1127 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
1128 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
1130 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1133 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
1135 (Bits::has_unsigned_overflow): Likewise.
1137 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
1139 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
1141 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
1142 and view_size to is_call_to_non_split.
1143 * target.cc (Target::is_call_to_non_split): Add view and view_size
1145 * target.h (class Target): Likewise.
1147 2016-02-05 Sriraman Tallam <tmsriram@google.com>
1149 * icf.cc (get_rel_addend): New function.
1150 (get_section_contents): Move merge section addend computation to a
1151 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
1152 Fix bug to not read past the length of the section.
1154 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1155 Andrew Senkevich <andrew.senkevich@intel.com>
1158 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
1159 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
1161 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
1162 * testsuite/x86_64_overflow_pc32.sh: New test script.
1163 * testsuite/x86_64_overflow_pc32.s: New source file.
1165 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1168 * reloc.h (Relocate_functions::Address): New typedef.
1169 (Relocate_functions::Addendtype): New typedef.
1170 (Relocate_functions::Overflow_check): New enum type.
1171 (Relocate_functions::Reloc_status): New enum type.
1172 (Relocate_functions::check_overflow): New function template.
1173 (Relocate_functions::rel): Add check parameter; check for overflow.
1174 (Relocate_functions::rel_unaligned): Likewise.
1175 (Relocate_functions::rela): Likewise.
1176 (Relocate_functions::pcrel): Likewise.
1177 (Relocate_functions::pcrel_unaligned): Likewise.
1178 (Relocate_functions::pcrela): Likewise.
1179 (Relocate_functions::rel8): Adjust parameter types.
1180 (Relocate_functions::rela8): Likewise.
1181 (Relocate_functions::pcrel8): Likewise.
1182 (Relocate_functions::pcrela8): Likewise.
1183 (Relocate_functions::rel16): Likewise.
1184 (Relocate_functions::rela168): Likewise.
1185 (Relocate_functions::pcrel16): Likewise.
1186 (Relocate_functions::pcrela16): Likewise.
1187 (Relocate_functions::rel32): Likewise.
1188 (Relocate_functions::rel32_unaligned): Likewise.
1189 (Relocate_functions::rela32): Likewise.
1190 (Relocate_functions::pcrel32): Likewise.
1191 (Relocate_functions::pcrel32_unaligned): Likewise.
1192 (Relocate_functions::pcrela32): Likewise.
1193 (Relocate_functions::rel8_check): New function.
1194 (Relocate_functions::rela8_check): New function.
1195 (Relocate_functions::pcrel8_check): New function.
1196 (Relocate_functions::pcrela8_check): New function.
1197 (Relocate_functions::rel16_check): New function.
1198 (Relocate_functions::rela168_check): New function.
1199 (Relocate_functions::pcrel16_check): New function.
1200 (Relocate_functions::pcrela16_check): New function.
1201 (Relocate_functions::rel32_check): New function.
1202 (Relocate_functions::rel32_unaligned_check): New function.
1203 (Relocate_functions::rela32_check): New function.
1204 (Relocate_functions::pcrel32_check): New function.
1205 (Relocate_functions::pcrel32_unaligned_check): New function.
1206 (Relocate_functions::pcrela32_check): New function.
1207 (Bits::has_unsigned_overflow32): New function.
1208 (Bits::has_unsigned_overflow): New function.
1209 * testsuite/Makefile.am (overflow_unittest): New test.
1210 * testsuite/Makefile.in: Regenerate.
1211 * testsuite/overflow_unittest.cc: New source file.
1213 2016-02-04 Alan Modra <amodra@gmail.com>
1215 * powerpc.cc (relocate): Adjust last patch for big-endian.
1217 2016-02-02 Alan Modra <amodra@gmail.com>
1219 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
1221 2016-01-15 Han Shen <shenhan@google.com>
1223 PR gold/19472 - need pc-relative stubs.
1225 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
1226 stub type for DSOs and pie executables.
1228 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
1230 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
1233 2016-01-12 Cary Coutant <ccoutant@gmail.com>
1235 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
1236 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
1237 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
1238 specializations) New method.
1240 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1243 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
1244 we have a TLS segment for GD-to-IE optimization.
1245 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
1247 (Target_i386::tls_desc_gd_to_ie): Likewise.
1248 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
1249 for TLSDESC GD-to-IE optimizations.
1250 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
1252 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
1253 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
1254 for TLSDESC GD-to-IE optimizations.
1256 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1258 Refactor gold to enable support for MIPS-64 relocation format.
1260 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
1261 (gc_process_relocs): Remove sh_type template parameter.
1262 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
1263 * object.h (Sized_relobj_file::split_stack_adjust): Add target
1265 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
1266 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
1267 specializations) Remove.
1268 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
1269 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
1270 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
1271 (Sized_relobj_file::split_stack_adjust): Add target parameter.
1273 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
1274 Target::get_r_sym() to get r_sym field from relocations.
1275 (Track_relocs::next_symndx): Call Target::get_r_sym().
1276 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
1277 add Classify_reloc template parameter. Use for accessing r_sym and
1279 (relocate_section): Likewise.
1280 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
1281 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
1282 (Default_scan_relocatable_relocs::Reltype): New typedef.
1283 (Default_scan_relocatable_relocs::reloc_size): New const.
1284 (Default_scan_relocatable_relocs::sh_type): New const.
1285 (Default_scan_relocatable_relocs::get_r_sym): New method.
1286 (Default_scan_relocatable_relocs::get_r_type): New method.
1287 (Default_emit_relocs_strategy): New class.
1288 (scan_relocatable_relocs): Replace sh_type template parameter with
1289 Scan_relocatable_relocs class. Use it to access r_sym and r_type
1291 (relocate_relocs): Replace sh_type template parameter with
1292 Classify_reloc class. Use it to access r_sym and r_type fields.
1293 * target.h (Target::is_call_to_non_split): Replace r_type parameter
1294 with pointer to relocation. Adjust all callers.
1295 (Target::do_is_call_to_non_split): Likewise.
1296 (Target::emit_relocs_scan): New virtual method.
1297 (Sized_target::get_r_sym): New virtual method.
1298 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
1299 with pointer to relocation.
1301 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
1302 (Target_aarch64::Relocatable_size_for_reloc): Remove.
1303 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
1304 (Target_aarch64::scan_relocs): Likewise.
1305 (Target_aarch64::relocate_section): Likewise.
1306 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
1308 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
1309 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
1310 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
1312 (Target_arm::emit_relocs_scan): New method.
1313 (Target_arm::Relocatable_size_for_reloc): Replace with...
1314 (Target_arm::Classify_reloc): ...this.
1315 (Target_arm::gc_process_relocs): Use Classify_reloc.
1316 (Target_arm::scan_relocs): Likewise.
1317 (Target_arm::relocate_section): Likewise.
1318 (Target_arm::scan_relocatable_relocs): Likewise.
1319 (Target_arm::relocate_relocs): Likewise.
1320 * i386.cc (Target_i386::emit_relocs_scan): New method.
1321 (Target_i386::Relocatable_size_for_reloc): Replace with...
1322 (Target_i386::Classify_reloc): ...this.
1323 (Target_i386::gc_process_relocs): Use Classify_reloc.
1324 (Target_i386::scan_relocs): Likewise.
1325 (Target_i386::relocate_section): Likewise.
1326 (Target_i386::scan_relocatable_relocs): Likewise.
1327 (Target_i386::relocate_relocs): Likewise.
1328 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
1330 (Mips_reloc_types): New class template.
1331 (Mips_classify_reloc): New class template.
1332 (Target_mips::Reltype): New typedef.
1333 (Target_mips::Relatype): New typedef.
1334 (Target_mips::emit_relocs_scan): New method.
1335 (Target_mips::get_r_sym): New method.
1336 (Target_mips::Relocatable_size_for_reloc): Replace with
1337 Mips_classify_reloc.
1338 (Target_mips::copy_reloc): Use Mips_classify_reloc.
1339 (Target_mips::gc_process_relocs): Likewise.
1340 (Target_mips::scan_relocs): Likewise.
1341 (Target_mips::relocate_section): Likewise.
1342 (Target_mips::scan_relocatable_relocs): Likewise.
1343 (Target_mips::relocate_relocs): Likewise.
1344 (mips_get_size_for_reloc): New function, factored out from
1345 Relocatable_size_for_reloc::get_size_for_reloc.
1346 (Target_mips::Scan::local): Use Mips_classify_reloc.
1347 (Target_mips::Scan::global): Likewise.
1348 (Target_mips::Relocate::relocate): Likewise.
1349 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
1350 (Target_powerpc::Relocatable_size_for_reloc): Remove.
1351 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
1352 (Target_powerpc::scan_relocs): Likewise.
1353 (Target_powerpc::relocate_section): Likewise.
1354 (Powerpc_scan_relocatable_reloc): Convert to class template.
1355 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
1356 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
1357 (Powerpc_scan_relocatable_reloc::sh_type): New const.
1358 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
1359 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
1360 (Target_powerpc::scan_relocatable_relocs): Use
1361 Powerpc_scan_relocatable_reloc.
1362 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
1363 * s390.cc (Target_s390::emit_relocs_scan): New method.
1364 (Target_s390::Relocatable_size_for_reloc): Remove.
1365 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
1366 (Target_s390::scan_relocs): Likewise.
1367 (Target_s390::relocate_section): Likewise.
1368 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
1370 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
1371 (Target_s390::relocate_relocs): Use Default_classify_reloc.
1372 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
1373 (Target_sparc::Relocatable_size_for_reloc): Remove.
1374 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
1375 (Target_sparc::scan_relocs): Likewise.
1376 (Target_sparc::relocate_section): Likewise.
1377 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
1379 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
1380 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
1381 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
1382 (Target_tilegx::Relocatable_size_for_reloc): Remove.
1383 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
1384 (Target_tilegx::scan_relocs): Likewise.
1385 (Target_tilegx::relocate_section): Likewise.
1386 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
1388 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
1389 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
1390 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
1391 (Target_x86_64::Relocatable_size_for_reloc): Remove.
1392 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
1393 (Target_x86_64::scan_relocs): Likewise.
1394 (Target_x86_64::relocate_section): Likewise.
1395 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1397 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
1398 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
1400 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
1402 2016-01-01 Alan Modra <amodra@gmail.com>
1404 Update year range in copyright notice of all files.
1406 For older changes see ChangeLog-0815
1408 Copyright (C) 2016 Free Software Foundation, Inc.
1410 Copying and distribution of this file, with or without modification,
1411 are permitted in any medium without royalty provided the copyright
1412 notice and this notice are preserved.
1418 version-control: never