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