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