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