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