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