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