1 2016-12-13 Cary Coutant <ccoutant@gmail.com>
4 * options.h (--orphan-handling): New option.
5 (General_options::Orphan_handling): New enum.
6 (General_options::orphan_handling_enum): New method.
7 (General_options::set_orphan_handling_enum): New method.
8 (General_options::orphan_handling_enum_): New data member.
9 * options.cc (General_options::General_options): Initialize new member.
10 (General_options::finalize): Convert --orphan-handling argument to enum.
11 * script-sections.cc (Script_sections::output_section_name): Check it.
13 2016-12-13 Cary Coutant <ccoutant@gmail.com>
16 * layout.cc (Layout::choose_output_section): Add is_reloc parameter.
17 Adjust all callers. Do not use linker script for is_reloc sections.
18 (Layout::layout_reloc): Pass is_reloc == true.
19 * layout.h (Layout::choose_output_section): Add is_reloc parameter.
21 2016-12-12 Igor Kudrin <ikudrin@accesssoftek.com>
22 Cary Coutant <ccoutant@gmail.com>
25 * script-sections.cc (Output_section_definition::output_section_name):
26 For linker-generated sections, compare with output section name.
27 * testsuite/Makefile.am (script_test_13): New test.
28 * testsuite/Makefile.in: Regenerate.
29 * testsuite/script_test_13.c: New source file.
30 * testsuite/script_test_13.sh: New script.
31 * testsuite/script_test_13.t: New linker script.
33 2016-12-12 Cary Coutant <ccoutant@gmail.com>
35 * script-sections.cc (Orphan_section_placement::update_last_alloc):
37 (Orphan_section_placement::find_place): Place orphan .data section
38 after either RODATA or TEXT.
39 (Script_sections::place_orphan): Call update_last_alloc for allocated
41 (Script_sections::create_segments): Improve handling of BSS.
43 2016-12-13 Alan Modra <amodra@gmail.com>
46 * testsuite/script_test_15a.sh: Allows larger p_filesz.
47 * testsuite/script_test_15b.sh: Likewise.
48 * testsuite/script_test_15c.sh: Likewise.
50 2016-12-13 Alan Modra <amodra@gmail.com>
53 * testsuite/pr20717.t: Add .got output section containing .toc.
55 2016-12-11 Igor Kudrin <ikudrin@accesssoftek.com>
58 * testsuite/Makefile.am (pr20717): New test.
59 * testsuite/Makefile.in: Regenerate.
60 * testsuite/pr20717.c: New test source file.
61 * testsuite/pr20717.sh: New test script.
62 * testsuite/pr20717.t: New test linker script.
64 2016-12-11 Cary Coutant <ccoutant@gmail.com>
67 * output.cc (Output_section::set_final_data_size): Calculate data size
68 based on relative offset rather than file offset.
69 (Output_segment::set_section_addresses): Track file offset separately
71 (Output_segment::set_section_list_addresses): Add pfoff parameter.
72 Track file offset separately. Don't move file offset for BSS
74 * output.h (Output_segment::set_section_list_addresses): Add pfoff
76 * script-sections.cc (Orphan_section_placement): Add PLACE_LAST_ALLOC.
77 (Orphan_section_placement::Orphan_section_placement): Initialize it.
78 (Orphan_section_placement::output_section_init): Track last allocated
80 (Orphan_section_placement::find_place): Place BSS after last allocated
82 (Output_section_element_input::set_section_addresses): Always override
83 input section alignment when SUBALIGN is specified.
84 (Output_section_definition::set_section_addresses): Override alignment
85 of output section when SUBALIGN is specified.
87 * testsuite/Makefile.am (script_test_15a, script_test_15b)
88 (script_test_15c): New test cases.
89 * testsuite/Makefile.in: Regenerate.
90 * testsuite/script_test_2.cc: Adjust expected layout.
91 * testsuite/script_test_15.c: New source file.
92 * testsuite/script_test_15a.sh: New shell script.
93 * testsuite/script_test_15a.t: New linker script.
94 * testsuite/script_test_15b.sh: New shell script.
95 * testsuite/script_test_15b.t: New linker script.
96 * testsuite/script_test_15c.sh: New shell script.
97 * testsuite/script_test_15c.t: New linker script.
99 2016-12-08 Alan Modra <amodra@gmail.com>
101 * powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather
104 2016-12-08 Alan Modra <amodra@gmail.com>
106 * options.h (--stub-group-multi): Fix typo.
108 2016-12-07 Alan Modra <amodra@gmail.com>
110 * options.h (--stub-group-multi): New PowerPC option.
111 * powerpc.cc (Stub_control): Add multi_os_ var and param
112 to constructor. Sort start_ var later. Comment State.
113 (Stub_control::can_add_to_stub_group): Heed multi_os_.
114 (Target_powerpc::group_sections): Update.
116 2016-12-07 Alan Modra <amodra@gmail.com>
119 * powerpc.cc (Stub_control): Replace stubs_always_before_branch_
120 with stubs_always_after_branch_, group_end_addr_ with
122 (Stub_control::can_add_to_stub_group): Rewrite to suit scanning
123 sections by increasing address.
124 (Target_powerpc::group_sections): Scan that way. Delete corner
126 * options.h (--stub-group-size): Update help string.
128 2016-12-07 Alan Modra <amodra@gmail.com>
130 * powerpc.cc (Stub_table_owner): Provide constructor.
131 (Powerpc_relobj::set_stub_table): Resize fill with -1.
132 (Target_powerpc::Branch_info::make_stub): Provide target debug
133 output on returning false.
135 2016-12-05 Cary Coutant <ccoutant@gmail.com>
136 Tristan Gingold <gingold@adacore.com>
138 * object.cc (Sized_relobj_file::do_count_local_symbols): Check
139 is_ordinary before using shndx.
140 * testsuite/Makefile.am (file_in_many_sections_test.sh): New test case.
141 * testsuite/Makefile.in: Regenerate.
142 * testsuite/file_in_many_sections.c: New source file.
143 * testsuite/file_in_many_sections_test.sh: New script.
145 2016-12-01 Cary Coutant <ccoutant@gmail.com>
146 Igor Kudrin <ikudrin@accesssoftek.com>
149 * script-sections.cc (Script_sections): Set *keep to false when
152 2016-12-01 Cary Coutant <ccoutant@gmail.com>
155 * target.h (Target::default_text_segment_address): Bump default
156 start address up to ABI page size.
158 2016-12-01 Cary Coutant <ccoutant@gmail.com>
161 * options.cc (General_options::object_format_to_string): New function.
162 (General_options::copy_from_posdep_options): New function.
163 (General_options::parse_push_state): New function.
164 (General_options::parse_pop_state): New function.
165 * options.h (--push-state, --pop-state): New options.
166 (General_options::object_format_to_string): New method.
167 (General_options::set_incremental_disposition): New method.
168 (General_options::copy_from_posdep_options): New method.
169 (General_options::options_stack_): New data member.
171 2016-12-01 Cary Coutant <ccoutant@gmail.com>
174 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
175 section symbols correctly.
176 * arm.cc (Target_arm): Likewise.
177 * powerpc.cc (Target_powerpc): Likewise.
179 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
181 * aarch64-reloc.def: Fix spelling in comments.
183 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
185 * aarch64.cc: Fix spelling in comments.
186 * arm.cc: Fix spelling in comments.
187 * icf.cc: Fix spelling in comments.
188 * layout.cc: Fix spelling in comments.
189 * layout.h: Fix spelling in comments.
190 * mips.cc: Fix spelling in comments.
191 * output.h: Fix spelling in comments.
192 * plugin.h: Fix spelling in comments.
193 * script-sections.h: Fix spelling in comments.
194 * script.h: Fix spelling in comments.
195 * stringpool.h: Fix spelling in comments.
196 * tilegx.cc: Fix spelling in comments.
198 2016-11-22 Cary Coutant <ccoutant@gmail.com>
201 * options.cc (One_option::print): Print "(default)" when appropriate.
202 * options.h: Clean up and re-sort options.
203 (One_option::is_default): New data member.
204 (One_option::One_option): Add is_default parameter; adjust all calls.
205 (DEFINE_var): Add is_default__ parameter; adjust all calls.
206 (DEFINE_bool): Set is_default based on default_value__.
207 (DEFINE_bool_ignore): New macro.
208 (--no-eh-frame-hdr): New option.
209 (--enable-new-dtags): Remove mention of DT_FLAGS.
211 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
213 * configure: Regenerate.
215 2016-11-21 Cary Coutant <ccoutant@gmail.com>
218 * gold.cc (queue_middle_tasks): Force valid target earlier.
220 2016-11-21 Igor Kudrin <ikudrin@accesssoftek.com>
222 * layout.cc: Include windows.h and rpcdce.h (for MinGW32).
223 (Layout::create_build_id): Generate uuid using UuidCreate().
225 2016-11-04 Loïc Yhuel <loic.yhuel@softathome.com>
227 * configure.ac: add missing '$'.
228 * configure: Regenerate.
230 2016-10-21 Gergely Nagy <ngg@tresorit.com>
233 * icf.cc (match_sections): Add new parameter section_addraligns.
234 Check section alignment and keep the section with the strictest
236 (find_identical_sections): New local variable section_addraligns.
237 Store each section's alignment.
238 * testsuite/pr17704a_test.s: New file.
239 * testsuite/Makefile.am (pr17704a_test): New test.
240 * testsuite/Makefile.in: Regenerate.
242 2016-10-06 Alan Modra <amodra@gmail.com>
244 * powerpc.cc (Target_powerpc::Relocate::relocate): Add fall
246 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
248 2016-10-06 Alan Modra <amodra@gmail.com>
250 * aarch64.cc: Spell fall through comments as "// Fall through.".
253 * powerpc.cc: Likewise.
255 * sparc.cc: Likewise.
256 * x86_64.cc: Likewise.
257 * powerpc.cc (Target_powerpc::Relocate::relocate): Add missing
258 fall through comments.
259 * sparc.cc: (Target_sparc::Scan::global): Likewise.
260 (Target_sparc::Relocate::relocate): Likewise.
261 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
262 * resolve.cc (symbol_to_bits): Add missing break.
264 2016-09-26 Cary Coutant <ccoutant@gmail.com>
267 * symtab.cc (Symbol_table::define_default_version): Check that
268 unversioned symbol is defined.
270 2016-09-26 Vlad Zakharov <vzakhar@synopsys.com>
272 * Makefile.in: Regenerate.
273 * configure: Likewise.
274 * testsuite/Makefile.in: Likewise.
276 2016-09-26 Alan Modra <amodra@gmail.com>
278 * aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid
280 * output.cc (Output_segment::set_section_addresses): Likewise.
281 * testsuite/Makefile.in: Regenerate.
283 2016-09-02 Doug Kwan <dougkwan@google.com>
285 * arm.cc (Target_arm::Target_arm): Move method definition outside of
286 class definition. Add code to handle --target1-rel, --target1-abs
287 and --target2= options.
288 (Target_arm::get_reloc_reloc_type): Change method to be non-static
290 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
292 (Target_arm::Scan::local, Target_arm::Scan::global,
293 Target_arm::Relocate::relocate,
294 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
295 call to Target_arm::get_real_reloc_type.
296 (Target_arm::get_real_reloc_type): Use command line options to
297 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
298 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
301 2016-08-31 Alan Modra <amodra@gmail.com>
303 * powerpc.cc (class Stub_control): Delete stub14_group_size_
304 and has14_. Add group_size_.
305 (Stub_control::can_add_to_stub_group): Adjust to suit. Print
306 debug info when switching to adding sections before stubs.
308 2016-08-31 Alan Modra <amodra@gmail.com>
310 * debug.h (DEBUG_TARGET): New.
311 (DEBUG_ALL): Add DEBUG_TARGET.
312 (gold_debug): Delete FORMAT param.
313 * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
315 2016-08-30 Alan Modra <amodra@gmail.com>
318 * powerpc.cc (class Stub_control): Add has14_. Comment owner_.
319 (Stub_control::can_add_to_stub_group): Correct grouping of
320 sections containing 14-bit external branches. When returning
321 false, set state_ to reflect the fact that we have one section
322 for the next group. Rewrite most of function for clarity.
323 Add and expand comments.
324 (Target_powerpc::do_relax): Print stub group size retry in hex.
326 2016-08-26 Han Shen <shenhan@google.com>
328 PR gold/20529 - relaxing loop never ends.
330 * powerpc.cc (Stub_table::min_size_threshold_): New member to
332 (Stub_table::set_min_size_threshold): New member function.
333 (Stub_table::set_address_and_size): Add code to only allow size
335 (Target_powerpc::do_relax): Add code to record last size.
337 2016-08-23 Roland McGrath <roland@hack.frob.com>
339 * options.h (General_options): Grok -z stack-size.
340 * output.h (Output_segment::set_size): New method.
341 * layout.cc (Layout::create_executable_stack_info): Renamed to ...
342 (Layout::create_stack_segment): ... this. Always create the
343 segment if -z stack-size was used.
344 (Layout::set_segment_offsets): Don't call ->set_offset on the
345 PT_GNU_STACK segment.
347 2016-08-15 Bharathi Seshadri <bseshadr@cisco.com>
349 * options.h (General_options): Add --be8 option.
350 * arm.cc (Arm_relobj::do_relocate_sections): Add code to swap for be8.
351 (Output_data_plt_arm_standard::do_fill_first_plt_entry): Likewise.
352 (Output_data_plt_arm_short::do_fill_plt_entry): Likewise.
353 (Output_data_plt_arm_long::do_fill_plt_entry): Likewise.
354 (Target_arm::do_adjust_elf_header): Do EF_ARM_BE8 adjustment.
356 2016-08-17 Cary Coutant <ccoutant@gmail.com>
358 * i386.cc (Target_i386): Reset skip_call_tls_get_addr_ after printing
360 * testsuite/Makefile.am (pr20216a): Add missing dependencies.
361 (pr20308a): Add -Bgcctestdir/ to compile rules.
362 * testsuite/Makefile.in: Regenerate.
364 2016-08-12 Roland McGrath <roland@hack.frob.com>
367 * script-sections.cc (Script_sections::release_segments):
368 Reset this->segments_created_.
370 2016-08-12 Roland McGrath <roland@hack.frob.com>
372 * yyscript.y (HIDDEN): New %token.
373 (assignment): Handle HIDDEN(string = expr) syntax.
374 * script.cc (script_keyword_parsecodes): Add HIDDEN.
376 2016-08-10 Cary Coutant <ccoutant@gmail.com>
379 * x86_64.cc (Target_x86_64::Relocate::relocate): Add check for
380 R_X86_64_GOTPCREL. Reset skip_call_tls_get_addr_ after printing
382 * testsuite/Makefile.am (pr20216_gd.o): Add -Bgcctestdir/.
383 (pr20216_ld.o): Likewise.
384 * testsuite/Makefile.in: Regenerate.
386 2016-08-10 James Clarke <jrtc27@jrtc27.com>
389 * symtab.cc (Symbol_table::add_from_relobj): Handle NULL symbols,
390 which will be present for STT_SPARC_REGISTER.
391 (Symbol_table::add_from_pluginobj): Likewise.
392 (Symbol_table::add_from_dynobj): Likewise.
393 (Symbol_table::add_from_incrobj): Removed dead code.
395 2016-08-10 James Clarke <jrtc27@jrtc27.com>
398 * sparc.cc (Target_sparc::Relocate::relocate): R_SPARC_GOTDATA_OP_LOX10
399 should fall back on R_SPARC_GOT10, not R_SPARC_GOT13.
401 2016-08-10 James Clarke <jrtc27@jrtc27.com>
404 * sparc.cc (Target_sparc::Scan::check_non_pic): Allow R_SPARC_32 on
407 2016-06-29 Cary Coutant <ccoutant@gmail.com>
410 * testsuite/dynamic_list.sh: Remove check for _ZdlPv.
412 2016-06-29 Cary Coutant <ccoutant@gmail.com>
414 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add eh_test_2.
415 * testsuite/Makefile.in: Regenerate.
417 2016-06-30 Alan Modra <amodra@gmail.com>
419 * testsuite/Makefile.am (memory_test, memory_test_2): Pass
420 -Wl,-z to gcc, not plain -z.
421 * testsuite/Makefile.in: Regenerate.
423 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
426 * i386.cc (Target_i386::Relocate::relocate): Allow
427 R_386_GOT32X relocation against ___tls_get_addr.
428 (Target_i386::Relocate::tls_gd_to_ie): Support indirect
429 call to __tls_get_addr.
430 (Target_i386::Relocate::tls_gd_to_le): Likewise.
431 (Target_i386::Relocate::tls_ld_to_le): Likewise.
432 * testsuite/Makefile.am (check_PROGRAMS): Add pr20308a_test,
433 pr20308b_test, pr20308c_test, pr20308d_test, pr20308e_test.
434 (pr20308a_test_SOURCES): New.
435 (pr20308a_test_DEPENDENCIES): Likewise.
436 (pr20308a_test_CFLAGS): Likewise.
437 (pr20308a_test_LDFLAGS): Likewise.
438 (pr20308a_test_LDADD): Likewise.
439 (pr20308b_test_SOURCES): Likewise.
440 (pr20308b_test_DEPENDENCIES): Likewise.
441 (pr20308b_test_CFLAGS): Likewise.
442 (pr20308b_test_LDFLAGS): Likewise.
443 (pr20308b_test_LDADD): Likewise.
444 (pr20308c_test_SOURCES): Likewise.
445 (pr20308c_test_DEPENDENCIES): Likewise.
446 (pr20308c_test_CFLAGS): Likewise.
447 (pr20308c_test_LDFLAGS): Likewise.
448 (pr20308c_test_LDADD): Likewise.
449 (pr20308d_test_SOURCES): Likewise.
450 (pr20308d_test_DEPENDENCIES): Likewise.
451 (pr20308d_test_CFLAGS): Likewise.
452 (pr20308d_test_LDFLAGS): Likewise.
453 (pr20308d_test_LDADD): Likewise.
454 (pr20308e_test_SOURCES): Likewise.
455 (pr20308e_test_DEPENDENCIES): Likewise.
456 (pr20308e_test_CFLAGS): Likewise.
457 (pr20308e_test_LDFLAGS): Likewise.
458 (pr20308e_test_LDADD): Likewise.
459 (pr20308a.so): Likewise.
460 (pr20308b.so): Likewise.
461 (pr20308_gd.o): Likewise.
462 (pr20308_ld.o): Likewise.
463 (MOSTLYCLEANFILES): Add pr20308a.so pr20308b.so.
464 * testsuite/Makefile.in: Regenerated.
465 * testsuite/pr20308_def.c: New file.
466 * testsuite/pr20308_gd.S: Likewise.
467 * testsuite/pr20308_ld.S: Likewise.
468 * testsuite/pr20308_main.c: Likewise.
470 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
473 * configure.ac (DEFAULT_TARGET_X86_64_OR_X32): New
475 * configure: Regenerated.
476 * x86_64.cc (Target_x86_64<size>::Relocate::relocate): Allow
477 R_X86_64_GOTPCRELX relocation against __tls_get_addr.
478 (Target_x86_64<size>::Relocate::tls_gd_to_ie): Support indirect
479 call to __tls_get_addr.
480 (Target_x86_64<size>::Relocate::tls_gd_to_le): Likewise.
481 (Target_x86_64<size>::Relocate::tls_ld_to_le): Likewise.
482 * testsuite/Makefile.am (check_PROGRAMS): Add pr20216a_test,
483 pr20216b_test, pr20216c_test, pr20216d_test, pr20216e_test.
484 (pr20216a_test_SOURCES): New.
485 (pr20216a_test_DEPENDENCIES): Likewise.
486 (pr20216a_test_CFLAGS): Likewise.
487 (pr20216a_test_LDFLAGS): Likewise.
488 (pr20216a_test_LDADD): Likewise.
489 (pr20216b_test_SOURCES): Likewise.
490 (pr20216b_test_DEPENDENCIES): Likewise.
491 (pr20216b_test_CFLAGS): Likewise.
492 (pr20216b_test_LDFLAGS): Likewise.
493 (pr20216b_test_LDADD): Likewise.
494 (pr20216c_test_SOURCES): Likewise.
495 (pr20216c_test_DEPENDENCIES): Likewise.
496 (pr20216c_test_CFLAGS): Likewise.
497 (pr20216c_test_LDFLAGS): Likewise.
498 (pr20216c_test_LDADD): Likewise.
499 (pr20216d_test_SOURCES): Likewise.
500 (pr20216d_test_DEPENDENCIES): Likewise.
501 (pr20216d_test_CFLAGS): Likewise.
502 (pr20216d_test_LDFLAGS): Likewise.
503 (pr20216d_test_LDADD): Likewise.
504 (pr20216e_test_SOURCES): Likewise.
505 (pr20216e_test_DEPENDENCIES): Likewise.
506 (pr20216e_test_CFLAGS): Likewise.
507 (pr20216e_test_LDFLAGS): Likewise.
508 (pr20216e_test_LDADD): Likewise.
509 (pr20216a.so): Likewise.
510 (pr20216b.so): Likewise.
511 (pr20216_gd.o): Likewise.
512 (pr20216_ld.o): Likewise.
513 (MOSTLYCLEANFILES): Add pr20216a.so pr20216b.so.
514 * testsuite/Makefile.in: Regenerated.
515 * testsuite/pr20216_def.c: New file.
516 * testsuite/pr20216_gd.S: Likewise.
517 * testsuite/pr20216_ld.S: Likewise.
518 * testsuite/pr20216_main.c: Likewise.
520 2016-06-29 Alan Modra <amodra@gmail.com>
522 * script_test_12.t: Delete .plt, specify 64k page size.
523 * script_test_12i.t: Likewise.
525 2016-06-29 Alan Modra <amodra@gmail.com>
527 * testsuite/plugin_layout_with_alignment.c: Explicitly align all
530 2016-06-29 Alan Modra <amodra@gmail.com>
532 * testsuite/Makefile.am (copy_test_protected): Disable for powerpc.
533 * testsuite/Makefile.in: Regenerate.
535 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
537 * aarch64-reloc.def (NONE): New relocation.
538 * aarch64.cc (Target_aarch64::Scan::local): Handle R_AARCH64_NONE.
539 (Target_aarch64::Scan::global): Likewise.
540 * testsuite/Makefile.am (aarch64_reloc_none): New test.
541 * testsuite/Makefile.in: Regenerate.
542 * testsuite/aarch64_reloc_none.s: New test source file.
543 * testsuite/aarch64_reloc_none.sh: New test script.
545 2016-06-28 Sriraman Tallam <tmsriram@google.com>
547 * x86_64.cc (Lazy_view): New class.
548 (can_convert_mov_to_lea): Templatize function. Make the function
549 check for appropriate relocation types and use the view parameter
550 to get section contents.
551 (can_convert_callq_to_direct): New function.
552 (Target_x86_64<size>::Scan::global): Refactor.
553 (Target_x86_64<size>::Relocate::relocate): Refactor. Change any indirect
554 call via GOT that can be converted.
555 * testsuite/Makefile.am (x86_64_indirect_call_to_direct.sh): New test.
556 * testsuite/Makefile.in: Regenerate.
557 * testsuite/x86_64_indirect_call_to_direct1.s: New file.
558 * testsuite/x86_64_indirect_jump_to_direct1.s: New file.
560 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
562 * aarch64.cc (Target_aarch64::Scan::local): Move the call to got_section
563 from the top level to the places of its use.
565 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
568 * script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
569 * script-sections.cc (Input_section_sorter::get_init_priority): New method.
570 (Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
571 (Output_section_element_input::print): Likewise.
572 * script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
573 * yyscript.y (SORT_BY_INIT_PRIORITY): New token.
574 (wildcard_section): Handle SORT_BY_INIT_PRIORITY.
576 * testsuite/Makefile.am (script_test_14): New test.
577 * testsuite/Makefile.in: Regenerate.
578 * testsuite/script_test_14.s: New test source file.
579 * testsuite/script_test_14.sh: New test script.
580 * testsuite/script_test_14.t: New test linker script.
582 2016-06-28 James Clarke <jrtc27@jrtc27.com>
584 * sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
585 to R_SPARC_RELATIVE if class is ELFCLASS64.
586 (Target_sparc::Scan::global): Likewise.
588 2016-06-23 Cary Coutant <ccoutant@gmail.com>
589 Igor Kudrin <ikudrin@accesssoftek.com>
593 (Output_section_element_input::set_section_addresses): Keep bin_count
594 separate from input_pattern_count.
595 * testsuite/script_test_12.t: Add another section .x4.
596 * testsuite/script_test_12i.t: Likewise.
597 * testsuite/script_test_12a.c: Likewise.
598 * testsuite/script_test_12b.c: Likewise.
600 2016-06-23 Igor Kudrin <ikudrin@accesssoftek.com>
602 * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
604 2016-06-22 H.J. Lu <hongjiu.lu@intel.com>
607 * NEWS: Mention --enable-relro.
608 * configure.ac: Add --enable-relro.
609 (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
611 * config.in: Regenerated.
612 * configure: Likewise.
613 * options.h (General_options::relro): Default to
616 2016-06-20 Cary Coutant <ccoutant@gmail.com>
618 * NEWS: Add new features in 1.12.
619 * version.cc (version_string): Bump to 1.12.
621 2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
624 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if
626 (Target_i386::plt_entry_size): Likewise.
627 (Target_x86_64<size>::first_plt_entry_offset): Likewise.
628 (Target_x86_64<size>::plt_entry_size): Likewise.
630 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
632 * mips.cc (Target_mips::Target_mips): Initialize rld_map_.
633 (Target_mips::rld_map_): New data member.
634 (Target_mips::do_finalize_sections): Add support for
635 DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
636 .rld_map section, and __RLD_MAP symbol.
637 (Target_mips::do_dynamic_tag_custom_value): Add support for
638 DT_MIPS_RLD_MAP_REL dynamic tag.
639 * output.cc (Output_data_dynamic::get_entry_offset): New method
641 * output.h (Output_data_dynamic::get_entry_offset): New method
644 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
646 * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
648 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
650 * mips.cc (relocation_needs_la25_stub): Add support for relocs:
651 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
652 (hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
653 (is_matching_lo16_reloc): Likewise.
654 (lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
655 (Mips_output_data_plt::plt_entry_r6): New static data member for
657 (Target_mips::is_output_r6): New method.
658 (Target_mips::Mips_mach): Add new enum constants.
659 (Mips_relocate_functions::Status): Likewise.
660 (Mips_relocate_functions::pchi16_relocs): New static data member.
661 (Mips_relocate_functions::relpc21): New method.
662 (Mips_relocate_functions::relpc26): Likewise.
663 (Mips_relocate_functions::relpc18): Likewise.
664 (Mips_relocate_functions::relpc19): Likewise.
665 (Mips_relocate_functions::relpchi16): Likewise.
666 (Mips_relocate_functions::do_relpchi16): Likewise.
667 (Mips_relocate_functions::relpclo16): Likewise.
668 (Mips_output_data_plt::do_write): Add support for Mips r6 plt
670 (Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
671 (Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
672 E_MIPS_ARCH_64R6 support.
673 (Target_mips::update_abiflags_isa): Likewise.
674 (mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
675 R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
677 (Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
679 (Target_mips::Scan::global): Add support for relocs:
680 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
681 (Target_mips::Relocate::relocate): Call functions for resolving
682 Mips32r6 and Mips64r6 relocations, and print error message for
683 STATUS_PCREL_UNALIGNED.
684 (Target_mips::Scan::get_reference_flags): Add support for relocs:
685 R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
686 R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
687 (Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
688 E_MIPS_ARCH_64R6 support.
690 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
693 * testsuite/script_test_2.t: Add .got.plt after .got.
695 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
697 * mips.cc (struct Mips_abiflags): New struct.
698 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
700 (Mips_relobj::~Mips_relobj): Delete object pointed by
701 attributes_section_data_.
702 (Mips_relobj::abiflags): New method.
703 (Mips_relobj::attributes_section_data): Likewise.
704 (Mips_relobj::attributes_section_data_): New data member.
705 (Mips_relobj::abiflags_): Likewise.
706 (class Mips_output_section_abiflags): New class.
707 (Target_mips::Target_mips): Initialize attributes_section_data_,
708 abiflags_ and has_abiflags_section_.
709 (Target_mips::do_should_include_section): Don't emit input
710 .MIPS.abiflags sections to output .MIPS.abiflags.
711 (Target_mips::Mips_mach): Add new enum constants.
712 (Target_mips::mips_isa_ext_mach): New method.
713 (Target_mips::mips_isa_ext): Likewise.
714 (Target_mips::update_abiflags_isa): Likewise.
715 (Target_mips::infer_abiflags): Likewise.
716 (Target_mips::create_abiflags): Likewise.
717 (Target_mips::fp_abi_string): Likewise.
718 (Target_mips::select_fp_abi): Likewise.
719 (Target_mips::merge_obj_attributes): Likewise.
720 (Target_mips::merge_obj_abiflags): Likewise.
721 (Target_mips::level_rev): Likewise.
722 (Target_mips::merge_obj_e_flags): Rename from
723 merge_processor_specific_flags. Remove dyn_obj argument,
724 call update_abiflags_isa when needed, compare NaN encodings and
726 (Target_mips::add_machine_extensions): Add two machine extensions
728 (Target_mips::attributes_section_data_): New data member.
729 (Target_mips::abiflags_): Likewise.
730 (Target_mips::has_abiflags_section_): Likewise.
731 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
732 .MIPS.abiflags sections if they exists.
733 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
734 E_MIPS_MACH_OCTEON3 support.
735 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
736 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
737 .MIPS.abiflags sections from input. Create these sections if
739 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
740 E_MIPS_MACH_OCTEON3 support, and change strings for
741 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
744 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
746 * mips.cc (Mips_relobj::Mips_relobj): Initialize
747 has_reginfo_section_.
748 (Mips_relobj::has_reginfo_section_): New data member.
749 (Mips_relobj::has_reginfo_section): New method.
750 (class Mips_output_section_reginfo): Change base class to
751 Output_section_data, and set masks of the output .reginfo section
753 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
755 (Mips_output_section_reginfo::set_masks): Likewise.
756 (Mips_output_section_reginfo::set_final_data_size): Likewise.
757 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
758 (Target_mips::do_make_output_section): Remove.
759 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
760 if the object contains a .reginfo section.
761 (Target_mips::do_finalize_sections): Create a .reginfo output
764 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
766 * mips.cc (Mips_output_data_got::do_write): Add missing template
769 2016-05-30 Marcin Kościelnicki <koriakin@0x04.net>
772 * s390.cc (Target_s390::ss_code_st_r14): Removed.
773 (Target_s390::ss_code_l_r14): Removed.
774 (Target_s390::ss_code_ear): Removed.
775 (Target_s390::ss_code_c): Removed.
776 (Target_s390::ss_match_st_r14): New function.
777 (Target_s390::ss_match_l_r14): New function.
778 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
779 of matching code directly.
780 (Target_s390::ss_match_ear): New function.
781 (Target_s390::ss_match_c): New function.
782 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
783 of matching code directly.
785 2016-05-19 Cary Coutant <ccoutant@gmail.com>
788 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
789 parameter; check for protected symbol.
790 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
791 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
792 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
793 (Symbol_table::add_from_dynobj): Mark protected symbols.
794 * symtab.h (Symbol::is_protected): New method.
795 (Symbol::set_is_protected): New method.
796 (Symbol::is_protected_): New data member.
798 * testsuite/Makefile.am (copy_test_protected): New test.
799 * testsuite/Makefile.in: Regenerate.
800 * testsuite/copy_test.cc (main): Add legal reference to protected
802 * testsuite/copy_test_v1.cc (main): Likewise.
803 * testsuite/copy_test_2.cc (ip): Add protected symbol.
804 * testsuite/copy_test_protected.cc: New test source file.
805 * testsuite/copy_test_protected.sh: New test script.
807 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
809 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
810 for global got symbols, and set addend to 0.
811 (Mips_got_entry::hash): Change hash algorithm.
812 (Mips_got_entry::equals): Refactor.
813 (Mips_got_entry::object): Return input object for local got symbols
815 (Mips_got_entry::addend): Change return of the relocation addend.
816 (Mips_got_entry::addend_): Move from union d.
817 (Mips_got_entry::object_): Move into union d.
818 (class Mips_symbol_hash): New class.
819 (Mips_got_info::Global_got_entry_set): New type.
820 (Mips_got_info::global_got_symbols): Change return type to
821 Global_got_entry_set.
822 (Mips_got_info::global_got_symbols_): Change type to
823 Global_got_entry_set.
824 (Mips_symbol::hash): New method.
825 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
826 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
827 (Mips_output_data_mips_stubs::symbols_): Change type to
828 Mips_stubs_entry_set.
829 (Mips_got_info::record_global_got_symbol): Don't pass object
830 argument when creating global got symbol.
831 (Mips_got_info::record_got_entry): Remove find before inserting
833 (Mips_got_info::add_reloc_only_entries): Change type of iterator
834 to Global_got_entry_set.
835 (Mips_got_info::count_got_symbols): Likewise.
836 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
837 for adding entries to symbols_.
838 (Mips_output_data_la25_stub::do_write): Change type of iterator
840 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
841 of iterator to Mips_stubs_entry_set.
842 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
843 (Mips_output_data_mips_stubs::do_write): Likewise.
845 2016-05-06 Han Shen <shenhan@google.com>
849 * aarch64-reloc.def: New relocation type.
850 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
851 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
852 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
853 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
855 2016-04-28 Nick Clifton <nickc@redhat.com>
857 * po/zh_CN.po: Updated Chinese (simplified) translation.
859 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
861 * Makefile.in: Regenerated with automake 1.11.6.
862 * aclocal.m4: Likewise.
863 * testsuite/Makefile.in: Likewise.
865 2016-03-30 Cary Coutant <ccoutant@gmail.com>
868 * symtab.cc (Symbol_table::define_default_version): Check for case
869 where symbols are both in different shared objects.
871 2016-03-27 Cary Coutant <ccoutant@gmail.com>
874 * i386.cc (Target_i386): Add check for fully-resolved symbol for
877 2016-03-22 Nick Clifton <nickc@redhat.com>
879 * configure: Regenerate.
881 2016-03-21 Cary Coutant <ccoutant@gmail.com>
884 * errors.cc (Errors::undefined_symbol): Add info message when
885 symbol should have been provided by a plugin.
886 * target-reloc.h (issue_undefined_symbol_error): Check for
887 placeholder symbols defined in discarded sections.
888 * testsuite/Makefile.am (plugin_test_9b): New test case.
889 * testsuite/Makefile.in: Regenerate.
890 * testsuite/plugin_test_9b_elf.cc: New test source file.
891 * testsuite/plugin_test_9b_ir.cc: New test source file.
893 2016-03-20 Cary Coutant <ccoutant@gmail.com>
896 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
897 * testsuite/Makefile.am (eh_test_2): New test.
898 * testsuite/Makefile.in: Regenerate.
899 * testsuite/eh_test_2.sh: New test script.
900 * testsuite/eh_test_a.cc (bar): Make it comdat.
901 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
903 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
905 * mips.cc (Mips_relobj::is_n64_): Remove.
906 (Target_mips::ei_class_): Likewise.
907 (Mips_relobj::is_newabi): Call methods.
908 (Mips_relobj::is_n64): Change checking for N64 ABI.
909 (Target_mips::is_output_n64): Likewise.
910 (Target_mips::merge_processor_specific_flags): Remove ei_class
911 argument, and remove comparing ei_class.
912 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
914 (Target_mips::do_finalize_sections): Don't pass ei_class argument
915 to merge_processor_specific_flags.
916 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
917 change checking for N64 ABI.
919 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
921 * mips.cc (enum Special_relocation_symbol): New enum type.
922 (is_readonly_section): New function.
923 (eh_reloc): Likewise.
924 (Mips_got_entry::is_section_symbol_): New member.
925 (Mips_got_entry::is_section_symbol): New method.
926 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
928 (Mips_relobj::mips_elf_options_section_name): New method.
929 (Mips_output_data_got::record_local_got_symbol): Add
930 is_section_symbol argument, and pass it to
931 Mips_got_info::record_local_got_symbol.
932 (Mips_output_data_got::got_offset): Add addend argument, and pass
933 it to Relobj::local_got_offset.
934 (struct Mips_output_reloc_writer): New type.
935 (class Mips_output_data_reloc): New class.
936 (Mips_output_data_plt::Reloc_section): Change type to
937 Mips_output_data_reloc.
938 (Target_mips::Reloc_section): Likewise.
939 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
940 (Mips_classify_reloc::get_r_type2): New method.
941 (Mips_classify_reloc::get_r_type3): Likewise.
942 (Mips_classify_reloc::get_r_ssym): Likewise.
943 (Target_mips::Reloca_section): Remove.
944 (Relocate::should_apply_static_reloc): Rename from
945 should_apply_r_mips_32_reloc.
946 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
948 (Mips_relocate_functions::Valtype): New type.
949 (Mips_relocate_functions::Valtype64): New type.
950 (Mips_relocate_functions::check_overflow): New method.
951 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
953 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
954 (Mips_relocate_functions::rel16): Add support for resolving
955 relocations for Mips64.
956 (Mips_relocate_functions::rel32): Likewise.
957 (Mips_relocate_functions::reljalr): Likewise.
958 (Mips_relocate_functions::relpc32): Likewise.
959 (Mips_relocate_functions::rel26): Likewise.
960 (Mips_relocate_functions::relpc16): Likewise.
961 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
962 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
963 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
964 (Mips_relocate_functions::do_relhi16): Likewise.
965 (Mips_relocate_functions::do_relgot16_local): Likewise.
966 (Mips_relocate_functions::rello16): Likewise.
967 (Mips_relocate_functions::relgot): Likewise.
968 (Mips_relocate_functions::relgotpage): Likewise.
969 (Mips_relocate_functions::relgotofst): Likewise.
970 (Mips_relocate_functions::relgot_hi16): Likewise.
971 (Mips_relocate_functions::relgot_lo16): Likewise.
972 (Mips_relocate_functions::relgprel): Likewise.
973 (Mips_relocate_functions::relgprel32): Likewise.
974 (Mips_relocate_functions::tlsrelhi16): Likewise.
975 (Mips_relocate_functions::tlsrello16): Likewise.
976 (Mips_relocate_functions::tlsrel32): Likewise.
977 (Mips_relocate_functions::relsub): Likewise.
978 (Mips_relocate_functions::releh): New method.
979 (Mips_relocate_functions::rel64): Likewise.
980 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
981 pass it to Mips_got_entry.
982 (Mips_got_info::add_local_entries): Pass addend argument
983 to code functions, and for STT_SECTION symbols call
984 add_symbolless_local_addend.
985 (Mips_got_info::add_tls_entries): Pass addend argument to code
987 (Mips_relobj::do_read_symbols): Read gp value that was used to
989 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
990 instruction. Opcode for instruction will be selected later.
991 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
992 (Target_mips::scan_relocatable_relocs): Likewise.
993 (Target_mips::emit_relocs_scan): Likewise.
994 (Target_mips::relocate_relocs): Likewise.
995 (Target_mips::do_finalize_sections): Skip objects for merging
996 processor specific flags in which all input sections will be
998 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
999 (Target_mips::Scan::get_reference_flags): Likewise.
1000 (Target_mips::relocate_special_relocatable): Call rel26 method with
1001 calculate_only and calculated_value arguments.
1002 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
1003 dynamic relocation against a readonly sections, and pass
1004 is_section_symbol to Mips_got_info::record_local_got_symbol.
1005 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
1006 dynamic relocation against a readonly sections, and pass r_type
1007 and r_offset to Target_mips::copy_reloc.
1008 (Target_mips::Relocate::relocate): Add support for resolving
1009 relocations for Mips64.
1010 (Target_mips::mips_info): Add case for Mips64 default dynamic
1012 (Target_selector_mips): Correct emulation names.
1014 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1016 * mips.cc (class Mips_output_data_la25_stub): Add
1017 do_print_to_mapfile function.
1019 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1021 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
1024 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
1026 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
1027 * testsuite/plugin_layout_with_alignment.c: This.
1028 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
1029 (plugin_layout_with_alignment): Likewise.
1030 * testsuite/Makefile.in: Regenerated.
1032 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1035 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
1037 * testsuite/Makefile.in: Regenerate.
1038 * testsuite/dynamic_list.sh: Likewise.
1039 * testsuite/retain_symbols_file_test.sh: Likewise.
1041 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1044 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
1045 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
1047 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1048 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1050 * output.cc (Output_reloc_writer): New type.
1051 (Output_data_reloc_base::do_write): Move implementation to template
1052 in output.h and replace with invocation of template.
1053 * output.h (Output_file): Move to top of file.
1054 (Output_reloc::get_symbol_index): Move to public interface.
1055 (Output_reloc::get_address): Likewise.
1056 (Output_data_reloc_base::do_write_generic): New function template.
1058 2016-03-04 Cary Coutant <ccoutant@gmail.com>
1062 * symtab.cc: Instantiate Sized_symbol::init_constant and
1063 Sized_symbol::init_undefined.
1065 2016-03-03 Cary Coutant <ccoutant@gmail.com>
1068 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
1069 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
1070 * mips.cc (Target_mips::make_symbol): Adjust function signature.
1071 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
1072 (Target_sparc::do_is_defined_by_abi): Remove test for
1074 (Target_sparc::Register_symbol): New struct type.
1075 (Target_sparc::register_syms_): New data member.
1076 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
1077 (Target_sparc::make_symbol): New function.
1078 (Target_sparc::do_finalize_sections): Add register symbols and new
1079 dynamic table entries.
1080 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
1081 (Symbol_table::add_target_global_symbol): New function.
1082 (Symbol_table::target_symbols_): New data member.
1083 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
1084 (Symbol_table::Symbol_table): Initialize target_symbols_.
1085 (Symbol_table::add_from_object): Pass additional parameters to
1086 Target::make_symbol.
1087 (Symbol_table::define_special_symbol): Likewise.
1088 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
1089 undefined symbol value.
1090 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
1091 (Symbol_table::sized_finalize): Likewise.
1092 (Symbol_table::sized_write_globals): Likewise.
1093 * target.h (Sized_target::make_symbol): Add name, st_type, object,
1094 st_shndx, and value parameters.
1096 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1098 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
1099 LDPK_WEAKUNDEF symbols.
1101 2016-03-03 Than McIntosh <thanm@google.com>
1103 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
1104 and get_input_section_alignment in transfer vector.
1105 (get_input_section_alignment): New function.
1106 (get_input_section_size): New function.
1107 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
1108 * testsuite/Makefile.in: [Regenerate.]
1109 * testsuite/plugin_section_alignment.cc: New test file.
1110 * testsuite/plugin_layout_with_alignment.cc: New test file.
1111 * testsuite/plugin_layout_with_alignment.sh: New test file.
1113 2016-03-03 Evgenii Stepanov <eugenis@google.com>
1115 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1117 * plugin.cc (get_symbols_v3): New function.
1118 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
1119 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
1122 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
1123 Cary Coutant <ccoutant@gmail.com>
1126 * ehframe.h (Cie::fde_encoding): New method.
1127 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
1130 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
1132 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
1133 -mrelax-relocations=yes to $(TEST_AS).
1134 (x86_64_mov_to_lea6.o): Likewise.
1135 (x86_64_overflow_pc32.o): Remove duplicated target.
1136 * testsuite/Makefile.in: Regenerated.
1138 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
1140 * s390.cc (Target_s390::match_view_u): New helper method.
1141 (Target_s390::do_is_call_to_non_split): New method.
1142 (Target_s390::ss_code_st_r14): New const.
1143 (Target_s390::ss_code_l_r14): New const.
1144 (Target_s390::ss_code_bras_8): New const.
1145 (Target_s390::ss_code_l_basr): New const.
1146 (Target_s390::ss_code_a_basr): New const.
1147 (Target_s390::ss_code_ear): New const.
1148 (Target_s390::ss_code_c): New const.
1149 (Target_s390::ss_code_larl): New const.
1150 (Target_s390::ss_code_brasl): New const.
1151 (Target_s390::ss_code_jg): New const.
1152 (Target_s390::ss_code_jgl): New const.
1153 (Target_s390::ss_match_mcount): New helper method.
1154 (Target_s390::ss_match_l): New helper method.
1155 (Target_s390::ss_match_ahi): New helper method.
1156 (Target_s390::ss_match_alfi): New helper method.
1157 (Target_s390::ss_match_cr): New helper method.
1158 (Target_s390::do_calls_non_split): New method.
1159 * testsuite/Makefile.am: Added new tests.
1160 * testsuite/Makefile.in: Regenerate.
1161 * testsuite/split_s390.sh: New test.
1162 * testsuite/split_s390_1_a1.s: New test.
1163 * testsuite/split_s390_1_a2.s: New test.
1164 * testsuite/split_s390_1_n1.s: New test.
1165 * testsuite/split_s390_1_n2.s: New test.
1166 * testsuite/split_s390_1_z1.s: New test.
1167 * testsuite/split_s390_1_z2.s: New test.
1168 * testsuite/split_s390_1_z3.s: New test.
1169 * testsuite/split_s390_1_z4.s: New test.
1170 * testsuite/split_s390_2_ns.s: New test.
1171 * testsuite/split_s390_2_s.s: New test.
1172 * testsuite/split_s390x_1_a1.s: New test.
1173 * testsuite/split_s390x_1_a2.s: New test.
1174 * testsuite/split_s390x_1_n1.s: New test.
1175 * testsuite/split_s390x_1_n2.s: New test.
1176 * testsuite/split_s390x_1_z1.s: New test.
1177 * testsuite/split_s390x_1_z2.s: New test.
1178 * testsuite/split_s390x_1_z3.s: New test.
1179 * testsuite/split_s390x_1_z4.s: New test.
1180 * testsuite/split_s390x_2_ns.s: New test.
1181 * testsuite/split_s390x_2_s.s: New test.
1183 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
1185 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
1186 info message for every erratum 843419 found and fixed.
1188 2016-02-07 Cary Coutant <ccoutant@gmail.com>
1191 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
1192 information to relocation overflow errors.
1194 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1197 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
1198 overflow checking when symbol value + addend < 0.
1200 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1203 * reloc.h (Limits): New class.
1204 (Bits::has_overflow32): Use min/max values from Limits.
1205 (Bits::has_unsigned_overflow32): Likewise.
1206 (Bits::has_signed_unsigned_overflow32): Likewise.
1207 (Bits::has_overflow): Likewise.
1208 (Bits::has_unsigned_overflow): Likewise.
1209 (Bits::has_signed_unsigned_overflow64): Likewise.
1211 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1214 * reloc.h (Relocate_functions::Overflow_check): Add comments.
1215 * x86_64.cc (X86_64_relocate_functions): New class.
1216 (Target_x86_64::Relocate::relocate): Use the new class.
1217 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
1218 (x32_overflow_pc32): New test case.
1219 * testsuite/Makefile.in: Regenerate.
1220 * testsuite/x32_overflow_pc32.sh: New script.
1221 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
1223 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1226 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
1227 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
1229 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1232 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
1234 (Bits::has_unsigned_overflow): Likewise.
1236 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
1238 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
1240 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
1241 and view_size to is_call_to_non_split.
1242 * target.cc (Target::is_call_to_non_split): Add view and view_size
1244 * target.h (class Target): Likewise.
1246 2016-02-05 Sriraman Tallam <tmsriram@google.com>
1248 * icf.cc (get_rel_addend): New function.
1249 (get_section_contents): Move merge section addend computation to a
1250 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
1251 Fix bug to not read past the length of the section.
1253 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1254 Andrew Senkevich <andrew.senkevich@intel.com>
1257 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
1258 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
1260 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
1261 * testsuite/x86_64_overflow_pc32.sh: New test script.
1262 * testsuite/x86_64_overflow_pc32.s: New source file.
1264 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1267 * reloc.h (Relocate_functions::Address): New typedef.
1268 (Relocate_functions::Addendtype): New typedef.
1269 (Relocate_functions::Overflow_check): New enum type.
1270 (Relocate_functions::Reloc_status): New enum type.
1271 (Relocate_functions::check_overflow): New function template.
1272 (Relocate_functions::rel): Add check parameter; check for overflow.
1273 (Relocate_functions::rel_unaligned): Likewise.
1274 (Relocate_functions::rela): Likewise.
1275 (Relocate_functions::pcrel): Likewise.
1276 (Relocate_functions::pcrel_unaligned): Likewise.
1277 (Relocate_functions::pcrela): Likewise.
1278 (Relocate_functions::rel8): Adjust parameter types.
1279 (Relocate_functions::rela8): Likewise.
1280 (Relocate_functions::pcrel8): Likewise.
1281 (Relocate_functions::pcrela8): Likewise.
1282 (Relocate_functions::rel16): Likewise.
1283 (Relocate_functions::rela168): Likewise.
1284 (Relocate_functions::pcrel16): Likewise.
1285 (Relocate_functions::pcrela16): Likewise.
1286 (Relocate_functions::rel32): Likewise.
1287 (Relocate_functions::rel32_unaligned): Likewise.
1288 (Relocate_functions::rela32): Likewise.
1289 (Relocate_functions::pcrel32): Likewise.
1290 (Relocate_functions::pcrel32_unaligned): Likewise.
1291 (Relocate_functions::pcrela32): Likewise.
1292 (Relocate_functions::rel8_check): New function.
1293 (Relocate_functions::rela8_check): New function.
1294 (Relocate_functions::pcrel8_check): New function.
1295 (Relocate_functions::pcrela8_check): New function.
1296 (Relocate_functions::rel16_check): New function.
1297 (Relocate_functions::rela168_check): New function.
1298 (Relocate_functions::pcrel16_check): New function.
1299 (Relocate_functions::pcrela16_check): New function.
1300 (Relocate_functions::rel32_check): New function.
1301 (Relocate_functions::rel32_unaligned_check): New function.
1302 (Relocate_functions::rela32_check): New function.
1303 (Relocate_functions::pcrel32_check): New function.
1304 (Relocate_functions::pcrel32_unaligned_check): New function.
1305 (Relocate_functions::pcrela32_check): New function.
1306 (Bits::has_unsigned_overflow32): New function.
1307 (Bits::has_unsigned_overflow): New function.
1308 * testsuite/Makefile.am (overflow_unittest): New test.
1309 * testsuite/Makefile.in: Regenerate.
1310 * testsuite/overflow_unittest.cc: New source file.
1312 2016-02-04 Alan Modra <amodra@gmail.com>
1314 * powerpc.cc (relocate): Adjust last patch for big-endian.
1316 2016-02-02 Alan Modra <amodra@gmail.com>
1318 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
1320 2016-01-15 Han Shen <shenhan@google.com>
1322 PR gold/19472 - need pc-relative stubs.
1324 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
1325 stub type for DSOs and pie executables.
1327 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
1329 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
1332 2016-01-12 Cary Coutant <ccoutant@gmail.com>
1334 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
1335 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
1336 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
1337 specializations) New method.
1339 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1342 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
1343 we have a TLS segment for GD-to-IE optimization.
1344 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
1346 (Target_i386::tls_desc_gd_to_ie): Likewise.
1347 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
1348 for TLSDESC GD-to-IE optimizations.
1349 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
1351 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
1352 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
1353 for TLSDESC GD-to-IE optimizations.
1355 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1357 Refactor gold to enable support for MIPS-64 relocation format.
1359 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
1360 (gc_process_relocs): Remove sh_type template parameter.
1361 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
1362 * object.h (Sized_relobj_file::split_stack_adjust): Add target
1364 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
1365 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
1366 specializations) Remove.
1367 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
1368 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
1369 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
1370 (Sized_relobj_file::split_stack_adjust): Add target parameter.
1372 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
1373 Target::get_r_sym() to get r_sym field from relocations.
1374 (Track_relocs::next_symndx): Call Target::get_r_sym().
1375 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
1376 add Classify_reloc template parameter. Use for accessing r_sym and
1378 (relocate_section): Likewise.
1379 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
1380 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
1381 (Default_scan_relocatable_relocs::Reltype): New typedef.
1382 (Default_scan_relocatable_relocs::reloc_size): New const.
1383 (Default_scan_relocatable_relocs::sh_type): New const.
1384 (Default_scan_relocatable_relocs::get_r_sym): New method.
1385 (Default_scan_relocatable_relocs::get_r_type): New method.
1386 (Default_emit_relocs_strategy): New class.
1387 (scan_relocatable_relocs): Replace sh_type template parameter with
1388 Scan_relocatable_relocs class. Use it to access r_sym and r_type
1390 (relocate_relocs): Replace sh_type template parameter with
1391 Classify_reloc class. Use it to access r_sym and r_type fields.
1392 * target.h (Target::is_call_to_non_split): Replace r_type parameter
1393 with pointer to relocation. Adjust all callers.
1394 (Target::do_is_call_to_non_split): Likewise.
1395 (Target::emit_relocs_scan): New virtual method.
1396 (Sized_target::get_r_sym): New virtual method.
1397 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
1398 with pointer to relocation.
1400 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
1401 (Target_aarch64::Relocatable_size_for_reloc): Remove.
1402 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
1403 (Target_aarch64::scan_relocs): Likewise.
1404 (Target_aarch64::relocate_section): Likewise.
1405 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
1407 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
1408 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
1409 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
1411 (Target_arm::emit_relocs_scan): New method.
1412 (Target_arm::Relocatable_size_for_reloc): Replace with...
1413 (Target_arm::Classify_reloc): ...this.
1414 (Target_arm::gc_process_relocs): Use Classify_reloc.
1415 (Target_arm::scan_relocs): Likewise.
1416 (Target_arm::relocate_section): Likewise.
1417 (Target_arm::scan_relocatable_relocs): Likewise.
1418 (Target_arm::relocate_relocs): Likewise.
1419 * i386.cc (Target_i386::emit_relocs_scan): New method.
1420 (Target_i386::Relocatable_size_for_reloc): Replace with...
1421 (Target_i386::Classify_reloc): ...this.
1422 (Target_i386::gc_process_relocs): Use Classify_reloc.
1423 (Target_i386::scan_relocs): Likewise.
1424 (Target_i386::relocate_section): Likewise.
1425 (Target_i386::scan_relocatable_relocs): Likewise.
1426 (Target_i386::relocate_relocs): Likewise.
1427 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
1429 (Mips_reloc_types): New class template.
1430 (Mips_classify_reloc): New class template.
1431 (Target_mips::Reltype): New typedef.
1432 (Target_mips::Relatype): New typedef.
1433 (Target_mips::emit_relocs_scan): New method.
1434 (Target_mips::get_r_sym): New method.
1435 (Target_mips::Relocatable_size_for_reloc): Replace with
1436 Mips_classify_reloc.
1437 (Target_mips::copy_reloc): Use Mips_classify_reloc.
1438 (Target_mips::gc_process_relocs): Likewise.
1439 (Target_mips::scan_relocs): Likewise.
1440 (Target_mips::relocate_section): Likewise.
1441 (Target_mips::scan_relocatable_relocs): Likewise.
1442 (Target_mips::relocate_relocs): Likewise.
1443 (mips_get_size_for_reloc): New function, factored out from
1444 Relocatable_size_for_reloc::get_size_for_reloc.
1445 (Target_mips::Scan::local): Use Mips_classify_reloc.
1446 (Target_mips::Scan::global): Likewise.
1447 (Target_mips::Relocate::relocate): Likewise.
1448 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
1449 (Target_powerpc::Relocatable_size_for_reloc): Remove.
1450 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
1451 (Target_powerpc::scan_relocs): Likewise.
1452 (Target_powerpc::relocate_section): Likewise.
1453 (Powerpc_scan_relocatable_reloc): Convert to class template.
1454 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
1455 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
1456 (Powerpc_scan_relocatable_reloc::sh_type): New const.
1457 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
1458 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
1459 (Target_powerpc::scan_relocatable_relocs): Use
1460 Powerpc_scan_relocatable_reloc.
1461 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
1462 * s390.cc (Target_s390::emit_relocs_scan): New method.
1463 (Target_s390::Relocatable_size_for_reloc): Remove.
1464 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
1465 (Target_s390::scan_relocs): Likewise.
1466 (Target_s390::relocate_section): Likewise.
1467 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
1469 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
1470 (Target_s390::relocate_relocs): Use Default_classify_reloc.
1471 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
1472 (Target_sparc::Relocatable_size_for_reloc): Remove.
1473 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
1474 (Target_sparc::scan_relocs): Likewise.
1475 (Target_sparc::relocate_section): Likewise.
1476 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
1478 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
1479 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
1480 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
1481 (Target_tilegx::Relocatable_size_for_reloc): Remove.
1482 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
1483 (Target_tilegx::scan_relocs): Likewise.
1484 (Target_tilegx::relocate_section): Likewise.
1485 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
1487 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
1488 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
1489 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
1490 (Target_x86_64::Relocatable_size_for_reloc): Remove.
1491 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
1492 (Target_x86_64::scan_relocs): Likewise.
1493 (Target_x86_64::relocate_section): Likewise.
1494 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1496 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
1497 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
1499 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
1501 2016-01-01 Alan Modra <amodra@gmail.com>
1503 Update year range in copyright notice of all files.
1505 For older changes see ChangeLog-0815
1507 Copyright (C) 2016 Free Software Foundation, Inc.
1509 Copying and distribution of this file, with or without modification,
1510 are permitted in any medium without royalty provided the copyright
1511 notice and this notice are preserved.
1517 version-control: never