1 2016-12-27 Cary Coutant <ccoutant@gmail.com>
4 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Use .dynbss for
5 read-only data when linking with -z relro.
6 * copy-relocs.h (Copy_relocs::dynrelro_): New data member.
7 * testsuite/Makefile.am (copy_test_relro): New test case.
8 * testsuite/Makefile.in: Regenerate.
9 * testsuite/copy_test_relro.cc: New source file.
10 * testsuite/copy_test_relro_1.cc: New source file.
12 2016-12-23 Cary Coutant <ccoutant@gmail.com>
14 * NEWS: Add new features in 1.14.
15 * version.cc (version_string): Bump to 1.14.
17 2016-12-22 Cary Coutant <ccoutant@gmail.com>
20 * options.h (-z bndplt): New option.
21 * x86_64.cc (Output_data_plt_x86_64::regular_count): New method.
22 (Output_data_plt_x86_64::address_for_global): Move implementation into
24 (Output_data_plt_x86_64::address_for_local): Likewise.
25 (Output_data_plt_x86_64::got): New method.
26 (Output_data_plt_x86_64::got_plt): New method.
27 (Output_data_plt_x86_64::got_irelative): New method.
28 (Output_data_plt_x86_64::do_address_for_global): New virtual method.
29 (Output_data_plt_x86_64::do_address_for_local): New virtual method.
30 (class Output_data_plt_x86_64_bnd): New class.
31 (Target_x86_64::do_make_data_plt): Move out of line and specialize
32 for each size (both overloads).
33 (Output_data_plt_x86_64::set_final_data_size): Cosmetic changes.
34 * testsuite/Makefile.am (bnd_plt_1): New test case.
35 (bnd_ifunc_1): New test case.
36 (bnd_ifunc_2): New test case.
37 * testsuite/Makefile.in: Regenerate.
38 * testsuite/bnd_ifunc_1.s: New source file.
39 * testsuite/bnd_ifunc_1.sh: New shell script.
40 * testsuite/bnd_ifunc_2.s: New source file.
41 * testsuite/bnd_ifunc_2.sh: New shell script.
42 * testsuite/bnd_plt_1.s: New source file.
43 * testsuite/bnd_plt_1.sh: New shell script.
45 2016-12-22 Cary Coutant <ccoutant@gmail.com>
47 * layout.cc (Layout::finalize): Track count of forced-local symbols
49 (Layout::create_symtab_sections): Add local_dynamic_count parameter;
50 use that instead of sh_info value.
51 (Layout::create_dynamic_symtab): Add pforced_local_dynamic_count
52 parameter; pass it to Symtab::set_dynsym_indexes(). Include forced
53 locals in sh_info value. Pass index of first real global to
54 Dynobj::create_gnu_hash_table() and Dynobj::create_elf_hash_table().
55 * layout.h (Layout::create_symtab_sections): Add local_dynamic_count
57 (Layout::create_dynamic_symtab): Add pforced_local_dynamic_count
59 * symtab.cc (Symbol_table::set_dynsym_indexes): Add pforced_local_count
60 parameter. Process forced-local symbols first and return the count.
61 (Symbol_table::finalize): Update comments.
62 * symtab.h (Symbol_table::set_dynsym_indexes): Add pforced_local_count
64 (Symbol_table::first_dynamic_global_index_): Update comment.
65 (Symbol_table::dynamic_count_): Update comment.
66 * testsuite/Makefile.am (ifuncmod1.sh): New test case.
67 * testsuite/Makefile.in: Regenerate.
68 * testsuite/ifuncmod1.sh: New shell script.
70 2016-12-21 Cary Coutant <ccoutant@gmail.com>
72 * symtab.cc (Symbol_table::define_special_symbol): Add is_forced_local
73 parameter; if set, do not check version script.
74 (Symbol_table::do_define_in_output_data): Pass is_forced_local for
75 STB_LOCAL predefined symbols.
76 (Symbol_table::do_define_in_output_segment): Likewise.
77 (Symbol_table::do_define_in_output_segment): Likewise.
78 (Symbol_table::do_define_as_constant): Likewise.
79 * symtab.h (Symbol_table::define_special_symbol): Add is_forced_local
80 parameter. Adjust all callers.
81 * testsuite/Makefile.am (ver_test_8.sh): New test case.
82 * testsuite/Makefile.in: Regenerate.
83 * ver_test_8.sh: New test script.
85 2016-12-21 Cary Coutant <ccoutant@gmail.com>
87 * output.cc (Output_segment::first_section): Return NULL if there are
88 no sections in the segment.
89 * output.h (Output_segment::first_section_load_address): Assert that
90 first section is not NULL.
91 * symtab.cc (Symbol_table::sized_write_globals): Attach linker-created
92 segment-relative symbols to first section of the segment.
94 2016-12-21 Alan Modra <amodra@gmail.com>
96 * arm.cc: Fix comment chars with high bit set.
98 2016-12-20 Cary Coutant <ccoutant@gmail.com>
100 * testsuite/Makefile.am: Add missing dependencies on gcctestdir/ld
102 * testsuite/Makefile.in: Regenerate.
104 2016-12-19 Cary Coutant <ccoutant@gmail.com>
107 * script.cc (Lex::get_token): Don't look ahead past NUL characters.
109 2016-12-19 Cary Coutant <ccoutant@gmail.com>
113 * layout.h (Layout::choose_output_section): Add match_input_spec
114 parameter. Adjust all callers.
115 * layout.cc (Layout::choose_output_section): Likewise. Pass
116 match_input_spec to Script_sections::output_section_name().
117 (Layout::create_note): Pass true for match_input_spec.
118 * script-sections.h (Script_sections::output_section_name): Add
119 match_input_spec parameter.
120 * script-sections.cc (Sections_element::output_section_name): Likewise.
121 (Output_section_definition::output_section_name): Likewise.
122 (Script_sections::output_section_name): Likewise.
124 2016-12-19 Igor Kudrin <ikudrin@accesssoftek.com>
126 * arm.cc (Target_arm::Target_arm): Move initialization code ...
127 (Target_arm::do_select_as_default_target): ... to here.
128 * testsuite/Makefile.am (arm_target_lazy_init): New test case.
129 * testsuite/Makefile.in: Regenerate.
130 * testsuite/arm_target_lazy_init.s: New source file.
131 * testsuite/arm_target_lazy_init.t: New linker script.
133 2016-12-19 Cary Coutant <ccoutant@gmail.com>
136 * symtab.cc (Symbol_table::sized_write_globals): Use address of
137 output section, not input section.
138 * testsuite/Makefile.am (pr20976): New test case.
139 * testsuite/Makefile.in: Regenerate.
140 * testsuite/pr20976.c: New source file.
142 2016-12-13 Cary Coutant <ccoutant@gmail.com>
145 * options.h (--orphan-handling): New option.
146 (General_options::Orphan_handling): New enum.
147 (General_options::orphan_handling_enum): New method.
148 (General_options::set_orphan_handling_enum): New method.
149 (General_options::orphan_handling_enum_): New data member.
150 * options.cc (General_options::General_options): Initialize new member.
151 (General_options::finalize): Convert --orphan-handling argument to enum.
152 * script-sections.cc (Script_sections::output_section_name): Check it.
154 2016-12-13 Cary Coutant <ccoutant@gmail.com>
157 * layout.cc (Layout::choose_output_section): Add is_reloc parameter.
158 Adjust all callers. Do not use linker script for is_reloc sections.
159 (Layout::layout_reloc): Pass is_reloc == true.
160 * layout.h (Layout::choose_output_section): Add is_reloc parameter.
162 2016-12-12 Igor Kudrin <ikudrin@accesssoftek.com>
163 Cary Coutant <ccoutant@gmail.com>
166 * script-sections.cc (Output_section_definition::output_section_name):
167 For linker-generated sections, compare with output section name.
168 * testsuite/Makefile.am (script_test_13): New test.
169 * testsuite/Makefile.in: Regenerate.
170 * testsuite/script_test_13.c: New source file.
171 * testsuite/script_test_13.sh: New script.
172 * testsuite/script_test_13.t: New linker script.
174 2016-12-12 Cary Coutant <ccoutant@gmail.com>
176 * script-sections.cc (Orphan_section_placement::update_last_alloc):
178 (Orphan_section_placement::find_place): Place orphan .data section
179 after either RODATA or TEXT.
180 (Script_sections::place_orphan): Call update_last_alloc for allocated
182 (Script_sections::create_segments): Improve handling of BSS.
184 2016-12-13 Alan Modra <amodra@gmail.com>
187 * testsuite/script_test_15a.sh: Allows larger p_filesz.
188 * testsuite/script_test_15b.sh: Likewise.
189 * testsuite/script_test_15c.sh: Likewise.
191 2016-12-13 Alan Modra <amodra@gmail.com>
194 * testsuite/pr20717.t: Add .got output section containing .toc.
196 2016-12-11 Igor Kudrin <ikudrin@accesssoftek.com>
199 * testsuite/Makefile.am (pr20717): New test.
200 * testsuite/Makefile.in: Regenerate.
201 * testsuite/pr20717.c: New test source file.
202 * testsuite/pr20717.sh: New test script.
203 * testsuite/pr20717.t: New test linker script.
205 2016-12-11 Cary Coutant <ccoutant@gmail.com>
208 * output.cc (Output_section::set_final_data_size): Calculate data size
209 based on relative offset rather than file offset.
210 (Output_segment::set_section_addresses): Track file offset separately
212 (Output_segment::set_section_list_addresses): Add pfoff parameter.
213 Track file offset separately. Don't move file offset for BSS
215 * output.h (Output_segment::set_section_list_addresses): Add pfoff
217 * script-sections.cc (Orphan_section_placement): Add PLACE_LAST_ALLOC.
218 (Orphan_section_placement::Orphan_section_placement): Initialize it.
219 (Orphan_section_placement::output_section_init): Track last allocated
221 (Orphan_section_placement::find_place): Place BSS after last allocated
223 (Output_section_element_input::set_section_addresses): Always override
224 input section alignment when SUBALIGN is specified.
225 (Output_section_definition::set_section_addresses): Override alignment
226 of output section when SUBALIGN is specified.
228 * testsuite/Makefile.am (script_test_15a, script_test_15b)
229 (script_test_15c): New test cases.
230 * testsuite/Makefile.in: Regenerate.
231 * testsuite/script_test_2.cc: Adjust expected layout.
232 * testsuite/script_test_15.c: New source file.
233 * testsuite/script_test_15a.sh: New shell script.
234 * testsuite/script_test_15a.t: New linker script.
235 * testsuite/script_test_15b.sh: New shell script.
236 * testsuite/script_test_15b.t: New linker script.
237 * testsuite/script_test_15c.sh: New shell script.
238 * testsuite/script_test_15c.t: New linker script.
240 2016-12-08 Alan Modra <amodra@gmail.com>
242 * powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather
245 2016-12-08 Alan Modra <amodra@gmail.com>
247 * options.h (--stub-group-multi): Fix typo.
249 2016-12-07 Alan Modra <amodra@gmail.com>
251 * options.h (--stub-group-multi): New PowerPC option.
252 * powerpc.cc (Stub_control): Add multi_os_ var and param
253 to constructor. Sort start_ var later. Comment State.
254 (Stub_control::can_add_to_stub_group): Heed multi_os_.
255 (Target_powerpc::group_sections): Update.
257 2016-12-07 Alan Modra <amodra@gmail.com>
260 * powerpc.cc (Stub_control): Replace stubs_always_before_branch_
261 with stubs_always_after_branch_, group_end_addr_ with
263 (Stub_control::can_add_to_stub_group): Rewrite to suit scanning
264 sections by increasing address.
265 (Target_powerpc::group_sections): Scan that way. Delete corner
267 * options.h (--stub-group-size): Update help string.
269 2016-12-07 Alan Modra <amodra@gmail.com>
271 * powerpc.cc (Stub_table_owner): Provide constructor.
272 (Powerpc_relobj::set_stub_table): Resize fill with -1.
273 (Target_powerpc::Branch_info::make_stub): Provide target debug
274 output on returning false.
276 2016-12-05 Cary Coutant <ccoutant@gmail.com>
277 Tristan Gingold <gingold@adacore.com>
279 * object.cc (Sized_relobj_file::do_count_local_symbols): Check
280 is_ordinary before using shndx.
281 * testsuite/Makefile.am (file_in_many_sections_test.sh): New test case.
282 * testsuite/Makefile.in: Regenerate.
283 * testsuite/file_in_many_sections.c: New source file.
284 * testsuite/file_in_many_sections_test.sh: New script.
286 2016-12-01 Cary Coutant <ccoutant@gmail.com>
287 Igor Kudrin <ikudrin@accesssoftek.com>
290 * script-sections.cc (Script_sections): Set *keep to false when
293 2016-12-01 Cary Coutant <ccoutant@gmail.com>
296 * target.h (Target::default_text_segment_address): Bump default
297 start address up to ABI page size.
299 2016-12-01 Cary Coutant <ccoutant@gmail.com>
302 * options.cc (General_options::object_format_to_string): New function.
303 (General_options::copy_from_posdep_options): New function.
304 (General_options::parse_push_state): New function.
305 (General_options::parse_pop_state): New function.
306 * options.h (--push-state, --pop-state): New options.
307 (General_options::object_format_to_string): New method.
308 (General_options::set_incremental_disposition): New method.
309 (General_options::copy_from_posdep_options): New method.
310 (General_options::options_stack_): New data member.
312 2016-12-01 Cary Coutant <ccoutant@gmail.com>
315 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
316 section symbols correctly.
317 * arm.cc (Target_arm): Likewise.
318 * powerpc.cc (Target_powerpc): Likewise.
320 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
322 * aarch64-reloc.def: Fix spelling in comments.
324 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
326 * aarch64.cc: Fix spelling in comments.
327 * arm.cc: Fix spelling in comments.
328 * icf.cc: Fix spelling in comments.
329 * layout.cc: Fix spelling in comments.
330 * layout.h: Fix spelling in comments.
331 * mips.cc: Fix spelling in comments.
332 * output.h: Fix spelling in comments.
333 * plugin.h: Fix spelling in comments.
334 * script-sections.h: Fix spelling in comments.
335 * script.h: Fix spelling in comments.
336 * stringpool.h: Fix spelling in comments.
337 * tilegx.cc: Fix spelling in comments.
339 2016-11-22 Cary Coutant <ccoutant@gmail.com>
342 * options.cc (One_option::print): Print "(default)" when appropriate.
343 * options.h: Clean up and re-sort options.
344 (One_option::is_default): New data member.
345 (One_option::One_option): Add is_default parameter; adjust all calls.
346 (DEFINE_var): Add is_default__ parameter; adjust all calls.
347 (DEFINE_bool): Set is_default based on default_value__.
348 (DEFINE_bool_ignore): New macro.
349 (--no-eh-frame-hdr): New option.
350 (--enable-new-dtags): Remove mention of DT_FLAGS.
352 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
354 * configure: Regenerate.
356 2016-11-21 Cary Coutant <ccoutant@gmail.com>
359 * gold.cc (queue_middle_tasks): Force valid target earlier.
361 2016-11-21 Igor Kudrin <ikudrin@accesssoftek.com>
363 * layout.cc: Include windows.h and rpcdce.h (for MinGW32).
364 (Layout::create_build_id): Generate uuid using UuidCreate().
366 2016-11-04 Loïc Yhuel <loic.yhuel@softathome.com>
368 * configure.ac: add missing '$'.
369 * configure: Regenerate.
371 2016-10-21 Gergely Nagy <ngg@tresorit.com>
374 * icf.cc (match_sections): Add new parameter section_addraligns.
375 Check section alignment and keep the section with the strictest
377 (find_identical_sections): New local variable section_addraligns.
378 Store each section's alignment.
379 * testsuite/pr17704a_test.s: New file.
380 * testsuite/Makefile.am (pr17704a_test): New test.
381 * testsuite/Makefile.in: Regenerate.
383 2016-10-06 Alan Modra <amodra@gmail.com>
385 * powerpc.cc (Target_powerpc::Relocate::relocate): Add fall
387 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
389 2016-10-06 Alan Modra <amodra@gmail.com>
391 * aarch64.cc: Spell fall through comments as "// Fall through.".
394 * powerpc.cc: Likewise.
396 * sparc.cc: Likewise.
397 * x86_64.cc: Likewise.
398 * powerpc.cc (Target_powerpc::Relocate::relocate): Add missing
399 fall through comments.
400 * sparc.cc: (Target_sparc::Scan::global): Likewise.
401 (Target_sparc::Relocate::relocate): Likewise.
402 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
403 * resolve.cc (symbol_to_bits): Add missing break.
405 2016-09-26 Cary Coutant <ccoutant@gmail.com>
408 * symtab.cc (Symbol_table::define_default_version): Check that
409 unversioned symbol is defined.
411 2016-09-26 Vlad Zakharov <vzakhar@synopsys.com>
413 * Makefile.in: Regenerate.
414 * configure: Likewise.
415 * testsuite/Makefile.in: Likewise.
417 2016-09-26 Alan Modra <amodra@gmail.com>
419 * aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid
421 * output.cc (Output_segment::set_section_addresses): Likewise.
422 * testsuite/Makefile.in: Regenerate.
424 2016-09-02 Doug Kwan <dougkwan@google.com>
426 * arm.cc (Target_arm::Target_arm): Move method definition outside of
427 class definition. Add code to handle --target1-rel, --target1-abs
428 and --target2= options.
429 (Target_arm::get_reloc_reloc_type): Change method to be non-static
431 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
433 (Target_arm::Scan::local, Target_arm::Scan::global,
434 Target_arm::Relocate::relocate,
435 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
436 call to Target_arm::get_real_reloc_type.
437 (Target_arm::get_real_reloc_type): Use command line options to
438 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
439 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
442 2016-08-31 Alan Modra <amodra@gmail.com>
444 * powerpc.cc (class Stub_control): Delete stub14_group_size_
445 and has14_. Add group_size_.
446 (Stub_control::can_add_to_stub_group): Adjust to suit. Print
447 debug info when switching to adding sections before stubs.
449 2016-08-31 Alan Modra <amodra@gmail.com>
451 * debug.h (DEBUG_TARGET): New.
452 (DEBUG_ALL): Add DEBUG_TARGET.
453 (gold_debug): Delete FORMAT param.
454 * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
456 2016-08-30 Alan Modra <amodra@gmail.com>
459 * powerpc.cc (class Stub_control): Add has14_. Comment owner_.
460 (Stub_control::can_add_to_stub_group): Correct grouping of
461 sections containing 14-bit external branches. When returning
462 false, set state_ to reflect the fact that we have one section
463 for the next group. Rewrite most of function for clarity.
464 Add and expand comments.
465 (Target_powerpc::do_relax): Print stub group size retry in hex.
467 2016-08-26 Han Shen <shenhan@google.com>
469 PR gold/20529 - relaxing loop never ends.
471 * powerpc.cc (Stub_table::min_size_threshold_): New member to
473 (Stub_table::set_min_size_threshold): New member function.
474 (Stub_table::set_address_and_size): Add code to only allow size
476 (Target_powerpc::do_relax): Add code to record last size.
478 2016-08-23 Roland McGrath <roland@hack.frob.com>
480 * options.h (General_options): Grok -z stack-size.
481 * output.h (Output_segment::set_size): New method.
482 * layout.cc (Layout::create_executable_stack_info): Renamed to ...
483 (Layout::create_stack_segment): ... this. Always create the
484 segment if -z stack-size was used.
485 (Layout::set_segment_offsets): Don't call ->set_offset on the
486 PT_GNU_STACK segment.
488 2016-08-15 Bharathi Seshadri <bseshadr@cisco.com>
490 * options.h (General_options): Add --be8 option.
491 * arm.cc (Arm_relobj::do_relocate_sections): Add code to swap for be8.
492 (Output_data_plt_arm_standard::do_fill_first_plt_entry): Likewise.
493 (Output_data_plt_arm_short::do_fill_plt_entry): Likewise.
494 (Output_data_plt_arm_long::do_fill_plt_entry): Likewise.
495 (Target_arm::do_adjust_elf_header): Do EF_ARM_BE8 adjustment.
497 2016-08-17 Cary Coutant <ccoutant@gmail.com>
499 * i386.cc (Target_i386): Reset skip_call_tls_get_addr_ after printing
501 * testsuite/Makefile.am (pr20216a): Add missing dependencies.
502 (pr20308a): Add -Bgcctestdir/ to compile rules.
503 * testsuite/Makefile.in: Regenerate.
505 2016-08-12 Roland McGrath <roland@hack.frob.com>
508 * script-sections.cc (Script_sections::release_segments):
509 Reset this->segments_created_.
511 2016-08-12 Roland McGrath <roland@hack.frob.com>
513 * yyscript.y (HIDDEN): New %token.
514 (assignment): Handle HIDDEN(string = expr) syntax.
515 * script.cc (script_keyword_parsecodes): Add HIDDEN.
517 2016-08-10 Cary Coutant <ccoutant@gmail.com>
520 * x86_64.cc (Target_x86_64::Relocate::relocate): Add check for
521 R_X86_64_GOTPCREL. Reset skip_call_tls_get_addr_ after printing
523 * testsuite/Makefile.am (pr20216_gd.o): Add -Bgcctestdir/.
524 (pr20216_ld.o): Likewise.
525 * testsuite/Makefile.in: Regenerate.
527 2016-08-10 James Clarke <jrtc27@jrtc27.com>
530 * symtab.cc (Symbol_table::add_from_relobj): Handle NULL symbols,
531 which will be present for STT_SPARC_REGISTER.
532 (Symbol_table::add_from_pluginobj): Likewise.
533 (Symbol_table::add_from_dynobj): Likewise.
534 (Symbol_table::add_from_incrobj): Removed dead code.
536 2016-08-10 James Clarke <jrtc27@jrtc27.com>
539 * sparc.cc (Target_sparc::Relocate::relocate): R_SPARC_GOTDATA_OP_LOX10
540 should fall back on R_SPARC_GOT10, not R_SPARC_GOT13.
542 2016-08-10 James Clarke <jrtc27@jrtc27.com>
545 * sparc.cc (Target_sparc::Scan::check_non_pic): Allow R_SPARC_32 on
548 2016-06-29 Cary Coutant <ccoutant@gmail.com>
551 * testsuite/dynamic_list.sh: Remove check for _ZdlPv.
553 2016-06-29 Cary Coutant <ccoutant@gmail.com>
555 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add eh_test_2.
556 * testsuite/Makefile.in: Regenerate.
558 2016-06-30 Alan Modra <amodra@gmail.com>
560 * testsuite/Makefile.am (memory_test, memory_test_2): Pass
561 -Wl,-z to gcc, not plain -z.
562 * testsuite/Makefile.in: Regenerate.
564 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
567 * i386.cc (Target_i386::Relocate::relocate): Allow
568 R_386_GOT32X relocation against ___tls_get_addr.
569 (Target_i386::Relocate::tls_gd_to_ie): Support indirect
570 call to __tls_get_addr.
571 (Target_i386::Relocate::tls_gd_to_le): Likewise.
572 (Target_i386::Relocate::tls_ld_to_le): Likewise.
573 * testsuite/Makefile.am (check_PROGRAMS): Add pr20308a_test,
574 pr20308b_test, pr20308c_test, pr20308d_test, pr20308e_test.
575 (pr20308a_test_SOURCES): New.
576 (pr20308a_test_DEPENDENCIES): Likewise.
577 (pr20308a_test_CFLAGS): Likewise.
578 (pr20308a_test_LDFLAGS): Likewise.
579 (pr20308a_test_LDADD): Likewise.
580 (pr20308b_test_SOURCES): Likewise.
581 (pr20308b_test_DEPENDENCIES): Likewise.
582 (pr20308b_test_CFLAGS): Likewise.
583 (pr20308b_test_LDFLAGS): Likewise.
584 (pr20308b_test_LDADD): Likewise.
585 (pr20308c_test_SOURCES): Likewise.
586 (pr20308c_test_DEPENDENCIES): Likewise.
587 (pr20308c_test_CFLAGS): Likewise.
588 (pr20308c_test_LDFLAGS): Likewise.
589 (pr20308c_test_LDADD): Likewise.
590 (pr20308d_test_SOURCES): Likewise.
591 (pr20308d_test_DEPENDENCIES): Likewise.
592 (pr20308d_test_CFLAGS): Likewise.
593 (pr20308d_test_LDFLAGS): Likewise.
594 (pr20308d_test_LDADD): Likewise.
595 (pr20308e_test_SOURCES): Likewise.
596 (pr20308e_test_DEPENDENCIES): Likewise.
597 (pr20308e_test_CFLAGS): Likewise.
598 (pr20308e_test_LDFLAGS): Likewise.
599 (pr20308e_test_LDADD): Likewise.
600 (pr20308a.so): Likewise.
601 (pr20308b.so): Likewise.
602 (pr20308_gd.o): Likewise.
603 (pr20308_ld.o): Likewise.
604 (MOSTLYCLEANFILES): Add pr20308a.so pr20308b.so.
605 * testsuite/Makefile.in: Regenerated.
606 * testsuite/pr20308_def.c: New file.
607 * testsuite/pr20308_gd.S: Likewise.
608 * testsuite/pr20308_ld.S: Likewise.
609 * testsuite/pr20308_main.c: Likewise.
611 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
614 * configure.ac (DEFAULT_TARGET_X86_64_OR_X32): New
616 * configure: Regenerated.
617 * x86_64.cc (Target_x86_64<size>::Relocate::relocate): Allow
618 R_X86_64_GOTPCRELX relocation against __tls_get_addr.
619 (Target_x86_64<size>::Relocate::tls_gd_to_ie): Support indirect
620 call to __tls_get_addr.
621 (Target_x86_64<size>::Relocate::tls_gd_to_le): Likewise.
622 (Target_x86_64<size>::Relocate::tls_ld_to_le): Likewise.
623 * testsuite/Makefile.am (check_PROGRAMS): Add pr20216a_test,
624 pr20216b_test, pr20216c_test, pr20216d_test, pr20216e_test.
625 (pr20216a_test_SOURCES): New.
626 (pr20216a_test_DEPENDENCIES): Likewise.
627 (pr20216a_test_CFLAGS): Likewise.
628 (pr20216a_test_LDFLAGS): Likewise.
629 (pr20216a_test_LDADD): Likewise.
630 (pr20216b_test_SOURCES): Likewise.
631 (pr20216b_test_DEPENDENCIES): Likewise.
632 (pr20216b_test_CFLAGS): Likewise.
633 (pr20216b_test_LDFLAGS): Likewise.
634 (pr20216b_test_LDADD): Likewise.
635 (pr20216c_test_SOURCES): Likewise.
636 (pr20216c_test_DEPENDENCIES): Likewise.
637 (pr20216c_test_CFLAGS): Likewise.
638 (pr20216c_test_LDFLAGS): Likewise.
639 (pr20216c_test_LDADD): Likewise.
640 (pr20216d_test_SOURCES): Likewise.
641 (pr20216d_test_DEPENDENCIES): Likewise.
642 (pr20216d_test_CFLAGS): Likewise.
643 (pr20216d_test_LDFLAGS): Likewise.
644 (pr20216d_test_LDADD): Likewise.
645 (pr20216e_test_SOURCES): Likewise.
646 (pr20216e_test_DEPENDENCIES): Likewise.
647 (pr20216e_test_CFLAGS): Likewise.
648 (pr20216e_test_LDFLAGS): Likewise.
649 (pr20216e_test_LDADD): Likewise.
650 (pr20216a.so): Likewise.
651 (pr20216b.so): Likewise.
652 (pr20216_gd.o): Likewise.
653 (pr20216_ld.o): Likewise.
654 (MOSTLYCLEANFILES): Add pr20216a.so pr20216b.so.
655 * testsuite/Makefile.in: Regenerated.
656 * testsuite/pr20216_def.c: New file.
657 * testsuite/pr20216_gd.S: Likewise.
658 * testsuite/pr20216_ld.S: Likewise.
659 * testsuite/pr20216_main.c: Likewise.
661 2016-06-29 Alan Modra <amodra@gmail.com>
663 * script_test_12.t: Delete .plt, specify 64k page size.
664 * script_test_12i.t: Likewise.
666 2016-06-29 Alan Modra <amodra@gmail.com>
668 * testsuite/plugin_layout_with_alignment.c: Explicitly align all
671 2016-06-29 Alan Modra <amodra@gmail.com>
673 * testsuite/Makefile.am (copy_test_protected): Disable for powerpc.
674 * testsuite/Makefile.in: Regenerate.
676 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
678 * aarch64-reloc.def (NONE): New relocation.
679 * aarch64.cc (Target_aarch64::Scan::local): Handle R_AARCH64_NONE.
680 (Target_aarch64::Scan::global): Likewise.
681 * testsuite/Makefile.am (aarch64_reloc_none): New test.
682 * testsuite/Makefile.in: Regenerate.
683 * testsuite/aarch64_reloc_none.s: New test source file.
684 * testsuite/aarch64_reloc_none.sh: New test script.
686 2016-06-28 Sriraman Tallam <tmsriram@google.com>
688 * x86_64.cc (Lazy_view): New class.
689 (can_convert_mov_to_lea): Templatize function. Make the function
690 check for appropriate relocation types and use the view parameter
691 to get section contents.
692 (can_convert_callq_to_direct): New function.
693 (Target_x86_64<size>::Scan::global): Refactor.
694 (Target_x86_64<size>::Relocate::relocate): Refactor. Change any indirect
695 call via GOT that can be converted.
696 * testsuite/Makefile.am (x86_64_indirect_call_to_direct.sh): New test.
697 * testsuite/Makefile.in: Regenerate.
698 * testsuite/x86_64_indirect_call_to_direct1.s: New file.
699 * testsuite/x86_64_indirect_jump_to_direct1.s: New file.
701 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
703 * aarch64.cc (Target_aarch64::Scan::local): Move the call to got_section
704 from the top level to the places of its use.
706 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
709 * script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
710 * script-sections.cc (Input_section_sorter::get_init_priority): New method.
711 (Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
712 (Output_section_element_input::print): Likewise.
713 * script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
714 * yyscript.y (SORT_BY_INIT_PRIORITY): New token.
715 (wildcard_section): Handle SORT_BY_INIT_PRIORITY.
717 * testsuite/Makefile.am (script_test_14): New test.
718 * testsuite/Makefile.in: Regenerate.
719 * testsuite/script_test_14.s: New test source file.
720 * testsuite/script_test_14.sh: New test script.
721 * testsuite/script_test_14.t: New test linker script.
723 2016-06-28 James Clarke <jrtc27@jrtc27.com>
725 * sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
726 to R_SPARC_RELATIVE if class is ELFCLASS64.
727 (Target_sparc::Scan::global): Likewise.
729 2016-06-23 Cary Coutant <ccoutant@gmail.com>
730 Igor Kudrin <ikudrin@accesssoftek.com>
734 (Output_section_element_input::set_section_addresses): Keep bin_count
735 separate from input_pattern_count.
736 * testsuite/script_test_12.t: Add another section .x4.
737 * testsuite/script_test_12i.t: Likewise.
738 * testsuite/script_test_12a.c: Likewise.
739 * testsuite/script_test_12b.c: Likewise.
741 2016-06-23 Igor Kudrin <ikudrin@accesssoftek.com>
743 * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
745 2016-06-22 H.J. Lu <hongjiu.lu@intel.com>
748 * NEWS: Mention --enable-relro.
749 * configure.ac: Add --enable-relro.
750 (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
752 * config.in: Regenerated.
753 * configure: Likewise.
754 * options.h (General_options::relro): Default to
757 2016-06-20 Cary Coutant <ccoutant@gmail.com>
759 * NEWS: Add new features in 1.12.
760 * version.cc (version_string): Bump to 1.12.
762 2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
765 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if
767 (Target_i386::plt_entry_size): Likewise.
768 (Target_x86_64<size>::first_plt_entry_offset): Likewise.
769 (Target_x86_64<size>::plt_entry_size): Likewise.
771 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
773 * mips.cc (Target_mips::Target_mips): Initialize rld_map_.
774 (Target_mips::rld_map_): New data member.
775 (Target_mips::do_finalize_sections): Add support for
776 DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
777 .rld_map section, and __RLD_MAP symbol.
778 (Target_mips::do_dynamic_tag_custom_value): Add support for
779 DT_MIPS_RLD_MAP_REL dynamic tag.
780 * output.cc (Output_data_dynamic::get_entry_offset): New method
782 * output.h (Output_data_dynamic::get_entry_offset): New method
785 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
787 * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
789 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
791 * mips.cc (relocation_needs_la25_stub): Add support for relocs:
792 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
793 (hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
794 (is_matching_lo16_reloc): Likewise.
795 (lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
796 (Mips_output_data_plt::plt_entry_r6): New static data member for
798 (Target_mips::is_output_r6): New method.
799 (Target_mips::Mips_mach): Add new enum constants.
800 (Mips_relocate_functions::Status): Likewise.
801 (Mips_relocate_functions::pchi16_relocs): New static data member.
802 (Mips_relocate_functions::relpc21): New method.
803 (Mips_relocate_functions::relpc26): Likewise.
804 (Mips_relocate_functions::relpc18): Likewise.
805 (Mips_relocate_functions::relpc19): Likewise.
806 (Mips_relocate_functions::relpchi16): Likewise.
807 (Mips_relocate_functions::do_relpchi16): Likewise.
808 (Mips_relocate_functions::relpclo16): Likewise.
809 (Mips_output_data_plt::do_write): Add support for Mips r6 plt
811 (Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
812 (Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
813 E_MIPS_ARCH_64R6 support.
814 (Target_mips::update_abiflags_isa): Likewise.
815 (mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
816 R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
818 (Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
820 (Target_mips::Scan::global): Add support for relocs:
821 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
822 (Target_mips::Relocate::relocate): Call functions for resolving
823 Mips32r6 and Mips64r6 relocations, and print error message for
824 STATUS_PCREL_UNALIGNED.
825 (Target_mips::Scan::get_reference_flags): Add support for relocs:
826 R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
827 R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
828 (Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
829 E_MIPS_ARCH_64R6 support.
831 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
834 * testsuite/script_test_2.t: Add .got.plt after .got.
836 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
838 * mips.cc (struct Mips_abiflags): New struct.
839 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
841 (Mips_relobj::~Mips_relobj): Delete object pointed by
842 attributes_section_data_.
843 (Mips_relobj::abiflags): New method.
844 (Mips_relobj::attributes_section_data): Likewise.
845 (Mips_relobj::attributes_section_data_): New data member.
846 (Mips_relobj::abiflags_): Likewise.
847 (class Mips_output_section_abiflags): New class.
848 (Target_mips::Target_mips): Initialize attributes_section_data_,
849 abiflags_ and has_abiflags_section_.
850 (Target_mips::do_should_include_section): Don't emit input
851 .MIPS.abiflags sections to output .MIPS.abiflags.
852 (Target_mips::Mips_mach): Add new enum constants.
853 (Target_mips::mips_isa_ext_mach): New method.
854 (Target_mips::mips_isa_ext): Likewise.
855 (Target_mips::update_abiflags_isa): Likewise.
856 (Target_mips::infer_abiflags): Likewise.
857 (Target_mips::create_abiflags): Likewise.
858 (Target_mips::fp_abi_string): Likewise.
859 (Target_mips::select_fp_abi): Likewise.
860 (Target_mips::merge_obj_attributes): Likewise.
861 (Target_mips::merge_obj_abiflags): Likewise.
862 (Target_mips::level_rev): Likewise.
863 (Target_mips::merge_obj_e_flags): Rename from
864 merge_processor_specific_flags. Remove dyn_obj argument,
865 call update_abiflags_isa when needed, compare NaN encodings and
867 (Target_mips::add_machine_extensions): Add two machine extensions
869 (Target_mips::attributes_section_data_): New data member.
870 (Target_mips::abiflags_): Likewise.
871 (Target_mips::has_abiflags_section_): Likewise.
872 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
873 .MIPS.abiflags sections if they exists.
874 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
875 E_MIPS_MACH_OCTEON3 support.
876 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
877 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
878 .MIPS.abiflags sections from input. Create these sections if
880 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
881 E_MIPS_MACH_OCTEON3 support, and change strings for
882 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
885 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
887 * mips.cc (Mips_relobj::Mips_relobj): Initialize
888 has_reginfo_section_.
889 (Mips_relobj::has_reginfo_section_): New data member.
890 (Mips_relobj::has_reginfo_section): New method.
891 (class Mips_output_section_reginfo): Change base class to
892 Output_section_data, and set masks of the output .reginfo section
894 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
896 (Mips_output_section_reginfo::set_masks): Likewise.
897 (Mips_output_section_reginfo::set_final_data_size): Likewise.
898 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
899 (Target_mips::do_make_output_section): Remove.
900 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
901 if the object contains a .reginfo section.
902 (Target_mips::do_finalize_sections): Create a .reginfo output
905 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
907 * mips.cc (Mips_output_data_got::do_write): Add missing template
910 2016-05-30 Marcin Kościelnicki <koriakin@0x04.net>
913 * s390.cc (Target_s390::ss_code_st_r14): Removed.
914 (Target_s390::ss_code_l_r14): Removed.
915 (Target_s390::ss_code_ear): Removed.
916 (Target_s390::ss_code_c): Removed.
917 (Target_s390::ss_match_st_r14): New function.
918 (Target_s390::ss_match_l_r14): New function.
919 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
920 of matching code directly.
921 (Target_s390::ss_match_ear): New function.
922 (Target_s390::ss_match_c): New function.
923 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
924 of matching code directly.
926 2016-05-19 Cary Coutant <ccoutant@gmail.com>
929 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
930 parameter; check for protected symbol.
931 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
932 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
933 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
934 (Symbol_table::add_from_dynobj): Mark protected symbols.
935 * symtab.h (Symbol::is_protected): New method.
936 (Symbol::set_is_protected): New method.
937 (Symbol::is_protected_): New data member.
939 * testsuite/Makefile.am (copy_test_protected): New test.
940 * testsuite/Makefile.in: Regenerate.
941 * testsuite/copy_test.cc (main): Add legal reference to protected
943 * testsuite/copy_test_v1.cc (main): Likewise.
944 * testsuite/copy_test_2.cc (ip): Add protected symbol.
945 * testsuite/copy_test_protected.cc: New test source file.
946 * testsuite/copy_test_protected.sh: New test script.
948 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
950 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
951 for global got symbols, and set addend to 0.
952 (Mips_got_entry::hash): Change hash algorithm.
953 (Mips_got_entry::equals): Refactor.
954 (Mips_got_entry::object): Return input object for local got symbols
956 (Mips_got_entry::addend): Change return of the relocation addend.
957 (Mips_got_entry::addend_): Move from union d.
958 (Mips_got_entry::object_): Move into union d.
959 (class Mips_symbol_hash): New class.
960 (Mips_got_info::Global_got_entry_set): New type.
961 (Mips_got_info::global_got_symbols): Change return type to
962 Global_got_entry_set.
963 (Mips_got_info::global_got_symbols_): Change type to
964 Global_got_entry_set.
965 (Mips_symbol::hash): New method.
966 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
967 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
968 (Mips_output_data_mips_stubs::symbols_): Change type to
969 Mips_stubs_entry_set.
970 (Mips_got_info::record_global_got_symbol): Don't pass object
971 argument when creating global got symbol.
972 (Mips_got_info::record_got_entry): Remove find before inserting
974 (Mips_got_info::add_reloc_only_entries): Change type of iterator
975 to Global_got_entry_set.
976 (Mips_got_info::count_got_symbols): Likewise.
977 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
978 for adding entries to symbols_.
979 (Mips_output_data_la25_stub::do_write): Change type of iterator
981 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
982 of iterator to Mips_stubs_entry_set.
983 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
984 (Mips_output_data_mips_stubs::do_write): Likewise.
986 2016-05-06 Han Shen <shenhan@google.com>
990 * aarch64-reloc.def: New relocation type.
991 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
992 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
993 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
994 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
996 2016-04-28 Nick Clifton <nickc@redhat.com>
998 * po/zh_CN.po: Updated Chinese (simplified) translation.
1000 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
1002 * Makefile.in: Regenerated with automake 1.11.6.
1003 * aclocal.m4: Likewise.
1004 * testsuite/Makefile.in: Likewise.
1006 2016-03-30 Cary Coutant <ccoutant@gmail.com>
1009 * symtab.cc (Symbol_table::define_default_version): Check for case
1010 where symbols are both in different shared objects.
1012 2016-03-27 Cary Coutant <ccoutant@gmail.com>
1015 * i386.cc (Target_i386): Add check for fully-resolved symbol for
1018 2016-03-22 Nick Clifton <nickc@redhat.com>
1020 * configure: Regenerate.
1022 2016-03-21 Cary Coutant <ccoutant@gmail.com>
1025 * errors.cc (Errors::undefined_symbol): Add info message when
1026 symbol should have been provided by a plugin.
1027 * target-reloc.h (issue_undefined_symbol_error): Check for
1028 placeholder symbols defined in discarded sections.
1029 * testsuite/Makefile.am (plugin_test_9b): New test case.
1030 * testsuite/Makefile.in: Regenerate.
1031 * testsuite/plugin_test_9b_elf.cc: New test source file.
1032 * testsuite/plugin_test_9b_ir.cc: New test source file.
1034 2016-03-20 Cary Coutant <ccoutant@gmail.com>
1037 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
1038 * testsuite/Makefile.am (eh_test_2): New test.
1039 * testsuite/Makefile.in: Regenerate.
1040 * testsuite/eh_test_2.sh: New test script.
1041 * testsuite/eh_test_a.cc (bar): Make it comdat.
1042 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
1044 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1046 * mips.cc (Mips_relobj::is_n64_): Remove.
1047 (Target_mips::ei_class_): Likewise.
1048 (Mips_relobj::is_newabi): Call methods.
1049 (Mips_relobj::is_n64): Change checking for N64 ABI.
1050 (Target_mips::is_output_n64): Likewise.
1051 (Target_mips::merge_processor_specific_flags): Remove ei_class
1052 argument, and remove comparing ei_class.
1053 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
1055 (Target_mips::do_finalize_sections): Don't pass ei_class argument
1056 to merge_processor_specific_flags.
1057 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
1058 change checking for N64 ABI.
1060 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1062 * mips.cc (enum Special_relocation_symbol): New enum type.
1063 (is_readonly_section): New function.
1064 (eh_reloc): Likewise.
1065 (Mips_got_entry::is_section_symbol_): New member.
1066 (Mips_got_entry::is_section_symbol): New method.
1067 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
1069 (Mips_relobj::mips_elf_options_section_name): New method.
1070 (Mips_output_data_got::record_local_got_symbol): Add
1071 is_section_symbol argument, and pass it to
1072 Mips_got_info::record_local_got_symbol.
1073 (Mips_output_data_got::got_offset): Add addend argument, and pass
1074 it to Relobj::local_got_offset.
1075 (struct Mips_output_reloc_writer): New type.
1076 (class Mips_output_data_reloc): New class.
1077 (Mips_output_data_plt::Reloc_section): Change type to
1078 Mips_output_data_reloc.
1079 (Target_mips::Reloc_section): Likewise.
1080 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
1081 (Mips_classify_reloc::get_r_type2): New method.
1082 (Mips_classify_reloc::get_r_type3): Likewise.
1083 (Mips_classify_reloc::get_r_ssym): Likewise.
1084 (Target_mips::Reloca_section): Remove.
1085 (Relocate::should_apply_static_reloc): Rename from
1086 should_apply_r_mips_32_reloc.
1087 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
1089 (Mips_relocate_functions::Valtype): New type.
1090 (Mips_relocate_functions::Valtype64): New type.
1091 (Mips_relocate_functions::check_overflow): New method.
1092 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
1094 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
1095 (Mips_relocate_functions::rel16): Add support for resolving
1096 relocations for Mips64.
1097 (Mips_relocate_functions::rel32): Likewise.
1098 (Mips_relocate_functions::reljalr): Likewise.
1099 (Mips_relocate_functions::relpc32): Likewise.
1100 (Mips_relocate_functions::rel26): Likewise.
1101 (Mips_relocate_functions::relpc16): Likewise.
1102 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
1103 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
1104 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
1105 (Mips_relocate_functions::do_relhi16): Likewise.
1106 (Mips_relocate_functions::do_relgot16_local): Likewise.
1107 (Mips_relocate_functions::rello16): Likewise.
1108 (Mips_relocate_functions::relgot): Likewise.
1109 (Mips_relocate_functions::relgotpage): Likewise.
1110 (Mips_relocate_functions::relgotofst): Likewise.
1111 (Mips_relocate_functions::relgot_hi16): Likewise.
1112 (Mips_relocate_functions::relgot_lo16): Likewise.
1113 (Mips_relocate_functions::relgprel): Likewise.
1114 (Mips_relocate_functions::relgprel32): Likewise.
1115 (Mips_relocate_functions::tlsrelhi16): Likewise.
1116 (Mips_relocate_functions::tlsrello16): Likewise.
1117 (Mips_relocate_functions::tlsrel32): Likewise.
1118 (Mips_relocate_functions::relsub): Likewise.
1119 (Mips_relocate_functions::releh): New method.
1120 (Mips_relocate_functions::rel64): Likewise.
1121 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
1122 pass it to Mips_got_entry.
1123 (Mips_got_info::add_local_entries): Pass addend argument
1124 to code functions, and for STT_SECTION symbols call
1125 add_symbolless_local_addend.
1126 (Mips_got_info::add_tls_entries): Pass addend argument to code
1128 (Mips_relobj::do_read_symbols): Read gp value that was used to
1130 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
1131 instruction. Opcode for instruction will be selected later.
1132 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
1133 (Target_mips::scan_relocatable_relocs): Likewise.
1134 (Target_mips::emit_relocs_scan): Likewise.
1135 (Target_mips::relocate_relocs): Likewise.
1136 (Target_mips::do_finalize_sections): Skip objects for merging
1137 processor specific flags in which all input sections will be
1139 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
1140 (Target_mips::Scan::get_reference_flags): Likewise.
1141 (Target_mips::relocate_special_relocatable): Call rel26 method with
1142 calculate_only and calculated_value arguments.
1143 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
1144 dynamic relocation against a readonly sections, and pass
1145 is_section_symbol to Mips_got_info::record_local_got_symbol.
1146 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
1147 dynamic relocation against a readonly sections, and pass r_type
1148 and r_offset to Target_mips::copy_reloc.
1149 (Target_mips::Relocate::relocate): Add support for resolving
1150 relocations for Mips64.
1151 (Target_mips::mips_info): Add case for Mips64 default dynamic
1153 (Target_selector_mips): Correct emulation names.
1155 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1157 * mips.cc (class Mips_output_data_la25_stub): Add
1158 do_print_to_mapfile function.
1160 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1162 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
1165 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
1167 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
1168 * testsuite/plugin_layout_with_alignment.c: This.
1169 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
1170 (plugin_layout_with_alignment): Likewise.
1171 * testsuite/Makefile.in: Regenerated.
1173 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1176 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
1178 * testsuite/Makefile.in: Regenerate.
1179 * testsuite/dynamic_list.sh: Likewise.
1180 * testsuite/retain_symbols_file_test.sh: Likewise.
1182 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1185 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
1186 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
1188 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1189 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1191 * output.cc (Output_reloc_writer): New type.
1192 (Output_data_reloc_base::do_write): Move implementation to template
1193 in output.h and replace with invocation of template.
1194 * output.h (Output_file): Move to top of file.
1195 (Output_reloc::get_symbol_index): Move to public interface.
1196 (Output_reloc::get_address): Likewise.
1197 (Output_data_reloc_base::do_write_generic): New function template.
1199 2016-03-04 Cary Coutant <ccoutant@gmail.com>
1203 * symtab.cc: Instantiate Sized_symbol::init_constant and
1204 Sized_symbol::init_undefined.
1206 2016-03-03 Cary Coutant <ccoutant@gmail.com>
1209 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
1210 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
1211 * mips.cc (Target_mips::make_symbol): Adjust function signature.
1212 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
1213 (Target_sparc::do_is_defined_by_abi): Remove test for
1215 (Target_sparc::Register_symbol): New struct type.
1216 (Target_sparc::register_syms_): New data member.
1217 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
1218 (Target_sparc::make_symbol): New function.
1219 (Target_sparc::do_finalize_sections): Add register symbols and new
1220 dynamic table entries.
1221 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
1222 (Symbol_table::add_target_global_symbol): New function.
1223 (Symbol_table::target_symbols_): New data member.
1224 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
1225 (Symbol_table::Symbol_table): Initialize target_symbols_.
1226 (Symbol_table::add_from_object): Pass additional parameters to
1227 Target::make_symbol.
1228 (Symbol_table::define_special_symbol): Likewise.
1229 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
1230 undefined symbol value.
1231 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
1232 (Symbol_table::sized_finalize): Likewise.
1233 (Symbol_table::sized_write_globals): Likewise.
1234 * target.h (Sized_target::make_symbol): Add name, st_type, object,
1235 st_shndx, and value parameters.
1237 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1239 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
1240 LDPK_WEAKUNDEF symbols.
1242 2016-03-03 Than McIntosh <thanm@google.com>
1244 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
1245 and get_input_section_alignment in transfer vector.
1246 (get_input_section_alignment): New function.
1247 (get_input_section_size): New function.
1248 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
1249 * testsuite/Makefile.in: [Regenerate.]
1250 * testsuite/plugin_section_alignment.cc: New test file.
1251 * testsuite/plugin_layout_with_alignment.cc: New test file.
1252 * testsuite/plugin_layout_with_alignment.sh: New test file.
1254 2016-03-03 Evgenii Stepanov <eugenis@google.com>
1256 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1258 * plugin.cc (get_symbols_v3): New function.
1259 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
1260 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
1263 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
1264 Cary Coutant <ccoutant@gmail.com>
1267 * ehframe.h (Cie::fde_encoding): New method.
1268 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
1271 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
1273 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
1274 -mrelax-relocations=yes to $(TEST_AS).
1275 (x86_64_mov_to_lea6.o): Likewise.
1276 (x86_64_overflow_pc32.o): Remove duplicated target.
1277 * testsuite/Makefile.in: Regenerated.
1279 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
1281 * s390.cc (Target_s390::match_view_u): New helper method.
1282 (Target_s390::do_is_call_to_non_split): New method.
1283 (Target_s390::ss_code_st_r14): New const.
1284 (Target_s390::ss_code_l_r14): New const.
1285 (Target_s390::ss_code_bras_8): New const.
1286 (Target_s390::ss_code_l_basr): New const.
1287 (Target_s390::ss_code_a_basr): New const.
1288 (Target_s390::ss_code_ear): New const.
1289 (Target_s390::ss_code_c): New const.
1290 (Target_s390::ss_code_larl): New const.
1291 (Target_s390::ss_code_brasl): New const.
1292 (Target_s390::ss_code_jg): New const.
1293 (Target_s390::ss_code_jgl): New const.
1294 (Target_s390::ss_match_mcount): New helper method.
1295 (Target_s390::ss_match_l): New helper method.
1296 (Target_s390::ss_match_ahi): New helper method.
1297 (Target_s390::ss_match_alfi): New helper method.
1298 (Target_s390::ss_match_cr): New helper method.
1299 (Target_s390::do_calls_non_split): New method.
1300 * testsuite/Makefile.am: Added new tests.
1301 * testsuite/Makefile.in: Regenerate.
1302 * testsuite/split_s390.sh: New test.
1303 * testsuite/split_s390_1_a1.s: New test.
1304 * testsuite/split_s390_1_a2.s: New test.
1305 * testsuite/split_s390_1_n1.s: New test.
1306 * testsuite/split_s390_1_n2.s: New test.
1307 * testsuite/split_s390_1_z1.s: New test.
1308 * testsuite/split_s390_1_z2.s: New test.
1309 * testsuite/split_s390_1_z3.s: New test.
1310 * testsuite/split_s390_1_z4.s: New test.
1311 * testsuite/split_s390_2_ns.s: New test.
1312 * testsuite/split_s390_2_s.s: New test.
1313 * testsuite/split_s390x_1_a1.s: New test.
1314 * testsuite/split_s390x_1_a2.s: New test.
1315 * testsuite/split_s390x_1_n1.s: New test.
1316 * testsuite/split_s390x_1_n2.s: New test.
1317 * testsuite/split_s390x_1_z1.s: New test.
1318 * testsuite/split_s390x_1_z2.s: New test.
1319 * testsuite/split_s390x_1_z3.s: New test.
1320 * testsuite/split_s390x_1_z4.s: New test.
1321 * testsuite/split_s390x_2_ns.s: New test.
1322 * testsuite/split_s390x_2_s.s: New test.
1324 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
1326 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
1327 info message for every erratum 843419 found and fixed.
1329 2016-02-07 Cary Coutant <ccoutant@gmail.com>
1332 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
1333 information to relocation overflow errors.
1335 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1338 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
1339 overflow checking when symbol value + addend < 0.
1341 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1344 * reloc.h (Limits): New class.
1345 (Bits::has_overflow32): Use min/max values from Limits.
1346 (Bits::has_unsigned_overflow32): Likewise.
1347 (Bits::has_signed_unsigned_overflow32): Likewise.
1348 (Bits::has_overflow): Likewise.
1349 (Bits::has_unsigned_overflow): Likewise.
1350 (Bits::has_signed_unsigned_overflow64): Likewise.
1352 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1355 * reloc.h (Relocate_functions::Overflow_check): Add comments.
1356 * x86_64.cc (X86_64_relocate_functions): New class.
1357 (Target_x86_64::Relocate::relocate): Use the new class.
1358 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
1359 (x32_overflow_pc32): New test case.
1360 * testsuite/Makefile.in: Regenerate.
1361 * testsuite/x32_overflow_pc32.sh: New script.
1362 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
1364 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1367 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
1368 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
1370 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1373 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
1375 (Bits::has_unsigned_overflow): Likewise.
1377 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
1379 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
1381 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
1382 and view_size to is_call_to_non_split.
1383 * target.cc (Target::is_call_to_non_split): Add view and view_size
1385 * target.h (class Target): Likewise.
1387 2016-02-05 Sriraman Tallam <tmsriram@google.com>
1389 * icf.cc (get_rel_addend): New function.
1390 (get_section_contents): Move merge section addend computation to a
1391 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
1392 Fix bug to not read past the length of the section.
1394 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1395 Andrew Senkevich <andrew.senkevich@intel.com>
1398 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
1399 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
1401 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
1402 * testsuite/x86_64_overflow_pc32.sh: New test script.
1403 * testsuite/x86_64_overflow_pc32.s: New source file.
1405 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1408 * reloc.h (Relocate_functions::Address): New typedef.
1409 (Relocate_functions::Addendtype): New typedef.
1410 (Relocate_functions::Overflow_check): New enum type.
1411 (Relocate_functions::Reloc_status): New enum type.
1412 (Relocate_functions::check_overflow): New function template.
1413 (Relocate_functions::rel): Add check parameter; check for overflow.
1414 (Relocate_functions::rel_unaligned): Likewise.
1415 (Relocate_functions::rela): Likewise.
1416 (Relocate_functions::pcrel): Likewise.
1417 (Relocate_functions::pcrel_unaligned): Likewise.
1418 (Relocate_functions::pcrela): Likewise.
1419 (Relocate_functions::rel8): Adjust parameter types.
1420 (Relocate_functions::rela8): Likewise.
1421 (Relocate_functions::pcrel8): Likewise.
1422 (Relocate_functions::pcrela8): Likewise.
1423 (Relocate_functions::rel16): Likewise.
1424 (Relocate_functions::rela168): Likewise.
1425 (Relocate_functions::pcrel16): Likewise.
1426 (Relocate_functions::pcrela16): Likewise.
1427 (Relocate_functions::rel32): Likewise.
1428 (Relocate_functions::rel32_unaligned): Likewise.
1429 (Relocate_functions::rela32): Likewise.
1430 (Relocate_functions::pcrel32): Likewise.
1431 (Relocate_functions::pcrel32_unaligned): Likewise.
1432 (Relocate_functions::pcrela32): Likewise.
1433 (Relocate_functions::rel8_check): New function.
1434 (Relocate_functions::rela8_check): New function.
1435 (Relocate_functions::pcrel8_check): New function.
1436 (Relocate_functions::pcrela8_check): New function.
1437 (Relocate_functions::rel16_check): New function.
1438 (Relocate_functions::rela168_check): New function.
1439 (Relocate_functions::pcrel16_check): New function.
1440 (Relocate_functions::pcrela16_check): New function.
1441 (Relocate_functions::rel32_check): New function.
1442 (Relocate_functions::rel32_unaligned_check): New function.
1443 (Relocate_functions::rela32_check): New function.
1444 (Relocate_functions::pcrel32_check): New function.
1445 (Relocate_functions::pcrel32_unaligned_check): New function.
1446 (Relocate_functions::pcrela32_check): New function.
1447 (Bits::has_unsigned_overflow32): New function.
1448 (Bits::has_unsigned_overflow): New function.
1449 * testsuite/Makefile.am (overflow_unittest): New test.
1450 * testsuite/Makefile.in: Regenerate.
1451 * testsuite/overflow_unittest.cc: New source file.
1453 2016-02-04 Alan Modra <amodra@gmail.com>
1455 * powerpc.cc (relocate): Adjust last patch for big-endian.
1457 2016-02-02 Alan Modra <amodra@gmail.com>
1459 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
1461 2016-01-15 Han Shen <shenhan@google.com>
1463 PR gold/19472 - need pc-relative stubs.
1465 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
1466 stub type for DSOs and pie executables.
1468 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
1470 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
1473 2016-01-12 Cary Coutant <ccoutant@gmail.com>
1475 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
1476 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
1477 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
1478 specializations) New method.
1480 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1483 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
1484 we have a TLS segment for GD-to-IE optimization.
1485 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
1487 (Target_i386::tls_desc_gd_to_ie): Likewise.
1488 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
1489 for TLSDESC GD-to-IE optimizations.
1490 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
1492 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
1493 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
1494 for TLSDESC GD-to-IE optimizations.
1496 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1498 Refactor gold to enable support for MIPS-64 relocation format.
1500 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
1501 (gc_process_relocs): Remove sh_type template parameter.
1502 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
1503 * object.h (Sized_relobj_file::split_stack_adjust): Add target
1505 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
1506 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
1507 specializations) Remove.
1508 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
1509 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
1510 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
1511 (Sized_relobj_file::split_stack_adjust): Add target parameter.
1513 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
1514 Target::get_r_sym() to get r_sym field from relocations.
1515 (Track_relocs::next_symndx): Call Target::get_r_sym().
1516 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
1517 add Classify_reloc template parameter. Use for accessing r_sym and
1519 (relocate_section): Likewise.
1520 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
1521 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
1522 (Default_scan_relocatable_relocs::Reltype): New typedef.
1523 (Default_scan_relocatable_relocs::reloc_size): New const.
1524 (Default_scan_relocatable_relocs::sh_type): New const.
1525 (Default_scan_relocatable_relocs::get_r_sym): New method.
1526 (Default_scan_relocatable_relocs::get_r_type): New method.
1527 (Default_emit_relocs_strategy): New class.
1528 (scan_relocatable_relocs): Replace sh_type template parameter with
1529 Scan_relocatable_relocs class. Use it to access r_sym and r_type
1531 (relocate_relocs): Replace sh_type template parameter with
1532 Classify_reloc class. Use it to access r_sym and r_type fields.
1533 * target.h (Target::is_call_to_non_split): Replace r_type parameter
1534 with pointer to relocation. Adjust all callers.
1535 (Target::do_is_call_to_non_split): Likewise.
1536 (Target::emit_relocs_scan): New virtual method.
1537 (Sized_target::get_r_sym): New virtual method.
1538 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
1539 with pointer to relocation.
1541 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
1542 (Target_aarch64::Relocatable_size_for_reloc): Remove.
1543 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
1544 (Target_aarch64::scan_relocs): Likewise.
1545 (Target_aarch64::relocate_section): Likewise.
1546 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
1548 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
1549 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
1550 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
1552 (Target_arm::emit_relocs_scan): New method.
1553 (Target_arm::Relocatable_size_for_reloc): Replace with...
1554 (Target_arm::Classify_reloc): ...this.
1555 (Target_arm::gc_process_relocs): Use Classify_reloc.
1556 (Target_arm::scan_relocs): Likewise.
1557 (Target_arm::relocate_section): Likewise.
1558 (Target_arm::scan_relocatable_relocs): Likewise.
1559 (Target_arm::relocate_relocs): Likewise.
1560 * i386.cc (Target_i386::emit_relocs_scan): New method.
1561 (Target_i386::Relocatable_size_for_reloc): Replace with...
1562 (Target_i386::Classify_reloc): ...this.
1563 (Target_i386::gc_process_relocs): Use Classify_reloc.
1564 (Target_i386::scan_relocs): Likewise.
1565 (Target_i386::relocate_section): Likewise.
1566 (Target_i386::scan_relocatable_relocs): Likewise.
1567 (Target_i386::relocate_relocs): Likewise.
1568 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
1570 (Mips_reloc_types): New class template.
1571 (Mips_classify_reloc): New class template.
1572 (Target_mips::Reltype): New typedef.
1573 (Target_mips::Relatype): New typedef.
1574 (Target_mips::emit_relocs_scan): New method.
1575 (Target_mips::get_r_sym): New method.
1576 (Target_mips::Relocatable_size_for_reloc): Replace with
1577 Mips_classify_reloc.
1578 (Target_mips::copy_reloc): Use Mips_classify_reloc.
1579 (Target_mips::gc_process_relocs): Likewise.
1580 (Target_mips::scan_relocs): Likewise.
1581 (Target_mips::relocate_section): Likewise.
1582 (Target_mips::scan_relocatable_relocs): Likewise.
1583 (Target_mips::relocate_relocs): Likewise.
1584 (mips_get_size_for_reloc): New function, factored out from
1585 Relocatable_size_for_reloc::get_size_for_reloc.
1586 (Target_mips::Scan::local): Use Mips_classify_reloc.
1587 (Target_mips::Scan::global): Likewise.
1588 (Target_mips::Relocate::relocate): Likewise.
1589 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
1590 (Target_powerpc::Relocatable_size_for_reloc): Remove.
1591 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
1592 (Target_powerpc::scan_relocs): Likewise.
1593 (Target_powerpc::relocate_section): Likewise.
1594 (Powerpc_scan_relocatable_reloc): Convert to class template.
1595 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
1596 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
1597 (Powerpc_scan_relocatable_reloc::sh_type): New const.
1598 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
1599 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
1600 (Target_powerpc::scan_relocatable_relocs): Use
1601 Powerpc_scan_relocatable_reloc.
1602 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
1603 * s390.cc (Target_s390::emit_relocs_scan): New method.
1604 (Target_s390::Relocatable_size_for_reloc): Remove.
1605 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
1606 (Target_s390::scan_relocs): Likewise.
1607 (Target_s390::relocate_section): Likewise.
1608 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
1610 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
1611 (Target_s390::relocate_relocs): Use Default_classify_reloc.
1612 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
1613 (Target_sparc::Relocatable_size_for_reloc): Remove.
1614 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
1615 (Target_sparc::scan_relocs): Likewise.
1616 (Target_sparc::relocate_section): Likewise.
1617 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
1619 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
1620 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
1621 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
1622 (Target_tilegx::Relocatable_size_for_reloc): Remove.
1623 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
1624 (Target_tilegx::scan_relocs): Likewise.
1625 (Target_tilegx::relocate_section): Likewise.
1626 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
1628 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
1629 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
1630 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
1631 (Target_x86_64::Relocatable_size_for_reloc): Remove.
1632 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
1633 (Target_x86_64::scan_relocs): Likewise.
1634 (Target_x86_64::relocate_section): Likewise.
1635 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1637 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
1638 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
1640 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
1642 2016-01-01 Alan Modra <amodra@gmail.com>
1644 Update year range in copyright notice of all files.
1646 For older changes see ChangeLog-0815
1648 Copyright (C) 2016 Free Software Foundation, Inc.
1650 Copying and distribution of this file, with or without modification,
1651 are permitted in any medium without royalty provided the copyright
1652 notice and this notice are preserved.
1658 version-control: never