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