xref: /netbsd-src/external/gpl3/binutils/dist/bfd/ChangeLog (revision fdd524d4ccd2bb0c6f67401e938dabf773eb0372)
12016-01-25  Tristan Gingold  <gingold@adacore.com>
2
3	* version.m4: Bump version to 2.26
4	* configure: Regenerate.
5
62016-01-14  Alan Modra  <amodra@gmail.com>
7
8	PR ld/19421
9	PR ld/4317
10	* elflink.c (elf_link_input_bfd): Revert 2015-02-19 changes.
11	(elf_link_output_extsym): Likewise.
12
132016-01-11  Jiong Wang  <jiong.wang@arm.com>
14
15	Apply from master
16
17	2016-01-08  Richard Sandiford  <richard.sandiford@arm.com>
18		    Jiong Wang  <jiong.wang@arm.com>
19
20	PR ld/19368
21	* elf32-arm.c (elf32_arm_reloc_type_class): Map R_ARM_IRELATIVE to
22	reloc_class_ifunc.
23
242016-01-06  Maciej W. Rozycki  <macro@imgtec.com>
25
26	Apply from master.
27	2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
28	* elfxx-mips.c (mips_elf_merge_obj_attributes): Propagate the
29	return status from `_bfd_elf_merge_object_attributes'.
30
312015-12-11  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
32
33	Apply from master.
34	2015-11-19  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
35
36	PR ld/19263
37	* elf32-s390.c (elf_s390_gc_sweep_hook): Add null ptr check.
38	* elf64-s390.c (elf_s390_check_relocs): Port the GOTOFF handling
39	over from the 32 bit code.
40	(elf_s390_relocate_section): Likewise.
41
422015-12-10  Alan Modra  <amodra@gmail.com>
43
44	Apply from master.
45	2015-12-07  Alan Modra  <amodra@gmail.com>
46	* elf32-ppc.c (ppc_elf_check_relocs): Don't error on local ifunc
47	plt call.  Wrap long lines.
48	(ppc_elf_relocate_section): Wrap long lines.
49	* elf64-ppc.c (ppc64_elf_check_relocs): Don't error on local ifunc
50	plt calls.  Move __tls_get_addr checks later.  Don't create plt
51	for addr14/addr24 relocs.
52	(ppc64_elf_gc_sweep_hook): Adjust to suit check_relocs changes.
53	(ppc64_elf_relocate_section): Correct local ifunc handling for
54	PLT64, PLT32 and PLT16 relocs.
55
56	2015-12-07  Alan Modra  <amodra@gmail.com>
57	PR 19323
58	* elfcode.h (elf_object_p): Check for ridiculous e_shnum and
59	e_phnum values.
60
61	2015-12-07  Alan Modra  <amodra@gmail.com>
62	* reloc.c (BFD_RELOC_PPC64_ENTRY): New.
63	* elf64-ppc.c (reloc_howto_type ppc64_elf_howto_raw): Add
64	entry for R_PPC64_ENTRY.
65	(LD_R2_0R12, ADD_R2_R2_R12, LIS_R2, ADDIS_R2_R12): Define.
66	(ppc64_elf_reloc_type_lookup): Handle R_PPC64_ENTRY.
67	(ppc64_elf_relocate_section): Edit code at R_PPC64_ENTTY.  Use
68	new insn defines.
69	* libbfd.h: Regenerate.
70	* bfd-in2.h: Regenerate.
71
72	2015-12-02  Alan Modra  <amodra@gmail.com>
73	PR binutils/19315
74	* dwarf2.c (_bfd_elf_find_function): Return symbol matched.
75	(_bfd_dwarf2_find_nearest_line): Check symbol returned above
76	against dwarf range.
77	* elf-bfd.h (_bfd_elf_find_function): Update prototype.
78
79	2015-12-02  Alan Modra  <amodra@gmail.com>
80	* elf64-ppc.c (ppc64_elf_tls_optimize): Don't segfault on NULL
81	symbol section or output section.
82	(ppc64_elf_edit_toc): Similarly for ld -R objects.
83	(ppc64_elf_size_stubs): Likewise.
84
85	2015-11-20  Stefan Teleman  <stefan.teleman@oracle.com>
86	PR ld/19260
87	* cache.c (bfd_cache_max_open): Avoid using getrlimit on 32-bit
88	Solaris as the result is unreliable.
89
90	2015-11-18  Alan Modra  <amodra@gmail.com>
91	PR 19256
92	* archive.c (bfd_generic_openr_next_archived_file): Don't allow
93	backward file movement via "negative" sizes.
94	* coff-alpha.c (alpha_ecoff_openr_next_archived_file): Likewise.
95
962015-12-04  H.J. Lu  <hongjiu.lu@intel.com>
97
98	* elf32-i386.c (elf_i386_convert_load): Skip if addend isn't 0.
99	(elf_i386_relocate_section): Skip R_386_GOT32X optimization if
100	addend isn't 0.
101
1022015-12-01  H.J. Lu  <hongjiu.lu@intel.com>
103
104	PR ld/19319
105	* elf32-i386.c (elf_i386_convert_load): Check h->def_regular
106	instead of bfd_link_hash_new.
107	* elf64-x86-64.c (elf_x86_64_convert_load): Likewise.  Skip
108	relocation overflow for bfd_link_hash_undefined and
109	bfd_link_hash_new if h->def_regular is set.
110
1112015-11-13  Tristan Gingold  <gingold@adacore.com>
112
113	* version.m4: Bump version to 2.25.90
114	* configure: Regenerate.
115
1162015-11-13  Tristan Gingold  <gingold@adacore.com>
117
118	* version.m4: Bump version to 2.26.51
119	* configure: Regenerate.
120
1212015-11-11  Alan Modra  <amodra@gmail.com>
122            Peter Bergner <bergner@vnet.ibm.com>
123
124	* elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_REL16DX_HA.
125	(ppc_elf_reloc_type_lookup): Handle R_PPC_REL16DX_HA.
126	(ppc_elf_addr16_ha_reloc): Likewise.
127	(ppc_elf_check_relocs): Likewise.
128	(ppc_elf_relocate_section): Likewise.
129	(is_insn_dq_form): Handle lxv and stxv instructions.
130	* elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_REL16DX_HA.
131	(ppc64_elf_reloc_type_lookup): Handle R_PPC64_REL16DX_HA.
132	(ppc64_elf_ha_reloc): Likewise.
133	(ppc64_elf_check_relocs): Likewise.
134	(ppc64_elf_relocate_section): Likewise.
135	* bfd-in2.h: Regenerate.
136	* libbfd.h: Likewise.
137	* reloc.c (BFD_RELOC_PPC_REL16DX_HA): New.
138
1392015-11-10  H.J. Lu  <hongjiu.lu@intel.com>
140
141	* elf32-i386.c (elf_i386_relocate_section): Handle VTINHERIT
142	and VTENTRY relocations when deleting relocations.
143	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
144
1452015-11-10  H.J. Lu  <hongjiu.lu@intel.com>
146
147	* elf32-i386.c (elf_i386_relocate_section): Properly move
148	kept relocations when deleting relocations.
149	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
150
1512015-11-09  H.J. Lu  <hongjiu.lu@intel.com>
152
153	* elf32-i386.c (elf_i386_relocate_section): Use read and write
154	pointers to reloc array, rather than memmove when deleting a
155	reloc.  Don't use RELOC_AGAINST_DISCARDED_SECTION.  Adjust
156	reloc counts at end of loop.
157	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
158
1592015-11-10  Alan Modra  <amodra@gmail.com>
160
161	* elf64-ppc.c (ppc64_elf_relocate_section): Use read and write
162	pointers to reloc array, rather than memmove when deleting a
163	reloc.  Don't use RELOC_AGAINST_DISCARDED_SECTION.  Adjust
164	reloc counts at end of loop.
165	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
166
1672015-11-09  Dominik Vogt  <vogt@linux.vnet.ibm.com>
168
169	* elf64-ppc.c (ppc64_elf_size_stubs, ppc64_elf_build_stubs): Fix left
170	shift of negative value.
171	* libbfd.c (safe_read_leb128): Likewise.
172	* dwarf2.c (place_sections): Likewise.
173	* bfd-in.h (align_power): Likewise.
174	* bfd-in2.h (align_power): Likewise.
175
1762015-10-30  Nick Clifton  <nickc@redhat.com>
177
178	* po/zh_CN.po: Updated (simplified) Chinese translation.
179
1802015-10-29  Catherine Moore  <clm@codesourcery.com>
181
182    	* elfxx-mips.c (mips_elf_check_mips16_stubs): Set a stub's output
183    	section to bfd_abs_section_ptr if the stub is discarded.
184
1852015-10-29  Ed Schouten  <ed@nuxi.nl>
186
187	* config.bfd (targ_defvec): Add support for CloudABI on aarch64.
188	For this target we have to make sure we use ELFOSABI_CLOUDABI
189	instead of ELFOSABI_NONE.
190	* configure.ac (tb): Likewise.
191	* elfnn-aarch64.c: Likewise.
192	* targets.c (_bfd_target_vector): Likewise.
193	* configure: Regenerate.
194
1952015-10-29  Pedro Alves  <palves@redhat.com>
196
197	* libhppa.h (bfd_hppa_insn2fmt): Add cast.
198
1992015-10-28  H.J. Lu  <hongjiu.lu@intel.com>
200
201	* elf32-i386.c (elf_i386_relocate_section): Fix a typo in
202	comment.
203
2042015-10-28  Nick Clifton  <nickc@redhat.com>
205
206	* elf32-arm.c (create_instruction_branch_absolute): Replace
207	pointer parameters with a simple integer parameter.
208	(stm32l4xx_create_replacing_stub_ldmia): Update calls to
209	create_instruction_branch_absolute.
210	(stm32l4xx_create_replacing_stub_ldmdb): Likewise.
211	(stm32l4xx_create_replacing_stub_vldm): Likewise.
212	(elf32_arm_write_section): Use pointer type for veneer addresses.
213
2142015-10-28  Cupertino Miranda  <cmiranda@synopsys.com>
215
216	* reloc.c (BFD_RELOC_ARC_32_PCREL): New entry.
217	* elf32-arc.c (arc_elf_howto_ini): Update formula.
218	(get_middle_endian_relocation): New function.
219	(PDATA): Define.
220	* bfd-in2.h: Regenerate.
221	* libbfd.h: Likewise.
222
2232015-10-28  Alan Modra  <amodra@gmail.com>
224
225	PR ld/19162
226	* elflink.c (_bfd_elf_gc_mark_reloc): Move code iterating over
227	linker input bfds..
228	* section.c (bfd_get_next_section_by_name): ..to here.  Add ibfd param.
229	(bfd_get_linker_section): Adjust bfd_get_next_section_by_name call.
230	* tekhex.c (first_phase): Likewise.
231	* elflink.c (bfd_elf_gc_sections): Likewise.
232	* bfd-in2.h: Regenerate.
233
2342015-10-27  Laurent Alfonsi <laurent.alfonsi@st.com>
235            Christophe Monat <christophe.monat@st.com>
236
237	* bfd-in2.h: Regenerate.
238	* bfd-in.h (bfd_arm_stm32l4xx_fix): New enum. Specify how
239	STM32L4XX instruction scanning should be done.
240	(bfd_elf32_arm_set_stm32l4xx_fix)
241	(bfd_elf32_arm_stm32l4xx_erratum_scan)
242	(bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Add prototypes.
243	(bfd_elf32_arm_set_target_relocs): Add stm32l4xx fix type argument
244	to prototype.
245	* elf32-arm.c (STM32L4XX_ERRATUM_VENEER_SECTION_NAME)
246	(STM32L4XX_ERRATUM_VENEER_ENTRY_NAME): Define macros.
247	(elf32_stm32l4xx_erratum_type): New enum.
248	(elf32_stm32l4xx_erratum_list): New struct. List of veneers or
249	jumps to veneers.
250	(_arm_elf_section_data): Add stm32l4xx_erratumcount,
251	stm32l4xx_erratumlist.
252	(elf32_arm_link_hash_table): Add stm32l4xx_erratum_glue_size,
253	stm32l4xx_fix and num_stm32l4xx_fixes fields.
254	(ctz): New function.
255	(popcount): New function.
256	(elf32_arm_link_hash_table_create): Initialize stm32l4xx_fix.
257	(put_thumb2_insn): New function.
258	(STM32L4XX_ERRATUM_LDM_VENEER_SIZE): Define. Size of a veneer for
259	LDM instructions.
260	(STM32L4XX_ERRATUM_VLDM_VENEER_SIZE): Define. Size of a veneer for
261	VLDM instructions.
262	(bfd_elf32_arm_allocate_interworking_sections): Initialise erratum
263	glue section.
264	(record_stm32l4xx_erratum_veneer) : New function. Create a single
265	veneer, and its associated symbols.
266	(bfd_elf32_arm_add_glue_sections_to_bfd): Add STM32L4XX erratum glue.
267	(bfd_elf32_arm_set_stm32l4xx_fix): New function. Set the type of
268	erratum workaround required.
269	(bfd_elf32_arm_stm32l4xx_fix_veneer_locations): New function. Find
270	out where veneers and branches to veneers have been placed in
271	virtual memory after layout.
272	(is_thumb2_ldmia): New function.
273	(is_thumb2_ldmdb): Likewise.
274	(is_thumb2_vldm ): Likewise.
275	(stm32l4xx_need_create_replacing_stub): New function. Decide if a
276	veneer must be emitted.
277	(bfd_elf32_arm_stm32l4xx_erratum_scan): Scan the sections of an
278	input BFD for potential erratum-triggering insns. Record results.
279	(bfd_elf32_arm_set_target_relocs): Set stm32l4xx_fix field in
280	global hash table.
281	(elf32_arm_size_dynamic_sections): Collect glue information.
282	(create_instruction_branch_absolute): New function.
283	(create_instruction_ldmia): Likewise.
284	(create_instruction_ldmdb): Likewise.
285	(create_instruction_mov): Likewise.
286	(create_instruction_sub): Likewise.
287	(create_instruction_vldmia): Likewise.
288	(create_instruction_vldmdb): Likewise.
289	(create_instruction_udf_w): Likewise.
290	(create_instruction_udf): Likewise.
291	(push_thumb2_insn32): Likewise.
292	(push_thumb2_insn16): Likewise.
293	(stm32l4xx_fill_stub_udf): Likewise.
294	(stm32l4xx_create_replacing_stub_ldmia): New function. Expands the
295	replacing stub for ldmia instructions.
296	(stm32l4xx_create_replacing_stub_ldmdb): Likewise for ldmdb.
297	(stm32l4xx_create_replacing_stub_vldm): Likewise for vldm.
298	(stm32l4xx_create_replacing_stub): New function. Dispatches the
299	stub emission to the appropriate functions.
300	(elf32_arm_write_section): Output veneers, and branches to veneers.
301
3022015-10-27  Sangamesh Mallayya  <nickc@redhat.com>sangamesh.swamy@in.ibm.com>
303
304	* configure.ac (powerpc64-*-aix[5-9].*): Match powerpc64 running
305	aix for core file support.
306	* configure: Regenerate.
307	* rs6000-core.c: Check for __ld_info64 if compiling 64-bit gdb.
308	Added BFD64 check if we are using old core file format for 32-bit gdb.
309	Set sizeof CORE_COMMONSZ appropriately in case of either new or
310	old core file format.
311	(read_hdr): Added BFD64 check for 64-bit support.
312	(rs6000coff_core_p): Likewise.
313	(rs6000coff_core_file_matches_executable_p): Likewise.
314	(rs6000coff_core_file_failing_command): Likewise.
315	(rs6000coff_core_file_failing_signal): Likewise.
316	Add support for debugging core files generated by binaries in
317	Large Memory model.
318	(rs6000coff_core_p): If Large Memory Model is used, then the .data
319	segment should start from BDATAORG which has been defined in the
320	system header files.
321
3222015-10-26  H.J. Lu  <hongjiu.lu@intel.com>
323
324	PR ld/19175
325	* elf32-i386.c (elf_i386_convert_load): Check bfd_link_hash_new
326	instead of calling bfd_link_get_defined_symbol.
327	* elf64-x86-64.c (elf_x86_64_convert_load): Likewise.  Skip
328	relocation overflow for bfd_link_hash_new.
329	* linker.c (bfd_link_get_defined_symbol): Removed.
330	* bfd-in2.h: Regenerated.
331
3322015-10-26  H.J. Lu  <hongjiu.lu@intel.com>
333
334	PR ld/19171
335	* elf32-i386.c (elf_i386_convert_load): Call
336	bfd_link_get_defined_symbol to check if a symbol is defined.
337	* elf64-x86-64.c (elf_x86_64_convert_load): Call
338	bfd_link_get_defined_symbol to get defined symbol section and
339	value.
340	* linker.c (bfd_link_get_defined_symbol): New function.
341	* bfd-in2.h: Regenerated.
342
3432015-10-23  Alan Modra  <amodra@gmail.com>
344
345	PR ld/11133
346	PR ld/19161
347	PR ld/19167
348	* elflink.c (_bfd_elf_gc_mark_hook): Delete code handling __start_*
349	and __stop_* symbol refs.
350	(_bfd_elf_gc_mark_rsec): Add start_stop parameter.  Handle __start_*
351	and __stop_* symbol refs here..
352	(_bfd_elf_gc_mark_reloc): ..and here.
353	* elf-bfd.h (_bfd_elf_gc_mark_hook): Update prototype.
354	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Update
355	_bfd_elf_gc_mark_rsec call.
356
3572015-10-23  Alan Modra  <amodra@gmail.com>
358
359	PR ld/11133
360	PR ld/19161
361	* elflink.c (elf_gc_sweep): Revert last patch.
362	(_bfd_elf_gc_mark_hook): Don't set SEC_KEEP here.
363
3642015-10-22  H.J. Lu  <hongjiu.lu@intel.com>
365
366	PR ld/19161
367	* elflink.c (elf_gc_sweep): Always keep sections marked with
368	SEC_KEEP.
369
3702015-10-22  Hans-Peter Nilsson  <hp@bitrange.com>
371
372	* mmo.c (struct mmo_data_struct): New members
373	symbol_consistency_override_calculated and ignore_symbol_consistency.
374	(mmo_section_has_contents, mmo_ignore_symbol_consistency): New
375	functions.
376	(mmo_create_symbol): Check with mmo_ignore_symbol_consistency if to
377	report an error for unexpected value of Main.
378	(mmo_write_symbols_and_terminator): Similar.
379
3802015-10-22  H.J. Lu  <hongjiu.lu@intel.com>
381
382	* elf32-i386.c (elf_i386_convert_load): Use call_nop_byte and
383	check call_nop_as_suffix for 1-byte NOP padding to pad call.
384	* elf64-x86-64.c (elf_x86_64_convert_load): Likewise.
385
3862015-10-22  H.J. Lu  <hongjiu.lu@intel.com>
387
388	* elf64-x86-64.c: Include opcode/i386.h.
389	(x86_64_elf_howto_table): Add R_X86_64_GOTPCRELX and
390	R_X86_64_REX_GOTPCRELX.
391	(R_X86_64_standard): Replace R_X86_64_PLT32_BND with
392	R_X86_64_REX_GOTPCRELX.
393	(x86_64_reloc_map): Add BFD_RELOC_X86_64_GOTPCRELX and
394	BFD_RELOC_X86_64_REX_GOTPCRELX.
395	(need_convert_mov_to_lea): Renamed to ...
396	(need_convert_load): This.
397	(elf_x86_64_check_relocs): Handle R_X86_64_GOTPCRELX and
398	R_X86_64_REX_GOTPCRELX.  Replace need_convert_mov_to_lea with
399	need_convert_load.
400	(elf_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPCRELX and
401	R_X86_64_REX_GOTPCRELX.
402	(elf_x86_64_size_dynamic_sections): Likewise.
403	(elf_x86_64_relocate_section): Likewise.
404	(elf_x86_64_convert_mov_to_lea): Renamed to ...
405	(elf_x86_64_convert_load): This.  Replace need_convert_mov_to_lea
406	with need_convert_load.  Support R_X86_64_GOTPCRELX and
407	R_X86_64_REX_GOTPCRELX transformations.
408	* reloc.c (BFD_RELOC_X86_64_GOTPCRELX): New.
409	(BFD_RELOC_X86_64_REX_GOTPCRELX): Likewise.
410	* bfd-in2.h: Regenerated.
411	* libbfd.h: Likewise.
412
4132015-10-22  H.J. Lu  <hongjiu.lu@intel.com>
414
415	* elf32-i386.c: Include opcode/i386.h.
416	(elf_howto_table): Add R_386_GOT32X.
417	(R_386_ext2): Replace R_386_IRELATIVE with R_386_GOT32X.
418	(elf_i386_reloc_type_lookup): Handle BFD_RELOC_386_GOT32X.
419	(need_convert_mov_to_lea): Renamed to ...
420	(need_convert_load): This.
421	(elf_i386_check_relocs): Handle R_386_GOT32X.  Replace
422	need_convert_mov_to_lea with need_convert_load.
423	(elf_i386_gc_sweep_hook): Handle R_386_GOT32X.
424	(elf_i386_size_dynamic_sections): Likewise.
425	(elf_i386_relocate_section): Likewise.
426	(elf_i386_convert_mov_to_lea): Renamed to ...
427	(elf_i386_convert_load): This.  Replace need_convert_mov_to_lea
428	with need_convert_load.  Support R_386_GOT32X transformations.
429	* reloc.c (BFD_RELOC_386_GOT32X): New.
430	* bfd-in2.h: Regenerated.
431	* libbfd.h: Likewise.
432
4332015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
434
435	* elf32-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
436	only when linking an executable.
437	(elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
438	slot.
439	* elf64-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
440	only when linking an executable.
441	(elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
442	slot.
443
4442015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
445
446	* elf32-s390.c (elf_s390_adjust_dynamic_symbol): Set the PLT
447	reference counters for local IFUNC calls.
448	* elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
449
4502015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
451
452	* elf32-s390.c (elf_s390_check_relocs): Fallthrough to the PLT
453	slot allocating code for GOTOFF relocs on ifunc symbols.
454	(elf_s390_gc_sweep_hook): Decrement plt refcount for GOTOFF relocs
455	on ifunc symbols.
456	(elf_s390_relocate_section): Redirect a GOTOFF reloc to an iplt
457	slot.
458
4592015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
460
461	PR ld/18841
462	* elf32-s390.c (elf_s390_reloc_type_class): Return
463	reloc_class_ifunc for ifunc symbols.
464	* elf64-s390.c (elf_s390_reloc_type_class): Likewise.
465
4662015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
467
468	* elf32-s390.c (elf_s390_finish_dynamic_symbol): Call
469	elf_s390_finish_ifunc_symbol only for actually defined symbols.
470	* elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
471
4722015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
473
474	* elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs): Remove
475	`head' parameter.
476	* elf32-s390.c (allocate_dynrelocs): Don't use last parameter.
477	* elf64-s390.c (allocate_dynrelocs): Don't use last parameter.
478
4792015-10-20  Hans-Peter Nilsson  <hp@bitrange.com>
480
481	* mmo.c (mmo_write_symbols_and_terminator): Correct printed value
482	of Main in error message.
483
4842015-10-18  Doug Evans  <xdje42@gmail.com>
485
486	* targets.c (bfd_flavour_name): "MMO" is spelled "mmo".
487
4882015-10-17  Alan Modra  <amodra@gmail.com>
489
490	* elf64-ppc.c (ppc64_elf_size_stubs): Correct __glink_PLTresolve
491	eh_frame FDE for ELFv1.
492
4932015-10-16  H.J. Lu  <hongjiu.lu@intel.com>
494
495	* elf32-i386.c (elf_i386_convert_mov_to_lea): Check if symbol
496	is defined.
497	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
498
4992015-10-16  H.J. Lu  <hongjiu.lu@intel.com>
500
501	* elf32-i386.c (elf_i386_convert_mov_to_lea): Don't check
502	def_regular.
503	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
504
5052015-10-15  H.J. Lu  <hongjiu.lu@intel.com>
506
507	* elflink.c (_bfd_elf_merge_symbol): Fix typos in comments
508
5092015-10-15  Alan Modra  <amodra@gmail.com>
510
511	* elf32-v850.c (v850_elf_copy_private_bfd_data): Remove assertion
512	that input and output .note.renesas sections are same size.
513	Instead, only copy input to output if they are.
514
5152015-10-15  Riku Voipio  <riku.voipio@iki.fi>
516
517	PR ld/19123
518	* elfcore.h (elf_core_file_p): Use the file_ptr type to hold the
519	offset for bfd_seek.
520	* elfcode.h (elf_object_p): Likewise.
521
5222015-10-14  Rich Felker  <dalias@libc.org>
523
524	PR ld/19091
525	* elf32-sh.c (sh_elf_size_dynamic_sections): Always emit
526	DT_PLTGOT for FDPIC output.
527
5282015-10-13  Alan Modra  <amodra@gmail.com>
529
530	* elf.c (_bfd_elf_map_sections_to_segments): Don't set
531	PT_GNU_RELRO p_flags.
532	(assign_file_positions_for_non_load_sections): Set PT_GNU_RELRO
533	flags to PF_R here.
534
5352015-10-12  H.J. Lu  <hongjiu.lu@intel.com>
536
537	PR ld/19073
538	* elflink.c (_bfd_elf_add_default_symbol): Skip the unversioned
539	definition after the default version.
540
5412015-10-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
542
543	PR ld/19083
544	* elf32-s390.c (elf_s390_gc_sweep_hook): Do not reduce got
545	refcount for relocs not really requiring a got slot.
546	* elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
547
5482015-10-11  John David Anglin  <danglin@gcc.gnu.org>
549
550	* elf-hppa.h (elf_hppa_action_discarded): Ignore relocations in
551	.data.rel.ro.local.
552
5532015-10-07  Cupertino Miranda  <cmiranda@synopsys.com>
554
555	* archures.c: Remove support for older ARC. Added support for new
556	ARC cpus (ARC600, ARC601, ARC700, ARCV2).
557	* bfd-in2.h: Likewise.
558	* config.bfd: Likewise.
559	* cpu-arc.c: Likewise.
560	* elf32-arc.c: Totally changed file with a refactored
561	inplementation of the ARC port.
562	* libbfd.h: Added ARC specific relocation types.
563	* reloc.c: Likewise.
564
5652015-10-06  H.J. Lu  <hongjiu.lu@intel.com>
566
567	* bfd.c (bfd_update_compression_header): Clear the ch_reserved
568	field in 64-bit output.
569	(bfd_convert_section_contents): Likewise.
570
5712015-10-05  H.J. Lu  <hongjiu.lu@intel.com>
572
573	PR ld/18914
574	* elflink.c (elf_link_add_object_symbols): Don't re-export a
575	symbol if it isn't undefined.
576
5772015-10-04  H.J. Lu  <hongjiu.lu@intel.com>
578
579	* config.bfd (targ_selvecs, targ64_selvecs): Add iamcu_elf32_vec,
580	i386_pei_vec and x86_64_pei_vec for Solaris2/x86.
581
5822015-10-02  Renlin Li  <renlin.li@arm.com>
583
584	* elfnn-aarch64.c (aarch64_tls_transition_without_check):  Add
585	relax transitions for TLSDESC_ADD, TLSDESC_LDR, TLSDESC_OFF_G0_NC,
586	TLSDESC_OFF_G1.
587	(aarch64_tls_transition_without_check): Add relaxation support.
588	(aarch64_reloc_got_type): Add support.
589	(elfNN_aarch64_final_link_relocate): Likewise.
590	(elfNN_aarch64_tls_relax): Likewise.
591	(elfNN_aarch64_relocate_section): Likewise.
592	(elfNN_aarch64_gc_sweep_hook): Likewise.
593	(elfNN_aarch64_check_relocs): Likewise.
594	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
595	(_bfd_aarch64_elf_resolve_relocation): Likewise.
596
5972015-10-02  Renlin Li  <renlin.li@arm.com>
598
599	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Check overflow for
600	BFD_RELOC_AARCH64_TLSDESC_OFF_G1.
601
6022015-10-02  Renlin Li  <renlin.li@arm.com>
603
604	* elfnn-aarch64.c(IS_AARCH64_TLS_RELAX_RELOC):
605	Add relaxation support for TLSGD_MOVW_G0_NC and TLSGD_MOVW_G1.
606	(aarch64_tls_transition_without_check): Likewise
607	(elfNN_aarch64_tls_relax): Likwise.
608
6092015-10-02  Renlin Li  <renlin.li@arm.com>
610
611	* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Create GOT section
612	for TLSLE_MOVW_TPREL_G(1, 1_NC, 2) relocation.
613
6142015-10-02  Renlin Li  <renlin.li@arm.com>
615
616	* reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
617	AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
618	* libbfd.h: Regenerate.
619	* bfd-in2.h: Likewise.
620	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
621	TLSIE_MOVW_GOTTPREL_G1 check overflow.
622	(aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
623	and TLSIE_MOVW_GOTTPREL_G0_NC.
624	(elfNN_aarch64_final_link_relocate): Likewise.
625	(elfNN_aarch64_relocate_section): Likewise.
626	(elfNN_aarch64_gc_sweep_hook): Likewise.
627	(elfNN_aarch64_check_relocs): Likewise.
628	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
629	(_bfd_aarch64_elf_resolve_relocation): Likewise.
630
6312015-10-02  Renlin Li  <renlin.li@arm.com>
632
633	* elfnn-aarch64.c (aarch64_reloc_got_type): Add
634	BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC support.
635	(elfNN_aarch64_final_link_relocate): Likewise.
636	(elfNN_aarch64_relocate_section): Likewise.
637	(elfNN_aarch64_gc_sweep_hook): Likewise.
638	(elfNN_aarch64_check_relocs): Likewise.
639	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
640	(_bfd_aarch64_elf_resolve_relocation): Likewise.
641
6422015-10-02  Renlin Li  <renlin.li@arm.com>
643
644	* reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC): New entry.
645	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
646	BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC.
647	* libbfd.h: Regenerate.
648	* bfd-in2.h: Likewise
649
6502015-10-02  Renlin Li  <renlin.li@arm.com>
651
652	* elfnn-aarch64.c (aarch64_reloc_got_type): Add
653	BFD_RELOC_AARCH64_TLSGD_MOVW_G1 support.
654	(elfNN_aarch64_final_link_relocate): Likewise.
655	(elfNN_aarch64_relocate_section): Likewise.
656	(elfNN_aarch64_gc_sweep_hook): Likewise.
657	(elfNN_aarch64_check_relocs): Likewise.
658	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
659	(_bfd_aarch64_elf_resolve_relocation): Likewise.
660
6612015-10-02  Renlin Li  <renlin.li@arm.com>
662
663	* reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G1): New entry.
664	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
665	BFD_RELOC_AARCH64_TLSGD_MOVW_G1.
666	* bfd-in2.h: Regenerate.
667	* libbfd.h: Likewise.
668
6692015-10-02  Renlin Li  <renlin.li@arm.com>
670
671	* elfnn-aarch64.c (aarch64_reloc_got_type): Add
672	BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC support.
673	(elfNN_aarch64_final_link_relocate): Likewise.
674	(elfNN_aarch64_gc_sweep_hook): Likewise.
675	(elfNN_aarch64_check_relocs): Likewise.
676	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
677	(_bfd_aarch64_elf_resolve_relocation): Likewise.
678
6792015-10-02  Renlin Li  <renlin.li@arm.com>
680
681	* reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC): New.
682	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry
683	MOVW_GOTOFF_G0_NC.
684	* libbfd.h: Regnerate.
685	* bfd-in2.h: Regenerate.
686
6872015-10-02  Renlin Li  <renlin.li@arm.com>
688
689	* elfnn-aarch64.c (aarch64_reloc_got_type): Add support
690	for BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
691	(elfNN_aarch64_gc_sweep_hook): Likewise.
692	(elfNN_aarch64_check_relocs): Likewise
693	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
694	(_bfd_aarch64_elf_resolve_relocation): Likewise
695	(elfNN_aarch64_final_link_relocate): Likewise
696
6972015-010-02  Renlin Li  <renlin.li@arm.com>
698
699	* reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G1): New.
700	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
701	MOVW_GOTOFF_G1.
702	* libbfd.h: Regenerate.
703	* bfd-in2.h: Regenerate.
704
7052015-10-02  Renlin Li  <renlin.li@arm.com>
706
707	* elfnn-aarch64.c (aarch64_reloc_got_type): Add
708	BFD_RELOC_AARCH64_LD_64_GOTOFF_LO15 support.
709	(elfNN_aarch64_gc_sweep_hook): Likewise.
710	(elfNN_aarch64_check_relocs): Likewise
711	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
712	(_bfd_aarch64_elf_resolve_relocation): Likewise
713	(elfNN_aarch64_final_link_relocate): Calculate offset within GOT.
714
7152015-10-02  Renlin Li  <renlin.li@arm.com>
716
717	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Change if to
718	switch statement.
719
7202015-10-01  H.J. Lu  <hongjiu.lu@intel.com>
721
722	PR ld/19031
723	* elf64-x86-64.c (elf_x86_64_check_relocs): Set
724	pointer_equality_needed for R_X86_64_PC32 reloc in non-code
725	sections.
726
7272015-10-01  Renlin Li  <renlin.li@arm.com>
728
729	* elfnn-aarch64.c (elfNN_aarch64_output_plt_map): Remove.
730	(elfNN_aarch64_output_arch_local_syms): Emit AARCH64_MAP_INSN once.
731
7322015-10-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
733
734	* config.bfd (targ_selvecs): Remove sh_elf32_vec and
735	sh_elf32_le_vec	from sh*-*-linux cases.
736
7372015-10-01  Alan Modra  <amodra@gmail.com>
738
739	PR ld/19013
740	* elflink.c (_bfd_elf_merge_sections): Revert last change.
741
7422015-09-30  H.J. Lu  <hongjiu.lu@intel.com>
743
744	PR ld/19031
745	* elf32-i386.c (elf_i386_check_relocs): Set
746	pointer_equality_needed for R_386_PC32 reloc in non-code
747	sections.
748
7492015-09-30  H.J. Lu  <hongjiu.lu@intel.com>
750
751	PR ld/19013
752	* elflink.c (_bfd_elf_merge_sections): Only merge input bfds
753	that have the compatible ELF machine code with the output bfd.
754
7552015-09-30  Alan Modra  <amodra@gmail.com>
756
757	PR ld/19013
758	* elflink.c (_bfd_elf_merge_sections): Only merge input bfds that
759	will be handled by elf_link_input_bfd.  Rename abfd param to obfd.
760
7612015-09-30  Rich Felker  <dalias@libc.org>
762
763	* config.bfd (targ_selvecs): Add fdpic and misc targets
764	for sh*-*-linux*.
765
7662015-09-29  Andrew Stubbs  <ams@codesourcery.com>
767	    H.J. Lu  <hongjiu.lu@intel.com>
768
769	PR binutils/19020
770	* bfd.c (bfd_convert_section_contents): Add ptr_size parameter.
771	* bfd-in2.h: Regenerated.
772
7732015-08-11  Peter Zotov  <whitequark@whitequark.org>
774
775	PR ld/18759
776	* elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
777	(R_OR1K_16_PCREL): Likewise.
778	(R_OR1K_8_PCREL): Likewise.
779
7802015-09-23  Nick Clifton  <nickc@redhat.com>
781
782	* bout.c (b_out_slurp_reloc_table): Cast constant to unsigned in
783	order to avoid problems with left shifting negative values.
784	(abs32code): Likewise.
785	* mach-o.c (FILE_ALIGN): Likewise.
786	* coff-rs6000.c (xcoff_debug_sections): Delete unused static
787	array.
788	* elf32-visium.c (visium_reloc_map): Likewise.
789	* elf32-arm.c (elf32_arm_final_link_relocate): Remove useless
790	calls to abs function.
791	* elf32-frv.c (_frvfdpic_relax_tls_entries): Likewise.
792	* elf32-score.c (score_elf_final_link_relocate): Likewise.
793	* elf32-score7.c (score_elf_final_link_relocate): Likewise.
794	* elf32-i860.c (i860_howto_pc26_reloc): Use multiplication instead
795	of shifting to create a negative mask.
796	* elf32-msp430.c (elf_backend_special_sections): Define.
797	* elfxx-mips.c (got_ofst_reloc_p): Delete unused function.
798	(got_hi16_reloc_p): Delete unused function.
799	* ppcboot.c (ppcboot_bfd_print_private_bfd_data): Fix test of
800	partition name.
801
8022015-09-23  Nick Clifton  <nickc@redhat.com>
803
804	PR binutils/15835
805	* elf-bfd.h (struct elf_section_list): New structure.
806	(struct elf_obj_tdata): Replace symtab_shndx_hdr with
807	symtab_shndx_list.  Delete symtab_shndx_section.
808	(elf_symtab_shndx): Replace macro with elf_symtab_shndx_list.
809	* elf.c (bfd_elf_get_syms): If symtab index sections are present,
810	scan them for the section that matches the provided symbol table.
811	(bfd_section_from_shdr): Record all SHT_SYMTAB_SHNDX sections.
812	(assign_section_numbers): Use the first symtab index table in the
813	list.
814	(_bfd_elf_compute_section_file_positions): Replace use of
815	symtab_shndx_hdr with use of symtab_shndx_list.
816	(find_section_in_list): New function.
817	(assign_file_postions_except_relocs): Use new function.
818	(_bfd_elf_copy_private_symbol_data): Likewise.
819	(swap_out_syms): Handle multiple symbol table index sections.
820	* elf32-m32c.c (m32c_elf_relax_section): Replace use of
821	symtab_shndx_hdr with use of symtab_shndx_list.
822	* elf32-rl78.c (rl78_elf_relax_section): Likewise.
823	* elf32-rx.c (rx_relax_section): Likewise.
824	* elf32-v850.c (v850_elf_relax_delete_bytes): Likewise.
825	* elflink.c (bfd_elf_final_link): Likewise.
826
8272015-09-21  H.J. Lu  <hongjiu.lu@intel.com>
828
829	* bfd.c (bfd_update_compression_header): Use bfd_put_32 on
830	ch_type.
831	(bfd_check_compression_header): Use bfd_get_32 on ch_type.
832	(bfd_convert_section_contents): Use bfd_get_32 and bfd_put_32
833	on ch_type.
834
8352015-09-20  Rich Felker  <dalias@libc.org>
836
837	* elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create
838	.interp when info->nointerp.
839	(bfd_elf_size_dynamic_sections): Adjust assert.
840	* elf32-arm.c (elf32_arm_size_dynamic_sections): Don't size .interp
841	when info->nointerp.
842	* elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
843	* elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
844	* elf32-cris.c (elf_cris_size_dynamic_sections): Likewise.
845	* elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
846	* elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
847	* elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
848	* elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
849	* elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
850	* elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
851	* elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
852	* elf32-metag.c (elf_metag_size_dynamic_sections): Likewise.
853	* elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
854	* elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
855	* elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
856	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
857	* elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
858	* elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
859	* elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
860	* elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
861	* elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Likewise.
862	* elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
863	* elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
864	* elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise.
865	* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
866	* elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
867	* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
868	* elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
869	* elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
870	* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
871	* elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise.
872	* elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise.
873	* elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
874	* elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
875	* elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
876
8772015-09-18  Doug Evans  <xdje42@gmail.com>
878
879	* targets.c (enum bfd_flavour): Add comment.
880	(bfd_flavour_name): New function.
881	* bfd-in2.h: Regenerate.
882
8832015-09-18  Alan Modra  <amodra@gmail.com>
884
885	* elf64-ppc.h (struct ppc64_elf_params <tls_get_addr_opt>): Rename
886	from no_tls_get_addr_opt.
887	* elf64-ppc.c: Update for rename and inversion of tls_get_addr_opt.
888	(ppc64_elf_tls_setup): Set tls_get_addr_opt to 0 only when at
889	default of -1.
890
8912015-09-17  Alan Modra  <amodra@gmail.com>
892
893	PR 18867
894	* elflink.c (elf_link_adjust_relocs): Correct start of insertion
895	sort main loop.
896
8972015-09-16  Alan Modra  <amodra@gmail.com>
898
899	PR 18867
900	* elflink.c (elf_link_adjust_relocs): Modify insertion sort to
901	insert a run.  Return status in case of malloc failure.
902	Adjust callers.
903
9042015-09-15  Max Filippov  <jcmvbkbc@gmail.com>
905
906	* elf32-xtensa.c (elf_xtensa_be_plt_entry)
907	(elf_xtensa_le_plt_entry): Emit 'entry' instruction only for
908	windowed ABI.
909	(elf_xtensa_create_plt_entry): Generate 'l32r' offsets and fix
910	up instructions according to ABI.
911
9122015-09-14  Rich Felker  <dalias@libc.org>
913
914	* elf32-sh.c (sh_elf_relocate_section): Set EF_SH_PIC flag
915	instead of clearing it on cross-section relocations.
916	(sh_elf_merge_private_data): Clear EF_SH_PIC flag by default.
917
9182015-09-12  Helge Deller  <deller@gmx.de>
919
920	PR ld/18514
921	* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Set .plt entry
922	size to 0.
923
9242015-09-09  Jiong Wang  <jiong.wang@arm.com>
925
926	* elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Sort alphabetically.
927
9282015-09-09  Jiong Wang  <jiong.wang@arm.com>
929
930	* elfnn-aarch64.c (aarch64_tls_transition_without_check): Support three
931	TLS local dynamic traditional relocations types.
932	(elfNN_aarch64_tls_relax): Support TLS local dynamic traditional to
933	local executable relaxation.
934
9352015-09-03  H.J. Lu  <hongjiu.lu@intel.com>
936
937	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Remove
938	convert_mov_to_lea.
939
9402015-09-02  H.J. Lu  <hongjiu.lu@intel.com>
941
942	* elf32-i386.c (R_386_irelative): Renamed to ...
943	(R_386_ext2): This.
944	(R_386_vt_offset): Updated.
945	(elf_i386_rtype_to_howto): Likewise.
946	(elf_i386_relocate_section): Likewise.
947
9482015-09-01  H.J. Lu  <hongjiu.lu@intel.com>
949
950	PR ld/18900
951	* elf32-i386.c (elf_i386_link_hash_entry): Add
952	func_pointer_refcount.
953	(elf_i386_link_hash_newfunc): Clear func_pointer_refcount.
954	(elf_i386_get_local_sym_hash): Likewise.
955	(elf_i386_copy_indirect_symbol): Also copy
956	func_pointer_refcount.
957	(elf_i386_check_relocs): Increment func_pointer_refcount.
958	(elf_i386_gc_sweep_hook): Decrement func_pointer_refcount.
959	(elf_i386_allocate_dynrelocs): Don't create the PLT entry if
960	there are only function pointer relocations which can be
961	resolved at run-time.  Keep dynanamic relocations for run-time
962	function pointer initialization.
963	(elf_i386_relocate_section): Copy dynamic function pointer
964	relocations.
965	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
966	func_pointer_refcount.
967	(elf_x86_64_link_hash_newfunc): Clear func_pointer_refcount.
968	(elf_x86_64_get_local_sym_hash): Likewise.
969	(elf_x86_64_copy_indirect_symbol): Also copy
970	func_pointer_refcount.
971	(elf_x86_64_check_relocs): Increment func_pointer_refcount.
972	(elf_x86_64_gc_sweep_hook): Decrement func_pointer_refcount.
973	(elf_x86_64_allocate_dynrelocs): Don't create the PLT entry if
974	there are only function pointer relocations which can be
975	resolved at run-time.  Keep dynanamic relocations for run-time
976	function pointer initialization.
977	(elf_x86_64_relocate_section): Copy dynamic function pointer
978	relocations.
979
9802015-09-01  Alan Modra  <amodra@gmail.com>
981
982	* elf64-ppc.c (ppc64_elf_maybe_function_sym): Adjust symbol value
983	if .opd section has been edited.
984
9852015-09-01  Alan Modra  <amodra@gmail.com>
986
987	PR 18878
988	* elf64-ppc.c (ARRAY_SIZE): Define.  Use throughout.
989	(enum ppc_stub_type): Add ppc_stub_save_res.
990	(struct map_stub): Add "next" and "needs_save_res".
991	(struct ppc_link_hash_entry): Add "save_res" flag.
992	(struct ppc_link_hash_table): Add "group".
993	(sfpr_define): Add stub_sec param.  Define symbol in stub_sec if
994	stub_sec is non-null.  Set "save_res".
995	(save_res_funcs): Make file scope, rename from funcs.  Adjust uses.
996	(ppc64_elf_adjust_dynamic_symbol): Prohibit plt call to save_res syms.
997	(ppc_build_one_stub): Handle ppc_stub_save_res.
998	(ppc_size_one_stub): Set stub type to ppc_size_one_stub on finding
999	stub for linker defined save_res sym.
1000	(group_sections): Init new fields of struct map_stub.
1001	(ppc64_elf_size_stubs): Reserve space for save/restore func copy.
1002	(ppc64_elf_build_stubs): Copy save/restore funcs to groups.  Emit
1003	alias syms too.
1004	(ppc64_elf_relocate_section): Set destination for ppc_stub_save_res.
1005
10062015-08-31  Alan Modra  <amodra@gmail.com>
1007
1008	* elf64-ppc.c (get_r2off): Return -1 on error.
1009	(ppc_build_one_stub): Adjust for get_r2off change.  Don't emit
1010	addi r2,r2,0 on r2off stubs when the low 16-bit delta is zero.
1011	(ppc_size_one_stub): Corresponding size changes for r2off stubs.
1012	Add condition in test for -R objects.
1013
10142015-08-31  Alan Modra  <amodra@gmail.com>
1015
1016	* section.c (section_id): Make file scope.
1017	(bfd_get_next_section_id): New function.
1018	* elf64-ppc.c (struct map_stub): Remove toc_off field.  Move decl.
1019	(struct ppc_stub_hash_entry): Delete stub_sec and id_sec.  Add
1020	group.  Update all uses.
1021	(struct ppc_link_hash_table): Delete top_id, top_index, and
1022	input_list.  Add sec_info_arr_size.  Rename stub_group to
1023	sec_info, and make group info indirect.  Update stub_group refs
1024	throughout file.
1025	(ppc_add_stub): Don't look for stub_sec on link_sec stub_group
1026	entry.
1027	(ppc_build_one_stub): Delete FIXME.
1028	(ppc64_elf_setup_section_lists): Size htab->sec_info for all
1029	sections, not just input sections.  Don't create htab->input_list.
1030	(ppc64_elf_next_input_section): Update to use sec_info union as
1031	list pointer.
1032	(PREV_SEC): Delete.
1033	(group_sections): Pass "info" param rather than "htab".  Iterate
1034	over output sections rather than input_list.  Use sec_info union
1035	as list pointers.  Alloc atruct map_stub, and return fail status.
1036	* bfd-in2.h: Regenerate.
1037
10382015-08-31  Alan Modra  <amodra@gmail.com>
1039
1040	* elflink.c (elf_sort_symbol): Use correctly sized type for
1041	calculating signed section->id difference.
1042	(elf_link_add_object_symbols): Likewise.
1043	* pef.c (bfd_pef_scan_start_address): Warning fix.
1044	* vms-alpha.c (vms_new_section_hook): Likewise.
1045
10462015-08-31  Alan Modra  <amodra@gmail.com>
1047
1048	* elf32-nds32.c (nds32_convert_32_to_16_alu1): Warning fix.
1049	(find_relocs_at_address_addr): Make "reloc_type" an enum.
1050	(nds32_elf_relax_delete_blanks): Warning fix.
1051	(nds32_elf_relax_loadstore): Correct loop bound.
1052
10532015-08-31  Alan Modra  <amodra@gmail.com>
1054
1055	* section.c (struct bfd_section): Make "id" and "index" unsigned.
1056	* coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust local var to suit.
1057	* elf.c (elf_map_symbols): Likewise.
1058	* elf64-ppc.c (sym_exists_at): Make "id" param unsigned.
1059	(struct ppc_link_hash_table): Make "top_id" and "top_index" unsigned.
1060	(ppc64_elf_setup_section_lists): Ditto for local vars.
1061	* elf32-arm.c: Similarly to elf64-ppc.c.
1062	* elf32-avr.c: Likewise.
1063	* elf32-hppa.c: Likewise.
1064	* elf32-m68hc1x.c: Likewise.
1065	* elf32-metag.c: Likewise.
1066	* elf32-nios2.c: Likewise.
1067	* elfnn-aarch64.c: Likewise.
1068	* simple.c (struct saved_offsets): Make "section_count" unsigned.
1069	* bfd-in2.h: Regenerate.
1070
10712015-08-27  Alan Modra  <amodra@gmail.com>
1072
1073	PR 18867
1074	* elf64-alpha.c (elf64_alpha_sort_relocs_p): New function.
1075	(elf_backend_sort_relocs_p): Define.
1076
10772015-08-26  Alan Modra  <amodra@gmail.com>
1078
1079	PR 18867
1080	* elflink.c (cmp_ext32l_r_offset, cmp_ext32b_r_offset): Delete.
1081	(cmp_ext64l_r_offset, cmp_ext64b_r_offset): Delete.
1082	(ext32l_r_offset, ext32b_r_offset, ext64l_r_offset, ext64b_r_offset):
1083	New functions.
1084	(elf_link_adjust_relocs): Use an insertion sort to sort relocs.
1085
10862015-08-26  Matthew Fortune  <matthew.fortune@imgtec.com>
1087
1088	PR ld/18401
1089	* elfxx-mips.c (bfd_mips_isa_ext_mach): New function: Converts an
1090	ISA value to a bfd machine number.
1091	(bfd_mips_isa_ext): Update the ISA level and revision if
1092	necessary.  Use mips_mach_extends_p to decide if the ISA extension
1093	needs to be set.
1094	(_bfd_mips_elf_merge_private_bfd_data): Allow the ISA extension to
1095	be inferred from the ABI setting.  Set the ISA level from the
1096	maximum of the incoming and outgoing ISA levels.
1097
10982015-08-25  Nick Clifton  <nickc@redhat.com>
1099
1100	PR binutils/18854
1101	* elf.c (bfd_section_from_shdr): Replace assertions with warnings
1102	about multiple symbol tables.
1103
11042015-08-25  Renlin Li  <renlin.li@arm.com>
1105
1106	* reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of
1107	ILP64.
1108	* bfd-in2.h: Regenerate.
1109
11102015-08-22  Alan Modra  <amodra@gmail.com>
1111
1112	* elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename.
1113	Don't copy fields not set by _bfd_elf_swap_verdef_in.
1114
11152015-08-19  Jiong Wang  <jiong.wang@arm.com>
1116
1117	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
1118	types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
1119	BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
1120	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
1121	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
1122	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
1123	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
1124	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
1125	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
1126	(elfNN_aarch64_final_link_relocate): Likewise.
1127	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1128	(_bfd_aarch64_elf_resolve_relocation): Likewise.
1129
11302015-08-19  Jiong Wang  <jiong.wang@arm.com>
1131
1132	* reloc.c (BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
1133	BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
1134	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
1135	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
1136	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
1137	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC.
1138	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
1139	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC): New entries.
1140	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
1141	* bfd-in2.h: Regenerate.
1142	* libbfd.h: Regenerate.
1143
11442015-08-19  Jiong Wang  <jiong.wang@arm.com>
1145
1146	PR ld/18276
1147	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
1148	types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
1149	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
1150	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
1151	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
1152	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
1153	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
1154	(elfNN_aarch64_final_link_relocate): Likewise.
1155	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1156	(_bfd_aarch64_elf_resolve_relocation): Likewise.
1157
11582015-08-19  Jiong Wang  <jiong.wang@arm.com>
1159
1160	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
1161	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
1162	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
1163	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
1164	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
1165	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2): New entries.
1166	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
1167	* bfd-in2.h: Regenerate.
1168	* libbfd.h: Regenerate.
1169
11702015-08-19  Jiong Wang  <jiong.wang@arm.com>
1171
1172	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1173	BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1174	(aarch64_reloc_got_type): Likewise.
1175	(elfNN_aarch64_final_link_relocate): Likewise.
1176	(elfNN_aarch64_relocate_section): Likewise.
1177	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1178	(_bfd_aarch64_elf_resolve_relocation): Likewise.
1179
11802015-08-19  Jiong Wang  <jiong.wang@arm.com>
1181
1182	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
1183	* bfd-in2.h: Regenerate.
1184	* libbfd.h: Regenerate.
1185	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1186	BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1187
11882015-08-19  Alan Modra  <amodra@gmail.com>
1189
1190	* elf-s390-common.c: Simplify expressions using
1191	bfd_linke_executable, bfd_link_pie and bfd_link_pic.
1192	* elf32-arm.c: Likewise.
1193	* elf32-bfin.c: Likewise.
1194	* elf32-frv.c: Likewise.
1195	* elf32-m68k.c: Likewise.
1196	* elf32-nios2.c: Likewise.
1197	* elf32-ppc.c: Likewise.
1198	* elf32-s390.c: Likewise.
1199	* elf32-sh.c: Likewise.
1200	* elf64-alpha.c: Likewise.
1201	* elf64-ppc.c: Likewise.
1202	* elf64-s390.c: Likewise.
1203	* elflink.c: Likewise.
1204
12052015-08-18  Jiong Wang  <jiong.wang@arm.com>
1206
1207	* elfnn-aarch64.c (aarch64_reloc_got_type): Delete useless check.
1208	(elfNN_aarch64_relocate_section): Likewise.
1209	(elfNN_aarch64_gc_sweep_hook): Likewise.
1210	(elfNN_aarch64_check_relocs): Likewise.
1211
12122015-08-18  H.J. Lu  <hongjiu.lu@intel.com>
1213
1214	PR ld/18841
1215	* elf-bfd.h (elf_link_hash_table): Add dynsym.
1216	* elf32-i386.c (elf_i386_reloc_type_class): Return
1217	reloc_class_ifunc for relocation against STT_GNU_IFUNC symbol.
1218	* elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
1219	* elflink.c (_bfd_elf_link_create_dynamic_sections): Set dynsym.
1220	(bfd_elf_size_dynsym_hash_dynstr): Use dynsym.
1221	(elf_final_link_info): Remove dynsym_sec.
1222	(elf_link_output_extsym): Replace dynsym_sec with dynsym.
1223	(bfd_elf_final_link): Remove reference to dynsym_sec.  Replace
1224	dynsym_sec with dynsym.
1225
12262015-08-18  H.J. Lu  <hongjiu.lu@intel.com>
1227
1228	* bfd/aoutx.h: Replace shared, executable, relocatable and pie
1229	fields with bfd_link_executable, bfd_link_dll,
1230	bfd_link_relocatable, bfd_link_pic and bfd_link_pie.
1231	* bfd/bout.c: Likewise.
1232	* bfd/coff-alpha.c: Likewise.
1233	* bfd/coff-arm.c: Likewise.
1234	* bfd/coff-i386.c: Likewise.
1235	* bfd/coff-i960.c: Likewise.
1236	* bfd/coff-m68k.c: Likewise.
1237	* bfd/coff-mcore.c: Likewise.
1238	* bfd/coff-mips.c: Likewise.
1239	* bfd/coff-ppc.c: Likewise.
1240	* bfd/coff-rs6000.c: Likewise.
1241	* bfd/coff-sh.c: Likewise.
1242	* bfd/coff-tic80.c: Likewise.
1243	* bfd/coff-x86_64.c: Likewise.
1244	* bfd/coff64-rs6000.c: Likewise.
1245	* bfd/coffgen.c: Likewise.
1246	* bfd/cofflink.c: Likewise.
1247	* bfd/ecoff.c: Likewise.
1248	* bfd/ecofflink.c: Likewise.
1249	* bfd/elf-bfd.h: Likewise.
1250	* bfd/elf-eh-frame.c: Likewise.
1251	* bfd/elf-ifunc.c: Likewise.
1252	* bfd/elf-m10200.c: Likewise.
1253	* bfd/elf-m10300.c: Likewise.
1254	* bfd/elf-s390-common.c: Likewise.
1255	* bfd/elf-vxworks.c: Likewise.
1256	* bfd/elf.c: Likewise.
1257	* bfd/elf32-arm.c: Likewise.
1258	* bfd/elf32-avr.c: Likewise.
1259	* bfd/elf32-bfin.c: Likewise.
1260	* bfd/elf32-cr16.c: Likewise.
1261	* bfd/elf32-cr16c.c: Likewise.
1262	* bfd/elf32-cris.c: Likewise.
1263	* bfd/elf32-crx.c: Likewise.
1264	* bfd/elf32-d10v.c: Likewise.
1265	* bfd/elf32-dlx.c: Likewise.
1266	* bfd/elf32-epiphany.c: Likewise.
1267	* bfd/elf32-fr30.c: Likewise.
1268	* bfd/elf32-frv.c: Likewise.
1269	* bfd/elf32-ft32.c: Likewise.
1270	* bfd/elf32-h8300.c: Likewise.
1271	* bfd/elf32-hppa.c: Likewise.
1272	* bfd/elf32-i370.c: Likewise.
1273	* bfd/elf32-i386.c: Likewise.
1274	* bfd/elf32-i860.c: Likewise.
1275	* bfd/elf32-ip2k.c: Likewise.
1276	* bfd/elf32-iq2000.c: Likewise.
1277	* bfd/elf32-lm32.c: Likewise.
1278	* bfd/elf32-m32c.c: Likewise.
1279	* bfd/elf32-m32r.c: Likewise.
1280	* bfd/elf32-m68hc11.c: Likewise.
1281	* bfd/elf32-m68hc1x.c: Likewise.
1282	* bfd/elf32-m68k.c: Likewise.
1283	* bfd/elf32-mcore.c: Likewise.
1284	* bfd/elf32-mep.c: Likewise.
1285	* bfd/elf32-metag.c: Likewise.
1286	* bfd/elf32-microblaze.c: Likewise.
1287	* bfd/elf32-moxie.c: Likewise.
1288	* bfd/elf32-msp430.c: Likewise.
1289	* bfd/elf32-mt.c: Likewise.
1290	* bfd/elf32-nds32.c: Likewise.
1291	* bfd/elf32-nios2.c: Likewise.
1292	* bfd/elf32-or1k.c: Likewise.
1293	* bfd/elf32-ppc.c: Likewise.
1294	* bfd/elf32-rl78.c: Likewise.
1295	* bfd/elf32-rx.c: Likewise.
1296	* bfd/elf32-s390.c: Likewise.
1297	* bfd/elf32-score.c: Likewise.
1298	* bfd/elf32-score7.c: Likewise.
1299	* bfd/elf32-sh-symbian.c: Likewise.
1300	* bfd/elf32-sh.c: Likewise.
1301	* bfd/elf32-sh64.c: Likewise.
1302	* bfd/elf32-spu.c: Likewise.
1303	* bfd/elf32-tic6x.c: Likewise.
1304	* bfd/elf32-tilepro.c: Likewise.
1305	* bfd/elf32-v850.c: Likewise.
1306	* bfd/elf32-vax.c: Likewise.
1307	* bfd/elf32-visium.c: Likewise.
1308	* bfd/elf32-xc16x.c: Likewise.
1309	* bfd/elf32-xstormy16.c: Likewise.
1310	* bfd/elf32-xtensa.c: Likewise.
1311	* bfd/elf64-alpha.c: Likewise.
1312	* bfd/elf64-hppa.c: Likewise.
1313	* bfd/elf64-ia64-vms.c: Likewise.
1314	* bfd/elf64-mmix.c: Likewise.
1315	* bfd/elf64-ppc.c: Likewise.
1316	* bfd/elf64-s390.c: Likewise.
1317	* bfd/elf64-sh64.c: Likewise.
1318	* bfd/elf64-x86-64.c: Likewise.
1319	* bfd/elflink.c: Likewise.
1320	* bfd/elfnn-aarch64.c: Likewise.
1321	* bfd/elfnn-ia64.c: Likewise.
1322	* bfd/elfxx-mips.c: Likewise.
1323	* bfd/elfxx-sparc.c: Likewise.
1324	* bfd/elfxx-tilegx.c: Likewise.
1325	* bfd/i386linux.c: Likewise.
1326	* bfd/linker.c: Likewise.
1327	* bfd/m68klinux.c: Likewise.
1328	* bfd/pdp11.c: Likewise.
1329	* bfd/pe-mips.c: Likewise.
1330	* bfd/peXXigen.c: Likewise.
1331	* bfd/reloc.c: Likewise.
1332	* bfd/reloc16.c: Likewise.
1333	* bfd/sparclinux.c: Likewise.
1334	* bfd/sunos.c: Likewise.
1335	* bfd/vms-alpha.c: Likewise.
1336	* bfd/xcofflink.c: Likewise.
1337
13382015-08-18  Alan Modra  <amodra@gmail.com>
1339
1340	PR 18667
1341	* Makefile.am: Use $(SED) in place of sed throughout.
1342	* Makefile.in: Regenerate.
1343
13442015-08-18  Alan Modra  <amodra@gmail.com>
1345
1346	* elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't redefine .TOC.
1347	if already defined, and set linker_def.
1348	(ppc64_elf_set_toc): Use .TOC. value if defined other than by
1349	the backend.
1350
13512015-08-14  Alan Modra  <amodra@gmail.com>
1352
1353	PR ld/18759
1354	* elf32-or1k.c: Revert 2015-08-11 change.
1355
13562015-08-13  H.J. Lu  <hongjiu.lu@intel.com>
1357
1358	PR ld/18801
1359	* elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error
1360	for read-only segment with dynamic IFUNC relocations.
1361	* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
1362
13632015-08-12  Simon Dardis  <simon.dardis@imgtec.com>
1364
1365	* elfxx-mips.c (STUB_MOVE): Change to use 'or' only.
1366	(mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry,
1367	mips_n64_exec_plt0_entry, micromips_insn32_o32_exec_plt0_entry):
1368	Update to use 'or' instead of 'addu/daddu'.
1369	(_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE.
1370	(move_insns_32): Reorder table.
1371
13722015-08-11  H.J. Lu  <hongjiu.lu@intel.com>
1373
1374	* elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
1375	relocations in debug sections.
1376	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1377
13782015-08-11  Jiong Wang  <jiong.wang@arm.com>
1379
1380	* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
1381	message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
1382
13832015-08-11  Jiong Wang  <jiong.wang@arm.com>
1384
1385	* elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
1386	(aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
1387
13882015-08-11  Jiong Wang  <jiong.wang@arm.com>
1389
1390	* bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
1391	Loose the check for symbol from ABS section.
1392	(elfNN_aarch64_size_stubs): Pass sym_sec.
1393
13942015-08-11  Jiong Wang  <jiong.wang@arm.com>
1395
1396	PR ld/18668
1397	* elfnn-aarch64.c (aarch64_type_of_stub): Update destination for
1398	calls go through plt stub.
1399	(elfNN_aarch64_final_link_relocate): Adjust code logic for CALL26,
1400	JUMP26 relocation to support inserting veneer for call to plt stub.
1401
14022015-08-11  Jiong Wang  <jiong.wang@arm.com>
1403
1404	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1405	BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
1406	(aarch64_reloc_got_type): Likewise.
1407	(elfNN_aarch64_final_link_relocate): Likewise.
1408	(elfNN_aarch64_relocate_section): Likewise.
1409	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1410	(_bfd_aarch64_elf_resolve_relocation): Likewise.
1411
14122015-08-11  Jiong Wang  <jiong.wang@arm.com>
1413
1414	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry.
1415	* bfd-in2.h: Regenerate.
1416	* libbfd.h: Regenerate.
1417	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1418	BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
1419
14202015-08-11  Jiong Wang  <jiong.wang@arm.com>
1421
1422	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1423	BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
1424	(aarch64_reloc_got_type): Likewise.
1425	(elfNN_aarch64_final_link_relocate): Likewise.
1426	(elfNN_aarch64_relocate_section): Likewise.
1427	(elfNN_aarch64_gc_sweep_hook): Likewise.
1428	(elfNN_aarch64_check_relocs): Likewise.
1429	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1430	(_bfd_aarch64_elf_resolve_relocation): Likewise.
1431
14322015-08-11  Jiong Wang  <jiong.wang@arm.com>
1433
1434	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry.
1435	* bfd-in2.h: Regenerate.
1436	* libbfd.h: Regenerate.
1437	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1438	BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
1439
14402015-08-11  Jiong Wang  <jiong.wang@arm.com>
1441
1442	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1443	BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
1444	(aarch64_reloc_got_type): Likewise.
1445	(elfNN_aarch64_final_link_relocate): Likewise.
1446	(elfNN_aarch64_relocate_section): Likewise.
1447	(elfNN_aarch64_gc_sweep_hook): Likewise.
1448	(elfNN_aarch64_check_relocs): Likewise.
1449	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1450	(_bfd_aarch64_elf_resolve_relocation): Likewise.
1451
14522015-08-11  Jiong Wang  <jiong.wang@arm.com>
1453
1454	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry.
1455	* bfd-in2.h: Regenerate.
1456	* libbfd.h: Regenerate.
1457	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1458	BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
1459
14602015-08-11  H.J. Lu  <hongjiu.lu@intel.com>
1461
1462	PR ld/18808
1463	* elf32-i386.c (elf_i386_relocate_section): Skip IFUNC
1464	relocations in debug sections.
1465	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1466
14672015-08-11  Peter Zotov  <whitequark@whitequark.org>
1468
1469	PR ld/18759
1470	* elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
1471	(R_OR1K_16_PCREL): Likewise.
1472	(R_OR1K_8_PCREL): Likewise.
1473
14742015-08-11  Nick Clifton  <nickc@redhat.com>
1475
1476	PR binutils/18747
1477	* coff-sh.c (_bfd_sh_align_load_span): Fix typo when setting
1478	opcode count.
1479
1480	PR binutils/18758
1481	* elf.c (_bfd_elf_setup_sections): Add checks for corrupt section
1482	group information.
1483	* peicode.h (pe_ILF_make_a_section): Ensure alignment of the
1484	used_by_bfd pointer.
1485	(pe_ILF_build_a_bfd): Ensure alignment of vars.data pointer.
1486
14872015-08-11  H.J. Lu  <hongjiu.lu@intel.com>
1488
1489	* elf.c (_bfd_elf_copy_private_bfd_data): Fix a typo.
1490
14912015-08-10  H.J. Lu  <hongjiu.lu@intel.com>
1492
1493	* elf-bfd.h (elf_symbol_version): New enum.
1494	(elf_link_hash_entry): Replace hidden with versioned.
1495	* elflink.c (_bfd_elf_merge_symbol): Don't look for symbol
1496	version if the symbol is unversioned.  Initialize versioned.
1497	(_bfd_elf_add_default_symbol): Don't look for symbol version
1498	if the symbol is unversioned or hidden.  Initialize versioned.
1499	(elf_collect_hash_codes): Don't look for symbol version if the
1500	symbol is unversioned.
1501	(elf_collect_gnu_hash_codes): Likewise.
1502	(bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
1503	(_bfd_elf_link_hash_copy_indirect): Check versioned instead of
1504	hidden.
1505	(elf_link_output_extsym): Likewise.
1506
15072015-08-07  H.J. Lu  <hongjiu.lu@intel.com>
1508
1509	PR binutils/18785
1510	* elf.c (_bfd_elf_copy_private_bfd_data): When copying the
1511	sh_link and sh_info fields in stripped section headers, we also
1512	check if the sh_type, sh_flags, sh_addralign and sh_entsize
1513	fields of the output section match the output.  Since
1514	--only-keep-debug turns all non-debug sections into SHT_NOBITS
1515	sections, the output SHT_NOBITS type matches any input type.
1516
15172015-08-07  H.J. Lu  <hongjiu.lu@intel.com>
1518
1519	PR ld/18720
1520	* elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate
1521	if the new symbol matches the existing one.  The new hidden
1522	versioned symbol matches the existing symbol if they have the
1523	same symbol version. Update the existing symbol only if they
1524	match.
1525	(_bfd_elf_add_default_symbol): Update call to
1526	_bfd_elf_merge_symbol.
1527	(_bfd_elf_link_assign_sym_version): Don't set the hidden field
1528	here.
1529	(elf_link_add_object_symbols): Override a definition only if the
1530	new symbol matches the existing one.
1531	(_bfd_elf_link_hash_copy_indirect): Don't copy any references to
1532	the hidden versioned symbol.
1533	(elf_link_output_extsym): Bind a symbol locally when linking
1534	executable if it is locally defined, hidden versioned, not
1535	referenced by shared library and not exported.  Turn on
1536	VERSYM_HIDDEN only if the hidden versioned symbol is defined
1537	locally.
1538
15392015-08-05  Nick Clifton  <nickc@redhat.com>
1540
1541	* elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
1542	sh_info fields of sections whose type has been changed to
1543	SHT_NOBITS.
1544
15452015-08-04  Yuriy M. Kaminskiy"  <yumkam@gmail.com>
1546	    Tyler Hicks  <tyhicks@canonical.com>
1547
1548	PR binutils/18750
1549	* ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
1550	and stack overflow when char is signed and \200-\376 was in place of hex
1551	digit; also fixes \377 was handled as EOF instead of "incorrect character".
1552	(ihex_read_section): Changed for consistency.
1553	(ihex_bad_byte): Prevent (now impossible to trigger) stack
1554	overflow and incorrect escape sequence handling.
1555	* srec.c (srec_bad_byte): Likewise.
1556
15572015-08-03  Hans-Peter Nilsson  <hp@axis.com>
1558
1559	* elf32-cris.c (cris_elf_relocate_section)
1560	(elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
1561	(elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
1562	just link_info->symbolic, to check if a symbol should be bound
1563	symbolically.
1564
15652015-07-30  H.J. Lu  <hongjiu.lu@intel.com>
1566
1567	PR ld/18735
1568	* elflink.c (_bfd_elf_add_default_symbol): Add the default
1569	symbol if not performing a relocatable link.
1570	(elf_link_add_object_symbols): Adjust the default symbol if
1571	not performing a relocatable link.
1572
15732015-07-29  H.J. Lu  <hongjiu.lu@intel.com>
1574
1575	* elflink.c (elf_link_add_object_symbols): Remove
1576	!info->relocatable check for info->executable.  Add
1577	!info->relocatable check for !info->executable.
1578	(elf_link_output_extsym): Remove
1579	!info->relocatable check for info->executable.
1580
15812015-07-29  Hans-Peter Nilsson  <hp@bitrange.com>
1582
1583	* mmo.c (mmo_write_symbols_and_terminator): Skip symbol-type
1584	assignment loop for bfd plugin objects.
1585
15862015-07-28  Alan Modra  <amodra@gmail.com>
1587
1588	* elf.c (_bfd_elf_map_sections_to_segments): Do not make a new
1589	segment for loaded sections after nonloaded sections if the
1590	sections are on the same page.
1591
15922015-07-28  Iain Buclaw  <ibuclaw@gdcproject.org>
1593
1594	* configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
1595	* config.in, configure: Regenerate.
1596
15972015-07-27  H.J. Lu  <hongjiu.lu@intel.com>
1598
1599	* configure: Regenerated.
1600
16012015-07-27  Nick Clifton  <nickc@redhat.com>
1602
1603	* elf32-msp430.c (uses_large_model): New function.
1604	(msp430_elf_eh_frame_address_size): New function.
1605	(elf_backend_eh_frame_address_size): Define.
1606
16072015-07-27  Szabolcs Nagy  <szabolcs.nagy@arm.com>
1608
1609	PR ld/18705
1610	* elfnn-aarch64.c (elf_backend_extern_protected_data): Define.
1611
16122015-07-27  Szabolcs Nagy  <szabolcs.nagy@arm.com>
1613
1614	PR ld/18705
1615	* elf32-arm.c (elf_backend_extern_protected_data): Define.
1616
16172015-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1618
1619	PR ld/18718
1620	* elflink.c (elf_link_output_extsym): Check symbol version
1621	section check only if not linking executable, the symbol is
1622	referenced by shared library or not locally defined.
1623
16242015-07-25  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1625
1626	* elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to
1627	check if a symbol should be bound symbolically.
1628	* elf32-hppa.c (elf32_hppa_check_relocs,
1629	elf32_hppa_adjust_dynamic_symbol, elf32_hppa_relocate_section,
1630	elf32_hppa_finish_dynamic_symbol): Likewise.
1631	* elf32-m68k.c (elf_m68k_check_relocs,
1632	elf_m68k_relocate_section): Likewise.
1633	* elf32-nios2.c (nios2_elf32_relocate_section,
1634	nios2_elf32_check_relocs, allocate_dynrelocs): Likewise.
1635	* elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol,
1636	elf32_tic6x_relocate_section): Likewise.
1637
16382015-07-24  Alan Modra  <amodra@gmail.com>
1639
1640	* elf.c (_bfd_elf_assign_file_positions_for_non_load): Use .rela
1641	prefix for reloc section corresponding to rela section associated
1642	with renamed debug section.
1643
16442015-07-24  Alan Modra  <amodra@gmail.com>
1645
1646	* section.c (bfd_get_section_by_name_if): Iterate over entire hash
1647	chain.
1648
16492015-07-23  Joseph Myers  <joseph@codesourcery.com>
1650
1651	* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
1652	<DT_MIPS_RLD_MAP_REL>: Add target address to host address
1653	difference, not to host pointer.
1654
16552015-07-22  Alan Modra  <amodra@gmail.com>
1656
1657	* elf64-ppc.c (opd_entry_value): Remove assertion.  Instead,
1658	return -1 if symbol referenced is not defined.  Tidy.
1659
16602015-07-20  Alan Modra  <amodra@gmail.com>
1661
1662	* po/SRC-POTFILES.in: Regenerate.
1663
16642015-07-17  Jiong Wang  <jiong.wang@arm.com>
1665
1666	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Sort alphabetically.
1667	(IS_AARCH64_TLSDESC_RELOC): Sort alphabetically.
1668
16692015-07-16  Jiong Wang  <jiong.wang@arm.com>
1670
1671	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1672	BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1673	(aarch64_reloc_got_type): Ditto.
1674	(elfNN_aarch64_final_link_relocate): Ditto.
1675	(elfNN_aarch64_relocate_section): Ditto.
1676	(elfNN_aarch64_gc_sweep_hook): Ditto.
1677	(elfNN_aarch64_check_relocs): Ditto.
1678	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1679	(_bfd_aarch64_elf_resolve_relocation): Ditto.
1680
16812015-07-16  Jiong Wang  <jiong.wang@arm.com>
1682
1683	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PREL21): New entry.
1684	* bfd-in2.h: Regenerate.
1685	* libbfd.h: Regenerate.
1686	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1687	BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1688
16892015-07-10  H.J. Lu  <hongjiu.lu@intel.com>
1690
1691	 PR binutils/18656
1692	 * bfd.c (bfd_convert_section_size): New function.
1693	 (bfd_convert_section_contents): Likewise.
1694	 * bfd-in2.h: Regenerated.
1695
16962015-07-09  Catherine Moore  <clm@codesourcery.com>
1697
1698	* elflink.c (bfd_elf_size_dynamic_sections): Call to
1699	_bfd_elf_maybe_strip_eh_frame_hdr should be before
1700	bed->elf_backend_size_dynamic_sections.
1701
17022015-07-08  Pitchumani Sivanupandi <pitchumani.s@atmel.com>
1703
1704	* elf32-avr.c: Add 32 bit PC relative relocation for AVR target.
1705
17062015-07-05  Richard Sandiford  <richard.sandiford@arm.com>
1707
1708	* elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value
1709	plus addend rather than the original st_value when looking up
1710	entries in opd->adjust.
1711
17122015-07-03   Kai Tietz  <ktietz@redhat.com>
1713	     Nick Clifton  <nickc@redhat.com>
1714
1715	PR ld/11539
1716	* coffcode.h (coff_bfd_gc_sections): Define default
1717	to bfd_coff_gc_sections function.
1718	(coff_gc_mark_hook_fn): New type.
1719	* coffgen.c (init_reloc_cookie): Copy and adjust coff
1720	related code about gc-sections from elflink.c to here.
1721	(fini_reloc_cookie): Likewise.
1722	(init_reloc_cookie_rels): Likewise.
1723	(fini_reloc_cookie_rels): Likewise.
1724	(init_reloc_cookie_for_section): Likewise.
1725	(fini_reloc_cookie_for_section): Likewise.
1726	(_bfd_coff_gc_mark_hook): Likewise.
1727	(_bfd_coff_gc_mark_rsec): Likewise.
1728	(_bfd_coff_gc_mark_reloc): Likewise.
1729	(_bfd_coff_gc_mark): Likewise.
1730	(_bfd_coff_gc_mark_extra_sections): Likewise.
1731	(coff_gc_sweep_symbol_info): Likewise.
1732	(coff_gc_sweep_symbol): Likewise.
1733	(gc_sweep_hook_fn): Likewise.
1734	(coff_gc_sweep): Likewise.
1735	(bfd_coff_gc_sections): Likewise.
1736	(_bfd_coff_gc_keep): Likewise.
1737	* libcoff-in.h (coff_reloc_cookie): New struct.
1738	(bfd_coff_gc_sections): New prototype.
1739	* libcoff.h: Regenerate.
1740
17412015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
1742	    Cesar Philippidis  <cesar@codesourcery.com>
1743
1744	* bfd-in2.h: Regenerated.
1745	* elf32-nios2.c (elf_nios2_howto_table_rel): Rename to...
1746	(elf_nios2_r1_howto_table_rel): This.
1747	(elf_nios2_r2_howto_table_rel): New.
1748	(BFD_IS_R2): New.
1749	(lookup_howto): Add ABFD parameter.  Adjust to look up in either
1750	the R1 or R2 relocation table, as determined by ABFD.
1751	(nios2_reloc_map): Add R2 relocations.
1752	(nios2_elf32_bfd_reloc_type_lookup): Do lookup using lookup_howto.
1753	Pass it the ABFD parameter.
1754	(nios2_elf32_bfd_reloc_name_lookup): Use ABFD to decide whether to
1755	return an R1 or R2 relocation.
1756	(nios2_elf32_info_to_howto): Do lookup using lookup_howto.
1757	Pass it the ABFD parameter.
1758	(nios2_elf32_do_call26_relocate): Check for alignment on a 4-byte
1759	boundary.
1760	(nios2_elf32_relocate_section): Adjust call to lookup_howto.
1761	* libbfd.h: Regenerated.
1762	* reloc.c (BFD_RELOC_NIOS2_R2_S12): New.
1763	(BFD_RELOC_NIOS2_R2_I10_1_PCREL): New.
1764	(BFD_RELOC_NIOS2_R2_T1I7_1_PCREL): New.
1765	(BFD_RELOC_NIOS2_R2_T1I7_2): New.
1766	(BFD_RELOC_NIOS2_R2_T2I4): New.
1767	(BFD_RELOC_NIOS2_R2_T2I4_1): New.
1768	(BFD_RELOC_NIOS2_R2_T2I4_2): New.
1769	(BFD_RELOC_NIOS2_R2_X1I7_2): New.
1770	(BFD_RELOC_NIOS2_R2_X2L5): New.
1771	(BFD_RELOC_NIOS2_R2_F1I5_2): New.
1772	(BFD_RELOC_NIOS2_R2_L5I4X1): New.
1773	(BFD_RELOC_NIOS2_R2_T1X1I6): New.
1774	(BFD_RELOC_NIOS2_R2_T1X1I6_2): New.
1775
17762015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
1777	    Cesar Philippidis  <cesar@codesourcery.com>
1778
1779	* archures.c (bfd_mach_nios2r1, bfd_mach_nios2r2): New.
1780	* bfd-in2.h: Regenerated.
1781	* cpu-nios2.c (nios2_compatible): New.
1782	(N): Use nios2_compatible instead of bfd_default_compatible.
1783	(NIOS2R1_NEXT, NIOS2R2_NEXT): Define.
1784	(arch_info_struct): New.
1785	(bfd_nios2_arch): Chain to NIOS2R1_NEXT.
1786	* elf32-nios2.c (is_nios2_elf): New.
1787	(nios2_elf32_merge_private_bfd_data): New.
1788	(nios2_elf32_object_p): New.
1789	(bfd_elf32_bfd_merge_private_bfd_data): Define.
1790	(elf_backend_object_p): Define.
1791
17922015-07-01  H.J. Lu  <hongjiu.lu@intel.com>
1793
1794	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Refactor.
1795
17962015-06-30  Nick Clifton  <nickc@redhat.com>
1797
1798	PR binutils/18570
1799	* elf-attrs.c (obj_attr_size): Use an unsigned int type for the tag.
1800	(write_obj_attribute): Likewise.
1801	(elf_new_obj_attr): Likewise.
1802	(bfd_elf_get_obj_attr_int): Likewise.
1803	(bfd_elf_add_obj_attr_int): Likewise.
1804	(bfd_elf_add_obj_attr_string): Likewise.
1805	(bfd_elf_add_obj_attr_int_string): Likewise.
1806	(gnu_obj_attrs_arg_type): Likewise.
1807	(_bfd_elf_obj_attrs_arg_type): Likewise.
1808	(_bfd_elf_parse_attributes): Likewise.
1809	(_bfd_elf_merge_unknown_attribute_list): Likewise.
1810	* elf-bfd.h (struct obj_attribute_list): Likewise.
1811	Update prototypes.
1812
18132015-06-28  H.J. Lu  <hongjiu.lu@intel.com>
1814
1815	* bfd-in.h (compressed_debug_section_type): Remove
1816	COMPRESS_DEBUG_ZLIB.
1817	* bfd-in2.h : Regenerated.
1818
18192015-06-26  Matthew Fortune  <matthew.fortune@imgtec.com>
1820
1821	* elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable
1822	instead of !shared to indicate an application vs shared library.
1823	(_bfd_mips_elf_size_dynamic_sections): Likewise.
1824	(_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL.
1825	(_bfd_mips_elf_get_target_dtag): Likewise.
1826
18272015-06-25  DJ Delorie  <dj@redhat.com>
1828
1829	* elf32-msp430.c (msp430_final_link_relocate): Fix comments.  Fix
1830	REL loads to match RELA stores.
1831
18322015-06-25  H.J. Lu  <hongjiu.lu@intel.com>
1833
1834	* elf.c (_bfd_elf_compute_section_file_positions): Don't
1835	initialize sh_size for .shstrtab here.
1836
18372015-06-25  H.J. Lu  <hongjiu.lu@intel.com>
1838
1839	PR gas/18451
1840	* elf-bfd.h (elf_sym_strtab): New.
1841	(elf_link_hash_table): Add strtabcount, strtabsize and
1842	strtab.
1843	(_bfd_elf_stringtab_init): Removed.
1844	* elf.c (_bfd_elf_stringtab_init): Removed.
1845	(_bfd_elf_compute_section_file_positions): Replace
1846	bfd_strtab_hash/_bfd_elf_stringtab_init/_bfd_stringtab_free/
1847	_bfd_stringtab_size with
1848	elf_strtab_hash/_bfd_elf_strtab_init/_bfd_elf_strtab_free/
1849	_bfd_elf_strtab_size.  Use _bfd_elf_strtab_add,
1850	_bfd_elf_strtab_finalize and _bfd_elf_strtab_offset to get
1851	st_name.
1852	(swap_out_syms): Likewise.
1853	* elflink.c (elf_final_link_info): Replace bfd_strtab_hash
1854	with elf_strtab_hash.  Remove symbuf, symbuf_count,
1855	symbuf_size and shndxbuf_size.
1856	(elf_link_flush_output_syms): Removed.
1857	(elf_link_output_sym): Renamed to ...
1858	(elf_link_output_symstrtab): This.  Replace _bfd_stringtab_add
1859	with _bfd_elf_strtab_add.  Don't flush symbols to the file nor
1860	swap out symbols.
1861	(elf_link_swap_symbols_out): New.
1862	(elf_link_output_extsym): Replace elf_link_output_sym with
1863	elf_link_output_symstrtab.
1864	(elf_link_input_bfd): Likewise.
1865	(elf_final_link_free): Replace _bfd_stringtab_free with
1866	_bfd_elf_strtab_free.  Remove symbuf.
1867	(bfd_elf_final_link): Replace _bfd_elf_stringtab_init with
1868	_bfd_elf_strtab_init.  Don't set symbuf, symbuf_count,
1869	symbuf_size nor shndxbuf_size.  Initialize strtabsize and
1870	strtab.  Initialize symshndxbuf to -1 when number of sections
1871	>= 64K.  Replace elf_link_output_sym/elf_link_output_sym with
1872	elf_link_output_symstrtab/elf_link_output_symstrtab. Don't
1873	call elf_link_flush_output_syms.  Call _bfd_elf_strtab_finalize
1874	and elf_link_swap_symbols_out.  Replace _bfd_stringtab_size
1875	and _bfd_stringtab_emit with _bfd_elf_strtab_size and
1876	_bfd_elf_strtab_emit.
1877
18782015-06-24  H.J. Lu  <hongjiu.lu@intel.com>
1879
1880	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Silence older
1881	GCC warning.
1882
18832015-06-24  H.J. Lu  <hongjiu.lu@intel.com>
1884
1885	* elf32-i386.c (elf_i386_allocate_dynrelocs): Always allocate
1886	space for the first .plt entry.
1887	(elf_i386_size_dynamic_sections): Always add DT_PLTGOT for .plt
1888	section.  Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1889	there are PLT relocations.
1890	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Always
1891	allocate space for the first .plt entry.
1892	(elf_x86_64_size_dynamic_sections): Always add DT_PLTGOT for
1893	.plt section.  Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1894	there are PLT relocations.
1895
18962015-06-24  H.J. Lu  <hongjiu.lu@intel.com>
1897
1898	PR ld/18591
1899	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert
1900	R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation
1901	overflow.
1902
19032015-06-23  Jiong Wang  <jiong.wang@arm.com>
1904
1905	* elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function.
1906	(elfNN_aarch64_size_dynamic_sections): Traverse hash table to check
1907	relocations against read-only sections.
1908
19092015-06-18  Nick Clifton  <nickc@redhat.com>
1910
1911	PR 18481
1912	* elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.
1913
19142015-06-15  Jon Turney  <jon.turney@dronecode.org.uk>
1915
1916	* bfd.c: Change struct bfd_build_id to use bfd_size_type.
1917	* bfd-in2.h : Regenerate.
1918
19192015-06-16  Alan Modra  <amodra@gmail.com>
1920
1921	* elf32-ppc.c (ppc_elf_relocate_section): Correct binary search of
1922	dynamic relocs.
1923
19242015-06-10  Jon Turney  <jon.turney@dronecode.org.uk>
1925
1926	* elf-bfd.h : Remove struct elf_build_id.
1927	* bfd.c : Add struct bfd_build_id.
1928	* bfd-in2.h: Regenerate.
1929	* elf.c (elfobj_grok_gnu_build_id): Update to use bfd_build_id.
1930	* libpei.h: Add protoype and macros for
1931	bfd_XXi_slurp_codeview_record.
1932	* peXXigen.c (_bfd_XXi_slurp_codeview_record): Make public
1933	* peicode.h (pe_bfd_read_buildid): Add.
1934	(pe_bfd_object_p): Use pe_bfd_read_buildid().
1935
19362015-06-15  Renlin Li  <renlin.li@arm.com>
1937
1938	* reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry.
1939	* bfd-in2.h: Regenerate.
1940	* libbfd.h: Regenerate.
1941	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1942	BFD_RELOC_AARCH64_LD64_GOTOFF_LO15.
1943
19442015-06-15  Alan Modra  <amodra@gmail.com>
1945
1946	* cofflink.c (_bfd_coff_generic_relocate_section): Revert
1947	2014-03-26 change.  Call _bfd_clear_contents for relocs against
1948	local and global symbols defined in discarded input sections.
1949
19502015-06-05  Nick Clifton  <nickc@redhat.com>
1951
1952	* elf32-msp430.c (rl78_sym_diff_handler): New function.
1953	(msp430_howto_table): Use the new function for the SYM_DIFF reloc.
1954	(msp430x_howto_table): Likewise.
1955
19562015-06-05  Alan Modra  <amodra@gmail.com>
1957
1958	* elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
1959	relocs with insns moved by --ppc476-workaround.  Correct
1960	output of REL16 relocs.
1961
19622015-06-01  Jiong Wang  <jiong.wang@arm.com>
1963
1964	* elfnn-aarch64.c (aarch64_reloc_got_type): Support
1965	BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1966	(elfNN_aarch64_final_link_relocate): Ditto.
1967	(elfNN_aarch64_gc_swap_hook): Ditto.
1968	(elfNN_aarch64_check_relocs): Ditto.
1969	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1970
19712015-06-01  Jiong Wang  <jiong.wang@arm.com>
1972
1973	* reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
1974	* bfd-in2.h: Regenerate.
1975	* libbfd.h: Regenerate.
1976	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1977	BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1978
19792015-06-01  Jiong Wang  <jiong.wang@arm.com>
1980
1981	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
1982	complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1983	* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
1984	PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1985
19862015-06-01  Jiong Wang  <jiong.wang@arm.com>
1987
1988	* elfnn-aarch64.c (aarch64_reloc_got_type): Support
1989	BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
1990	(elfNN_aarch64_final_link_relocate): Ditto.
1991	(elfNN_aarch64_gc_swap_hook): Ditto.
1992	(elfNN_aarch64_check_relocs): Ditto.
1993	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1994
19952015-06-01  Jiong Wang  <jiong.wang@arm.com>
1996
1997	* reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
1998	* bfd-in2.h: Regenerate.
1999	* libbfd.h: Regenerate.
2000	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
2001	BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
2002
20032015-05-28  Catherine Moore  <clm@codesourcery.com>
2004	    Bernd Schmidt <bernds@codesourcery.com>
2005	    Paul Brook <paul@codesourcery.com>
2006
2007	bfd/
2008	* bfd-in2.h: Regenerated.
2009	* elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
2010	(COMPACT_EH_CANT_UNWIND_OPCODE): Define.
2011	(dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
2012	eh_frame_hdr_info.
2013	(compact_eh_frame_hdr_info): Declare.
2014	(eh_frame_hdr_info):  Redeclare with union for dwarf-specific
2015	fields and compact-eh fields.
2016	(elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
2017	(bfd_elf_section_data): Add eh_frame_entry_field.
2018	(elf_section_eh_frame_entry): Define.
2019	(bfd_elf_parse_eh_frame_entries): Declare.
2020	(_bfd_elf_parse_eh_frame_entry): Declare.
2021	(_bfd_elf_end_eh_frame_parsing): Declare.
2022	(_bfd_elf_write_section_eh_frame_entry): Declare.
2023	(_bfd_elf_eh_frame_entry_present): Declare.
2024	(_bfd_elf_section_for_symbol): Declare.
2025	* elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
2026	(bfd_elf_record_eh_frame_entry): New function.
2027	(_bfd_elf_parse_eh_frame_entry): New function.
2028	(_bfd_elf_parse_eh_frame): Update hdr_info field references.
2029	(cmp_eh_frame_hdr): New function.
2030	(add_eh_frame_hdr_terminator): New function.
2031	(_bfd_elf_end_eh_frame_parsing): New function.
2032	(find_merged_cie): Update hdr_info field references.
2033	(_bfd_elf_discard_section_eh_frame): Likewise.
2034	(_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
2035	(_bfd_elf_eh_frame_entry_present): New function.
2036	(_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
2037	(_bfd_elf_write_section_eh_frame_entry): New function.
2038	(_bfd_elf_write_section_eh_frame): Update hdr_info field references.
2039	(_bfd_elf_fixup_eh_frame_hdr): New function.
2040	(write_compact_eh_frame_hdr): New function.
2041	(write_dwarf_eh_frame_hdr): New function.
2042	(_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
2043	* elflink.c (_bfd_elf_section_for_symbol): New function.
2044	(elf_section_ignore_discarded_relocs): Add Compact EH support.
2045	(elf_link_input_bfd): Likewise.
2046	(bfd_elf_final_link): Likewise.
2047	(_bfd_elf_gc_mark): Likewise.
2048	(bfd_elf_parse_eh_frame_entries): New function.
2049	(bfd_elf_gc_sections): Add Compact EH support.
2050	(bfd_elf_discard_info): Likewise.
2051	* elfxx-mips.c: Include dwarf2.h.
2052	(_bfd_mips_elf_compact_eh_encoding): New function.
2053	(_bfd_mips_elf_cant_unwind_opcode): New function.
2054	* elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
2055	(_bfd_mips_elf_cant_unwind_opcode): Declare.
2056	(elf_backend_compact_eh_encoding): Define.
2057	(elf_backend_cant_unwind_opcode): Define.
2058	* elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
2059	(elf_backend_cant_unwind_opcode): Provide default.
2060	(elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
2061	elf_backend_cant_unwind_opcode.
2062	* section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.
2063
20642015-05-27  H.J. Lu  <hongjiu.lu@intel.com>
2065
2066	PR binutils/18458
2067	* elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
2068	for now binding only if pointer equality isn't needed.
2069	(elf_i386_allocate_dynrelocs): Use .plt.got section for now
2070	binding only if pointer equality isn't needed.
2071	* elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
2072	section for now binding only if pointer equality isn't needed.
2073	(elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
2074	binding only if pointer equality isn't needed.
2075
20762015-05-26  H.J. Lu  <hongjiu.lu@intel.com>
2077
2078	PR binutils/18437
2079	* elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
2080	in .rel.plt/.rela.plt.
2081	* elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
2082
20832015-05-19  Jiong Wang  <jiong.wang@arm.com>
2084
2085	* elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
2086	relocation case labels alphabetically.
2087	(elfNN_aarch64_final_link_relocate): Ditto.
2088	(elfNN_aarch64_tls_relax): Ditto.
2089	(elfNN_aarch64_relocate_section): Ditto.
2090	(elfNN_aarch64_gc_sweep_hook): Ditto.
2091	(elfNN_aarch64_check_relocs): Ditto.
2092	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
2093	(_bfd_aarch64_elf_resolve_relocation): Ditto.
2094
20952015-05-18  Jiong Wang  <jiong.wang@arm.com>
2096
2097	* elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite
2098	comments.
2099
21002015-05-16  H.J. Lu  <hongjiu.lu@intel.com>
2101
2102	* elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
2103	for now binding.
2104	(elf_i386_allocate_dynrelocs): Use .plt.got section for now
2105	binding.
2106	* elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
2107	section for now binding.
2108	(elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
2109	binding.
2110
21112015-05-14  H.J. Lu  <hongjiu.lu@intel.com>
2112
2113	* bfd.c (bfd_update_compression_header): Also write the zlib
2114	header if the SHF_COMPRESSED bit cleared..
2115	(bfd_check_compression_header): Return the uncompressed size.
2116	* compress.c (decompress_contents): Don't skip the zlib header.
2117	(bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
2118	which doesn't have the zlib header.
2119	(bfd_init_section_decompress_status): Likewise.
2120	(bfd_get_full_section_contents): Updated.
2121	(bfd_is_section_compressed): Likewise.
2122	(bfd_is_section_compressed_with_header): Return the uncompressed
2123	size.
2124	* elf.c (_bfd_elf_make_section_from_shdr): Updated.
2125	* bfd-in2.h: Regenerated.
2126
21272015-05-14  Jiong Wang  <jiong.wang@arm.com>
2128
2129	* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow
2130	check restrictions.
2131
21322015-05-14  Max Filippov  <jcmvbkbc@gmail.com>
2133
2134	* elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
2135	as GOT reference when plt.refcount is not positive.
2136
21372015-05-12  H.J. Lu  <hongjiu.lu@intel.com>
2138
2139	* elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
2140	for the first .plt entry only if needed.
2141	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2142
21432015-05-11  H.J. Lu  <hongjiu.lu@intel.com>
2144
2145	* Makefile.am (ALL_MACHINES): Add cpu-iamcu.lo.
2146	(ALL_MACHINES_CFILES): Likewise.
2147	* archures.c (bfd_mach_iamcu): New.
2148	(bfd_mach_i386_iamcu): Likewise.
2149	(bfd_mach_i386_iamcu_intel_syntax): Likewise.
2150	(bfd_iamcu_arch): Likewise.
2151	(bfd_archures_list): Add &bfd_iamcu_arch.
2152	* config.bfd (targ_selvecs): Add iamcu_elf32_vec to
2153	i386_elf32_vec.
2154	(targ_archs): Add bfd_iamcu_arch if needed.
2155	* configure.ac: Support iamcu_elf32_vec.
2156	* cpu-iamcu.c: New file.
2157	* elf32-i386.c (elf32_iamcu_elf_object_p): New function.
2158	Add support for iamcu_elf32_vec and elf32_iamcu_bed.
2159	* targets.c (iamcu_elf32_vec): New.
2160	(_bfd_target_vector): Add iamcu_elf32_vec.
2161	* Makefile.in: Regenerated.
2162	* bfd-in2.h: Likewise.
2163	* configure: Likewise.
2164
21652015-05-11  H.J. Lu  <hongjiu.lu@intel.com>
2166
2167	* elfcode.h (elf_object_p): Replace EM_486 with EM_IAMCU.
2168
21692015-05-10  H.J. Lu  <hongjiu.lu@intel.com>
2170
2171	* elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
2172	and output_bfd with abfd.
2173	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
2174
21752015-05-06  Toni Spets  <toni.spets@iki.fi>
2176
2177	PR ld/18372
2178	* peXXigen.c (rsrc_process_section): Skip discarded resource
2179	sections.
2180
21812015-05-01  H.J. Lu  <hongjiu.lu@intel.com>
2182
2183	* config.bfd: Support i[3-7]86-*-elf*.
2184
21852015-04-30  H.J. Lu  <hongjiu.lu@intel.com>
2186
2187	* elf32-i386.c (elf_backend_post_process_headers): Undef for
2188	Solaris 2.
2189
21902015-04-30  Nick Clifton  <nickc@redhat.com>
2191
2192	PR 18317
2193	* elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
2194	mep_reloc.
2195	(mep_reloc): Delete unused function.
2196
21972015-04-29  Nick Clifton  <nickc@redhat.com>
2198
2199	PR 17099
2200	* coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
2201	relocs.
2202
22032015-04-27  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2204
2205	* elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
2206	* elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
2207	elf_s390_merge_obj_attributes.
2208	* elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.
2209
22102015-04-24  Jiong Wang  <jiong.wang@arm.com>
2211
2212	PR ld/18270
2213	* elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
2214	GOT_NORMAL for both sgot/srelgot section.
2215	(elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
2216	and generate necessary runtime relocation for GOT entry.
2217
22182015-04-24  H.J. Lu  <hongjiu.lu@intel.com>
2219
2220	PR binutils/18209
2221	* archive.c (_bfd_get_elt_at_filepos): Copy is_linker_input.
2222
22232015-04-24  Jiong Wang  <jiong.wang@arm.com>
2224
2225	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
2226	PC-relative relocation for external symbol.
2227
22282015-04-24  Nick Clifton  <nickc@redhat.com>
2229
2230	PR 18313
2231	* compress.c (decompress_contents): Zero initialse the z_stream
2232	structure.
2233
22342015-04-24  Nick Clifton  <nickc@redhat.com>
2235
2236	* elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
2237	local labels to include local labels with a numeric suffix and
2238	fake symbols.
2239
22402015-04-24  H.J. Lu  <hongjiu.lu@intel.com>
2241
2242	PR binutils/18316
2243	* section.c (SEC_MEP_VLIW): New.
2244	* bfd-in2.h: Regenerated.
2245
22462015-04-23  H.J. Lu  <hongjiu.lu@intel.com>
2247
2248	PR ld/18277
2249	* compress.c (bfd_compress_section_contents): Remove the
2250	write_compress argument.
2251	(bfd_init_section_compress_status): Updated.
2252	(bfd_compress_section): Likewise.
2253	* elf.c (_bfd_elf_set_reloc_sh_name): New.
2254	(_bfd_elf_init_reloc_shdr): Add delay_st_name_p.  Set sh_name
2255	to (unsigned int) -1 if delay_st_name_p is TRUE.  Use
2256	_bfd_elf_set_reloc_sh_name.
2257	(elf_fake_sections): Don't rename DWARF debug section for
2258	linker output if it will be compressed.  Instead, set
2259	delay_st_name_p to TRUE and pass it to _bfd_elf_init_reloc_shdr.
2260	(assign_section_numbers): Call _bfd_elf_strtab_addref only if
2261	sh_name != (unsigned int) -1.  Don't finalize nor assign
2262	shstrtab section here.  Delay setting output section names to
2263	_bfd_elf_write_object_contents.
2264	(_bfd_elf_compute_section_file_positions): Update comments on
2265	sh_offset for shstrtab section.
2266	(assign_file_positions_for_non_load_sections): Set sh_offset to
2267	-1 for shstrtab section.
2268	(assign_file_positions_except_relocs): Likewise.
2269	(_bfd_elf_assign_file_positions_for_non_load): Set up sh_name
2270	when compressing DWARF debug sections.  Place shstrtab section
2271	after DWARF debug sections have been compressed.
2272	(_bfd_elf_write_object_contents): Setting sh_name for output
2273	sections.
2274
22752015-04-23  H.J. Lu  <hongjiu.lu@intel.com>
2276
2277	PR binutils/18209
2278	* bfd.c (bfd): Add is_linker_input.
2279	* elf.c (convert_debug_to_zdebug): New.
2280	(convert_zdebug_to_debug): Likewise.
2281	(_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
2282	.zdebug_* here.  Use convert_zdebug_to_debug.  Set SEC_ELF_RENAME.
2283	(_bfd_elf_init_reloc_shdr): Pass a pointer to section name
2284	instead of a pointer to section.
2285	(elf_fake_sections): Rename the section name if SEC_ELF_RENAME
2286	is set.
2287	* section.c (SEC_ELF_RENAME): New.
2288	* bfd-in2.h: Regenerated.
2289
22902015-04-23  Alan Modra  <amodra@gmail.com>
2291
2292	* elf64-ppc.c (TOC_BASE_ALIGN): Define.
2293	(ppc64_elf_next_toc_section): Align multi-got toc base.
2294	(ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol.
2295
22962015-04-22  H.J. Lu  <hongjiu.lu@intel.com>
2297
2298	PR ld/18289
2299	* elf32-i386.c (elf_i386_link_hash_entry): Add gotoff_ref.
2300	(elf_i386_link_hash_newfunc): Initialize gotoff_ref to 0.
2301	(elf_i386_create_dynamic_sections): Always allow copy relocs for
2302	building executables.
2303	(elf_i386_copy_indirect_symbol): Also copy gotoff_ref.
2304	(elf_i386_check_relocs): Set gotoff_ref for R_386_GOTOFF.
2305	(elf_i386_adjust_dynamic_symbol): Also allocate copy relocs for
2306	PIE and R_386_GOTOFF.
2307	(elf_i386_relocate_section): Allow R_386_GOTOFF in executable.
2308
23092015-04-20  H.J. Lu  <hongjiu.lu@intel.com>
2310
2311	* elf.c (assign_section_numbers): Always set up sh_name.
2312
23132015-04-20  H.J. Lu  <hongjiu.lu@intel.com>
2314
2315	* elf.c (assign_file_positions_for_non_load_sections): Iterate
2316	sections by pointer.
2317	(_bfd_elf_assign_file_positions_for_non_load): Likewise.
2318
23192015-04-14  H.J. Lu  <hongjiu.lu@intel.com>
2320
2321	* bfd-in.h (compressed_debug_section_type): New.
2322	* compress.c (bfd_compress_section_contents): Add an argument
2323	for linker write compression and always generate .zdebug_*
2324	section when linking.
2325	(bfd_init_section_compress_status): Pass FALSE to
2326	bfd_compress_section_contents.
2327	(bfd_compress_section): New function.
2328	* elf.c (elf_fake_sections): For linking, set SEC_ELF_COMPRESS
2329	on DWARF debug sections if COMPRESS_DEBUG is set and rename
2330	section if COMPRESS_DEBUG_GABI_ZLIB isn't set.
2331	(assign_file_positions_for_non_load_sections): Set sh_offset
2332	to -1 if SEC_ELF_COMPRESS is set.
2333	(assign_file_positions_except_relocs): Likwise.
2334	(_bfd_elf_assign_file_positions_for_relocs): Renamed to ...
2335	(_bfd_elf_assign_file_positions_for_non_load): This.  Change
2336	return time to bfd_boolean.  Compress the section if
2337	SEC_ELF_COMPRESS is set.
2338	(_bfd_elf_write_object_contents): Updated.
2339	(_bfd_elf_set_section_contents): Write section contents to
2340	the buffer if SEC_ELF_COMPRESS is set.
2341	* merge.c: Include "elf-bfd.h".
2342	(sec_merge_emit): Add arguments for contents and offset.  Write
2343	to contents with offset if contents isn't NULL.
2344	(_bfd_write_merged_section): Write section contents to the
2345	buffer if SEC_ELF_COMPRESS is set.  Pass contents and
2346	output_offset to sec_merge_emit.
2347	* elflink.c (bfd_elf_final_link): Allocate the buffer for
2348	output section contents if SEC_ELF_COMPRESS is set.
2349	* section.c (SEC_ELF_COMPRESS): New.
2350	* bfd-in2.h: Regenerated.
2351
23522015-04-15  Alan Modra  <amodra@gmail.com>
2353
2354	* elf32-rl78.c (rl78_elf_relocate_section): Typo fix.
2355
23562015-04-14  Nick Clifton  <nickc@redhat.com>
2357
2358	* elf32-rl78.c (RL78_OP_REL): New macro.
2359	(rl78_elf_howto_table): Use it for complex relocs.
2360	(get_symbol_value): Handle the cases when the info or status
2361	arguments are NULL.
2362	(get_romstart): Cache the status returned by get_symbol_value.
2363	(get_ramstart): Likewise.
2364	(RL78_STACK_PUSH): Generate an error message if the stack
2365	overflows.
2366	(RL78_STACK_POP): Likewise for underflows.
2367	(rl78_compute_complex_reloc): New function.  Contains the basic
2368	processing code for all RL78 complex relocs.
2369	(rl78_special_reloc): New function.  Provides special reloc
2370	handling for complex relocs.
2371	(rl78_elf_relocate_section): Use rl78_compute_complex_reloc.
2372	(rl78_offset_for_reloc): Likewise.
2373
23742015-04-14  H.J. Lu  <hongjiu.lu@intel.com>
2375
2376	PR ld/pr17709
2377	* elflink.c (_bfd_elf_adjust_dynamic_copy): Check
2378	info->extern_protected_data when warning copy relocs against
2379	protected symbols.
2380	(_bfd_elf_symbol_refs_local_p): Check info->extern_protected_data
2381	when checking protected non-function symbols.
2382
23832015-04-13  John Baldwin  <jhb@FreeBSD.org>
2384
2385	* elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on
2386	FreeBSD.
2387	(elfcore_write_xstatereg): Use correct note name on FreeBSD.
2388
23892015-04-13  H.J. Lu  <hongjiu.lu@intel.com>
2390
2391	PR ld/18250
2392	* elflink.c (elf_link_is_defined_archive_symbol): Return FALSE
2393	if the object has been claimed by plugin.
2394
23952015-04-11  H.J. Lu  <hongjiu.lu@intel.com>
2396
2397	* elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
2398	with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
2399	protected data symbol when building shared library.
2400	* elf64-x86-64.c (elf_x86_64_relocate_section): Check
2401	R_X86_64_GOTOFF64 against undefined symbol and replace
2402	SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL when checking
2403	R_X86_64_GOTOFF64 against protected data symbol when building
2404	shared library.
2405
24062015-04-10  H.J. Lu  <hongjiu.lu@intel.com>
2407
2408	PR ld/pr17709
2409	* elf32-i386.c (elf_i386_relocate_section): Also check R_386_GOTOFF
2410	against protected data symbol when building shared library.
2411	* elf64-x86-64.c (elf_x86_64_relocate_section): Also check
2412	R_X86_64_GOTOFF64 against protected data symbol when building
2413	shared library.
2414
24152015-04-10  H.J. Lu  <hongjiu.lu@intel.com>
2416
2417	PR ld/pr15228
2418	PR ld/pr17709
2419	* elf-bfd.h (elf_backend_data): Add extern_protected_data.
2420	* elf32-i386.c (elf_backend_extern_protected_data): New.
2421	Defined to 1.
2422	* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2423	* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
2424	copy relocs against protected symbols if extern_protected_data
2425	is true.
2426	(_bfd_elf_symbol_refs_local_p): Don't return true on protected
2427	non-function symbols if extern_protected_data is true.
2428	* elfxx-target.h (elf_backend_extern_protected_data): New.
2429	Default to 0.
2430	(elfNN_bed): Initialize extern_protected_data with
2431	elf_backend_extern_protected_data.
2432
24332015-04-10  H.J. Lu  <hongjiu.lu@intel.com>
2434
2435	* compress.c (bfd_compress_section_contents): Replace bfd_malloc
2436	and free with bfd_alloc and bfd_release on compressed buffer.
2437	Release buffer if compressed section isn't smaller.
2438
24392015-04-10  Alan Modra  <amodra@gmail.com>
2440
2441	PR ld/18222
2442	* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error
2443	on adding a protected visibility variable to .dynbss.
2444
24452015-04-10  Alan Modra  <amodra@gmail.com>
2446
2447	Revert 2015-03-05  H.J. Lu  <hongjiu.lu@intel.com>
2448	PR ld/pr15228
2449	PR ld/pr17709
2450	* elf-bfd.h (elf_backend_data): Delete extern_protected_data.
2451	* elf32-i386.c (elf_backend_extern_protected_data): Delete.
2452	* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2453	* elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
2454	extern_protected_data test.
2455	(_bfd_elf_symbol_refs_local_p): Likewise.
2456	* elfxx-target.h (elf_backend_extern_protected_data): Delete.
2457	(elfNN_bed): Delete elf_backend_extern_protected_data init.
2458
24592015-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2460
2461	* compress.c (bfd_compress_section_contents): Update comments.
2462	(bfd_init_section_decompress_status): Likewise.
2463	(bfd_init_section_compress_status): Likewise.
2464
24652015-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2466
2467	* elfxx-target.h (TARGET_BIG_SYM): Add BFD_COMPRESS_GABI to
2468	object_flags.
2469	(TARGET_LITTLE_SYM): Likewise.
2470
24712015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
2472
2473	* elf32-xtensa.c (splay-tree.h): include header.
2474	(text_action_struct): drop next pointer.
2475	(text_action_list_struct): drop head pointer, add count and
2476	tree fields.
2477	(find_fill_action): instead of linear search in text_action_list
2478	search in the tree.
2479	(text_action_compare, action_first, action_next): new functions.
2480	(text_action_add, text_action_add_literal): instead of linear
2481	search and insertion insert new node into the tree.
2482	(removed_by_actions): pass additional parameter: action_list,
2483	use it to traverse the tree.
2484	(offset_with_removed_text): pass additional action_list parameter
2485	to removed_by_actions.
2486	(map_action_fn_context): new typedef.
2487	(map_action_fn_context_struct): new structure.
2488	(map_action_fn): new function.
2489	(map_removal_by_action): use splay_tree_foreach to build map.
2490	(find_insn_action): replace linear search in text_action_list
2491	with series of splay_tree_lookups.
2492	(print_action, print_action_list_fn): new functions.
2493	(print_action_list): use splay_tree_foreach.
2494	(init_xtensa_relax_info): drop action_list.head initialization.
2495	Initialize the tree.
2496	(compute_text_actions): use non-zero action_list_count instead of
2497	non-NULL action list.
2498	(xlate_map_context): new typedef.
2499	(xlate_map_context_struct): new structure.
2500	(xlate_map_fn): new function.
2501	(build_xlate_map): use splay_tree_foreach to build map.
2502	(action_remove_bytes_fn): new function.
2503	(relax_section): use zero action_list_count instead of NULL
2504	action list. Use splay_tree_foreach to count final section size.
2505	Drop unused variable 'removed'.
2506
25072015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
2508
2509	* elf32-xtensa.c (removed_literal_map_entry): new typedef.
2510	(removed_literal_map_entry_struct): new structure.
2511	(removed_literal_list_struct): add new fields: n_map and map.
2512	(map_removed_literal, removed_literal_compare): new functions.
2513	(find_removed_literal): build index array for literals ordered
2514	by VMA, use binary search to find removed literal.
2515
25162015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
2517
2518	* elf32-xtensa.c (removal_by_action_entry_struct,
2519	removal_by_action_map_struct): new structures.
2520	(removal_by_action_entry, removal_by_action_map): new typedefs.
2521	(text_action_list_struct): add new field: map.
2522	(map_removal_by_action, removed_by_actions_map,
2523	offset_with_removed_text_map): new functions.
2524	(relax_section): replace offset_with_removed_text with
2525	offset_with_removed_text_map.
2526	(translate_reloc, relax_property_section, relax_section_symbols):
2527	replace removed_by_actions with removed_by_actions_map.
2528
25292015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
2530
2531	* elf32-xtensa.c (reloc_range_list, reloc_range_list_entry,
2532	reloc_range): new typedef.
2533	(reloc_range_list_struct, reloc_range_list_entry_struct,
2534	reloc_range_struct): new structures.
2535	(reloc_range_compare, build_reloc_ranges,
2536	reloc_range_list_append, reloc_range_list_remove,
2537	reloc_range_list_update_range, free_reloc_range_list): new
2538	functions.
2539	(compute_text_actions): precompute relocation opcodes before the
2540	loop. Add relevant_relocs variable, initialize it before the
2541	loop, pass it to the check_section_ebb_pcrels_fit.
2542	(check_section_ebb_pcrels_fit): add new parameter:
2543	relevant_relocs. Update address range in the relevant_relocs if
2544	it's non-NULL and iterate only over relevant relocations.
2545
25462015-04-09  Nick Clifton  <nickc@redhat.com>
2547
2548	* elf32-rx.c (describe_flags): Report the settings of the string
2549	insn using bits.
2550	(rx_elf_merge_private_bfd_data): Handle merging of the string insn
2551	using bits.
2552
25532015-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2554
2555	* compress.c (bfd_compress_section_contents): Work around a GCC
2556	uninitialized warning bug fixed in GCC 4.7.
2557
25582015-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2559
2560	* archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
2561	bit.
2562	* bfd.c (bfd::flags): Increase size to 18 bits.
2563	(BFD_COMPRESS_GABI): New.
2564	(BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
2565	(BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
2566	(bfd_update_compression_header): New fuction.
2567	(bfd_check_compression_header): Likewise.
2568	(bfd_get_compression_header_size): Likewise.
2569	(bfd_is_section_compressed_with_header): Likewise.
2570	* compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
2571	(bfd_compress_section_contents): Return the uncompressed size if
2572	the full section contents is compressed successfully.  Support
2573	converting from/to .zdebug* sections.
2574	(bfd_get_full_section_contents): Call
2575	bfd_get_compression_header_size to get compression header size.
2576	(bfd_is_section_compressed): Renamed to ...
2577	(bfd_is_section_compressed_with_header): This.  Add a pointer
2578	argument to return compression header size.
2579	(bfd_is_section_compressed): Use it.
2580	(bfd_init_section_decompress_status): Call
2581	bfd_get_compression_header_size to get compression header size.
2582	Return FALSE if uncompressed section size is 0.
2583	* elf.c (_bfd_elf_make_section_from_shdr): Support converting
2584	from/to .zdebug* sections.
2585	* bfd-in2.h: Regenerated.
2586
25872015-04-07  Alan Modra  <amodra@gmail.com>
2588
2589	* elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
2590	mapped to output .got section.
2591
25922015-04-07  Alan Modra  <amodra@gmail.com>
2593
2594	* elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
2595	and has_addr16_lo.  Make has_sda_refs a bitfield.
2596	(ppc_elf_check_relocs): Set new flags.
2597	(ppc_elf_link_hash_table_create): Update default_params.
2598	(ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
2599	where we won't be making .dynbss entries or editing code.  Set
2600	params->pic_fixup when we'll edit code for protected var access.
2601	(allocate_dynrelocs): Allocate got entry for edited code and
2602	discard dyn_relocs.
2603	(struct ppc_elf_relax_info): Add picfixup_size.
2604	(ppc_elf_relax_section): Rename struct one_fixup to struct
2605	one_branch_fixup.  Rename fixups to branch_fixups.  Size space for
2606	pic fixups.
2607	(ppc_elf_relocate_section): Edit non-PIC accessing protected
2608	visibility variables to PIC.  Don't emit dyn_relocs for code
2609	we've edited.
2610	* elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
2611
26122015-04-07  Nick Clifton  <nickc@redhat.com>
2613
2614	* elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
2615	local labels as local.
2616
26172015-04-06  H.J. Lu  <hongjiu.lu@intel.com>
2618
2619	* compress.c (get_uncompressed_size): Removed.
2620	(bfd_compress_section_contents): Use bfd_putb64 to write
2621	uncompressed section size.
2622	(bfd_init_section_decompress_status): Replace
2623	get_uncompressed_size with bfd_getb64.
2624
26252015-04-04  H.J. Lu  <hongjiu.lu@intel.com>
2626
2627	* elf.c (_bfd_elf_init_private_section_data): Also preserve the
2628	SHF_COMPRESSED bit if not decompress.
2629
26302015-04-04  H.J. Lu  <hongjiu.lu@intel.com>
2631
2632	* compress.c (get_uncompressed_size): New.  Extracted from ...
2633	(bfd_init_section_decompress_status): This.  Use it.
2634
26352015-04-02  Andrew Turner  <andrew@freebsd.org>
2636
2637	* config.bfd: Add aarch64-*-freebsd* target triple.
2638
26392015-04-02  H.J. Lu  <hongjiu.lu@intel.com>
2640
2641	* configure: Regenerated.
2642
26432015-04-01  Tejas Belagod  <tejas.belagod@arm.com>
2644	    Marcus Shawcroft  <marcus.shawcroft@arm.com>
2645	    Jiong Wang  <jiong.wang@arm.com>
2646
2647	* bfd-in.h (bfd_elf64_aarch64_set_options)
2648	(bfd_elf32_aarch64_set_options): Add parameter.
2649	* bfd-in2.h: Regenerated.
2650	* elfnn-aarch64.c (aarch64_erratum_843419_stub)
2651	(_bfd_aarch64_adrp_p, _bfd_aarch64_erratum_843419_sequence_p)
2652	(_bfd_aarch64_erratum_843419_stub_name)
2653	(_bfd_aarch64_erratum_843419_fixup)
2654	(_bfd_aarch64_erratum_843419_scan)
2655	(_bfd_aarch64_erratum_843419_branch_to_stub)
2656	(_bfd_aarch64_erratum_843419_p): Define.
2657	(enum elf_aarch64_stub_type): Define
2658	aarch64_stub_erratum_843419_veneer.
2659	(struct elf_aarch64_stub_hash_entry): Define adrp_offset.
2660	(struct elf_aarch64_link_hash_table): Define fix_erratum_843419
2661	and fix_erratum_843419_adr.
2662	(stub_hash_newfunc): Initialize adrp_offset;
2663	(_bfd_aarch64_add_stub_entry_after): Define.
2664	(aarch64_map_one_stub, aarch64_build_one_stub)
2665	(aarch64_size_one_stub): Handle
2666	aarch64_stub_erratum_843419_veneer.
2667	(_bfd_aarch64_resize_stubs): Round stub section size.
2668	(elfNN_aarch64_size_stubs): Add scan for 843419.
2669	(bfd_elfNN_aarch64_set_options): Add parameter. Initialize
2670	fix_erratum_843419 and fix_erratum_843419_adr.
2671	(struct erratum_835769_branch_to_stub_data): Add info.
2672	(elfNN_aarch64_write_section): Initialise info.  Handle 843419.
2673	(elfNN_aarch64_size_dynamic_sections): Handle 843419.
2674	* elfxx-aarch64.c (_bfd_aarch64_decode_adrp_imm)
2675	(_bfd_aarch64_sign_extend): Define.
2676	(reencode_adr_imm): Remove static. Rename to:
2677	(_bfd_aarch64_reencode_adr_imm): Define.
2678	(_bfd_aarch64_elf_put_addend): Call _bfd_aarch64_reencode_adr_imm.
2679	* elfxx-aarch64.h (AARCH64_ADR_OP, AARCH64_ADRP_OP)
2680	(AARCH64_ADRP_OP_MASK, _bfd_aarch64_sign_extend)
2681	(_bfd_aarch64_decode_adrp_imm, _bfd_aarch64_reencode_adr_imm):
2682	Define.
2683
26842015-04-01  H.J. Lu  <hongjiu.lu@intel.com>
2685
2686	* configure: Regenerated.
2687
26882015-03-31  Ed Schouten  <ed@nuxi.nl>
2689
2690	* config.bfd (targ_defvec): Set to x86_64_elf64_cloudabi_vec
2691	for x86_64-*-cloudabi*.
2692	* configure.ac: Handle x86_64_elf64_cloudabi_vec.
2693	* configure: Regenerated.
2694	* elf64-x86-64.c (TARGET_LITTLE_SYM): Support x86_64-*-cloudabi*.
2695	(TARGET_LITTLE_NAME): Likewise.
2696	(ELF_OSABI): Likewise.
2697	(elf64_bed): Likewise.
2698	* targets.c (x86_64_elf64_cloudabi_vec): New.
2699	(_bfd_target_vector): Add x86_64_elf64_cloudabi_vec.
2700
27012015-03-31  H.J. Lu  <hongjiu.lu@intel.com>
2702
2703	* configure.ac: Revert the AM_ZLIB change.
2704	* Makefile.in: Regenerated.
2705	* aclocal.m4: Likewise.
2706	* configure: Likewise.
2707	* doc/Makefile.in: Likewise.
2708
27092015-03-30  H.J. Lu  <hongjiu.lu@intel.com>
2710
2711	PR ld/18169
2712	* elf-bfd.h (elf_backend_data): Add get_reloc_section.
2713	(_bfd_elf_get_reloc_section): New.
2714	* elf.c (_bfd_elf_get_reloc_section): Likewise.
2715	(assign_section_numbers): Call get_reloc_section to look up the
2716	section the relocs apply.
2717	* elfxx-target.h (elf_backend_get_reloc_section): Likewise.
2718	(elfNN_bed): Initialize get_reloc_section with
2719	elf_backend_get_reloc_section.
2720
27212015-03-29  H.J. Lu  <hongjiu.lu@intel.com>
2722
2723	* Makefile.am (ZLIB): New.
2724	(ZLIBINC): Likewise.
2725	(AM_CFLAGS): Add $(ZLIBINC).
2726	(libbfd_la_LIBADD): Add $(ZLIB).
2727	* compress.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
2728	(decompress_contents): Don't check HAVE_ZLIB_H.
2729	(bfd_compress_section_contents): Likewise.
2730	(bfd_get_full_section_contents): Likewise.
2731	(bfd_init_section_decompress_status): Likewise.
2732	(bfd_init_section_compress_status): Likewise.
2733	* configure.ac (AM_ZLIB): Removed.
2734	(zlibdir): New.  AC_SUBST.
2735	(zlibinc): Likewise.
2736	Add --with-system-zlib.
2737	* Makefile.in: Regenerated.
2738	* acinclude.m4: Likewise.
2739	* config.in: Likewise.
2740	* configure: Likewise.
2741	* doc/Makefile.in: Likewise.
2742
27432015-03-27  Alan Modra  <amodra@gmail.com>
2744
2745	PR ld/15228
2746	PR ld/18167
2747	* elflink.c (elf_merge_st_other): Add "sec" parameter.  Don't set
2748	protected_def when symbol section is read-only.  Adjust all calls.
2749	* elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
2750
27512015-03-26  Tejas Belagod  <tejas.belagod@arm.com>
2752
2753	* elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic
2754	_bfd_final_link_relocate with aarch64_relocate.
2755
27562015-03-26  H.J. Lu  <hongjiu.lu@intel.com>
2757
2758	PR ld/18160
2759	* elflink.c (elf_gc_sweep): Skip if relocation is incompatible.
2760	(bfd_elf_gc_sections): Likewise.
2761
27622015-03-25  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2763
2764	* elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Adjust stub section
2765	size for initial branch.
2766	(elfNN_aarch64_build_stubs): Write initial branch.
2767	_bfd_aarch64_decode_(elfNN_aarch64_output_arch_local_syms): Write
2768	mapping symbol on initial branch.
2769
27702015-03-25  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2771
2772	* elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan):
2773	Update erratum count.
2774
27752015-03-25  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
2776
2777	* elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on
2778	first matching debug section.
2779
27802015-03-24  H.J. Lu  <hongjiu.lu@intel.com>
2781
2782	PR gas/18087
2783	* compress.c (bfd_compress_section_contents): Don't write the
2784	zlib header and set contents as well as compress_status if
2785	compression didn't make the section smaller.
2786	(bfd_init_section_compress_status): Don't check compression
2787	size here.
2788
27892015-03-24  Nick Clifton  <nickc@redhat.com>
2790
2791	PR binutils/17512
2792	* coffgen.c (coff_get_normalized_symtab): Fix test for out of
2793	range auxillary sections.
2794
27952015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2796
2797	* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor
2798	code into:
2799	(_bfd_aarch64_get_stub_for_link_section): Define.
2800
28012015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2802
2803	* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
2804	update of section_group[].stub_sec.
2805
28062015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2807
2808	* elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove.
2809	(erratum_835769_scan) Drop fix_table_size_p and fixes_p arguments.
2810	Delete fixes, fix_table_size and associated code.  Call
2811	_bfd_aarch64_add_stub_entry_in_group. Rename to...
2812	(bfd_aarch64_erratum_835769_scan): Define.
2813	(elfNN_aarch64_size_stubs): Delete erratum_835769_fixes,
2814	erratum_835769_fix_table_size, i and associated code.  Relocate
2815	call to _bfd_aarch64_erratum_835769_scan.  Delete adhoc stub size
2816	correction.  Delete construction of stub entry from
2817	erratum_835769_fixes array.
2818
28192015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2820
2821	* elfnn-aarch64.c (elfNN_aarch64_size_stubs): Use
2822	_bfd_aarch64_add_stub_entry_in_group.
2823
28242015-03-24  Alan Modra  <amodra@gmail.com>
2825
2826	* elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
2827	stubs, even those for undefined weak symbols.  Otherwise, don't
2828	report relocation overflow on branches to undefined strong
2829	symbols.  Fix memory leak.
2830	* elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
2831	overflow on branches to undefined strong symbols.
2832
28332015-03-23  Keith Seitz  <keiths@redhat.com>
2834
2835	* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
2836	missing ';'.
2837
28382015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2839
2840	* elfnn-aarch64.c (erratum_835769_scan): Factor stub name
2841	construction into...
2842	(_bfd_aarch64_erratum_835769_stub_name): Define.
2843
28442015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2845
2846	* elfnn-aarch64.c (elfNN_aarch64_size_stubs): Factor out
2847	stub resize code into...
2848	(bfd_aarch64_resize_stubs): Define.
2849
28502015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2851
2852	* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor stub
2853	creation code into...
2854	(bfd_aarch64_create_stub_section): Define.
2855
28562015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2857
2858	* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Rename
2859	from elf_aarch64_create_or_find_stub_sec.
2860	(_bfd_aarch64_add_stub_entry_in_group): Rename from
2861	elfNN_aarch64_add_stub.  Call
2862	_bfd_aarch64_create_or_find_stub_sec.
2863	(elfNN_aarch64_size_stubs, elfNN_aarch64_size_stubs): Call
2864	_bfd_aarch64_add_stub_entry_in_group.
2865
28662015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2867
2868	* elfnn-aarch64.c (erratum_835769_scan) Add comment.  Reverse
2869	sense of boolean return.
2870	(elfNN_aarch64_size_stubs): Adjust for above.
2871
28722015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2873
2874	* elfnn-aarch64.c (elf_aarch64_create_or_find_stub_sec):
2875	Remove unused parameter.
2876	(elfNN_aarch64_size_stubs): Adjust for above.
2877
28782015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2879
2880	* elfnn-aarch64.c (elfNN_aarch64_size_stubs): Remove bfd_indx.
2881
28822015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2883
2884	* elfnn-aarch64.c (aarch64_erratum_835769_fixes)
2885	(num_aarch64_erratum_835769_fixes): Remove.
2886	(elfNN_aarch64_size_stubs): Remove assignments to above.
2887
28882015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2889
2890	* elfnn-aarch64.c (aarch64_mem_op_p): Update comment. Rename rtn
2891	to rt2.
2892	(aarch64_erratum_seqeunce): Rename rtn to rt2.
2893
28942015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2895
2896	* elfnn-aarch64.c (elfNN_aarch64_write_section): Adjust layout.
2897
28982015-03-19  Nick Clifton  <nickc@redhat.com>
2899
2900	* elf32-rl78.c (rl78_cpu_name): New function.  Prints the name of
2901	the RL78 core based upon the flags.
2902	(rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
2903	flags.
2904	(rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
2905	(elf32_rl78_machine): Always return bfd_mach_rl78.
2906
29072015-03-19  Nick Clifton  <nickc@redhat.com>
2908
2909	PR 18078
2910	* compress.c (bfd_compress_section_contents): Do not define this
2911	function if it is not used.
2912
29132015-03-18  H.J. Lu  <hongjiu.lu@intel.com>
2914
2915	* compress.c (bfd_compress_section_contents): Make it static.
2916	* bfd/bfd-in2.h: Regenerated.
2917
29182015-03-18  Eric Youngdale  <eyoungdale@ptc.com>
2919
2920	PR ld/16598
2921	* peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs
2922	suitable for the AMD64.
2923
29242015-03-18  Jon Turney  <jon.turney@dronecode.org.uk>
2925	    Nick Clifton  <nickc@redhat.com>
2926
2927	PR binutils/18087
2928	* coffgen.c (make_a_section_from_file): Only prepend a z to a
2929	debug section's name if the section was actually compressed.
2930	* elf.c (_bfd_elf_make_section_from_shdr): Likewise.
2931	* compress.c (bfd_init_section_compress_status): Do not compress
2932	the section if doing so would make it bigger.  In such cases leave
2933	the section alone and return COMPRESS_SECTION_NONE.
2934
29352015-03-17  Alan Modra  <amodra@gmail.com>
2936
2937	* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0
2938	on nothing to do, before malloc of returned symbol array.
2939
29402015-03-16  Nick Clifton  <nickc@redhat.com>
2941
2942	* elf32-rx.c (elf32_rx_relax_delete_bytes): If the relocs are not
2943	stored in the elf_section_data structure then load them as
2944	necessary.
2945
29462015-03-14  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2947
2948	* elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
2949	relocs against code sections.
2950	* elf32-s390.c: Define elf_backend_sort_relocs_p.
2951	* elf64-s390.c: Likewise.
2952
29532015-03-11  Alan Modra  <amodra@gmail.com>
2954
2955	* elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
2956	reverse order.  Account for larger size of __tls_get_addr_opt stub.
2957
29582015-03-10  Yuri Gribov  <y.gribov@samsung.arm>
2959
2960	PR ld/16572
2961	* elf32-arm.c (elf32_arm_final_link_relocate): Remove support for
2962	ELF_ARM_HASENTRY.
2963	(elf32_arm_print_private_bfd_data): Likewise.
2964
29652015-03-06  Nick Clifton  <nickc@redhat.com>
2966
2967	PR binutils/17765
2968	* elflink.c (put_value): Like previous delta, but for the 32-bit
2969	case.
2970
29712015-03-05  Nick Clifton  <nickc@redhat.com>
2972
2973	PR binutils/17765
2974	* elflink.c (put_value): Avoid using an undefined shift
2975	operation.
2976
29772015-03-05  H.J. Lu  <hongjiu.lu@intel.com>
2978
2979	PR ld/pr15228
2980	PR ld/pr17709
2981	* elf-bfd.h (elf_backend_data): Add extern_protected_data.
2982	* elf32-i386.c (elf_backend_extern_protected_data): New.
2983	Defined to 1.
2984	* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2985	* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
2986	copy relocs against protected symbols if extern_protected_data
2987	is true.
2988	(_bfd_elf_symbol_refs_local_p): Don't return true on protected
2989	non-function symbols if extern_protected_data is true.
2990	* elfxx-target.h (elf_backend_extern_protected_data): New.
2991	Default to 0.
2992	(elfNN_bed): Initialize extern_protected_data with
2993	elf_backend_extern_protected_data.
2994
29952015-03-05  Nick Clifton  <nickc@redhat.com>
2996
2997	PR binutils/18025
2998	* coffgen.c (coff_find_nearest_line_with_names): If the dwarf2
2999	lookup fails, check for an address bias in the dwarf info, and if
3000	one exists, retry the lookup with the biased value.
3001	* dwarf2.c (_bfd_dwarf2_find_symbol_bias): New function.
3002	Determines if a bias exists bewteen the addresses of functions
3003	based on DWARF information vs symbol table information.
3004	* libbfd-in.h (_bfd_dwarf2_find_symbol_bias): Prototype.
3005	* libbfd.h: Regenerate.
3006
30072015-03-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3008
3009	* elfxx-aarch64.c (decode_add_imm, decode_movw_imm)
3010	(decode_tst_branch_ofs_14, decode_ld_lit_ofs_19)
3011	(decode_cond_branch_ofs_19, decode_branch_ofs_26): Remove.
3012
30132015-03-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3014
3015	* elfnn-aarch64.c (aarch64_build_one_stub): Call abort.
3016	(aarch64_size_one_stub): Likewise.
3017	(aarch64_map_one_stub): Likewise.
3018
30192015-03-04  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3020
3021	* cpu-s390.c (N): New macro.
3022	(bfd_s390_31_arch): New.  Define only if default target word size
3023	is 64 bits.  Otherwise define...
3024	(bfd_390_64_arch): ...this.  Make static.
3025	(bfd_s390_arch): Define according to the default target word size.
3026	Let the 'next' field point to the alternate arch.
3027
30282015-03-04  Richard Sandiford  <richard.sandiford@arm.com>
3029
3030	PR gas/17843
3031	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
3032	R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
3033	to be used with MOVK rather than MOVZ.
3034
30352015-03-03  DJ Delorie  <dj@redhat.com>
3036
3037	* elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
3038	there's a symbol.
3039
30402015-02-28  Alan Modra  <amodra@gmail.com>
3041
3042	* elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
3043	not PLT_NEW.
3044
30452015-02-27  H.J. Lu  <hongjiu.lu@intel.com>
3046
3047	* elf32-i386.c (need_convert_mov_to_lea): New.
3048	(elf_i386_check_relocs): Set need_convert_mov_to_lea if needed.
3049	(elf_i386_convert_mov_to_lea): Return TRUE if
3050	need_convert_mov_to_lea is unset.
3051	* elf64-x86-64.c (need_convert_mov_to_lea): New.
3052	(elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed.
3053	(elf_x86_64_convert_mov_to_lea): Return TRUE if
3054	need_convert_mov_to_lea is unset.
3055
30562015-02-27  Nick Clifton  <nickc@redhat.com>
3057
3058	PR binutils/17910
3059	* coffgen.c (_bfd_coff_internal_syment_name): Only check for
3060	string length overflow when the string table length is actually
3061	set.
3062
30632015-02-27  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3064
3065	* bfd/bfd-in2.h: Regenerate.
3066	* bfd/libbfd.h: Regenerate.
3067
30682015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3069
3070	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix
3071	TLSDESC_LD_PREL19 field width and masks.
3072	(aarch64_tls_transition_without_check)
3073	(aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
3074	(elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
3075	(elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
3076	BFD_RELOC_AARCH64_TLSDESC_LD_PREL19.
3077	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3078	(_bfd_aarch64_elf_resolve_relocation): Likewise.
3079
30802015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3081
3082	* elfnn-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Reorder R_TYPE
3083	tests.
3084	(aarch64_tls_transition_without_check)
3085	(aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
3086	(elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
3087	(elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
3088	BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21.
3089	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3090	(_bfd_aarch64_elf_resolve_relocation): Likewise.
3091	* reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
3092
30932015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3094
3095	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC)
3096	(elfNN_aarch64_howto_table, aarch64_tls_transition_without_check)
3097	(aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
3098	(elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
3099	(elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
3100	BFD_RELOC_AARCH64_TLSGD_ADR_PREL21.
3101	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3102	(_bfd_aarch64_elf_resolve_relocation): Likewise.
3103	* reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
3104
31052015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3106
3107	* elfnn-aarch64.c: (TLSIE_LD_GOTTREL_PREL19): Fix HOWTO bit field width.
3108	(aarch64_tls_transition_without_check, aarch64_reloc_got_type)
3109	(elfNN_aarch64_final_link_relocate, elfNN_aarch64_tls_relax)
3110	(elfNN_aarch64_relocate_section, elfNN_aarch64_gc_sweep_hook)
3111	(elfNN_aarch64_check_relocs): Handle
3112	BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19.
3113
3114	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3115	(_bfd_aarch64_elf_resolve_relocation): Likewise.
3116
31172015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3118
3119	* elfnn-aarch64.c: (TLSDESC_CALL): Fix HOWTO bit field width.
3120
31212015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3122
3123	* elfnn-aarch64.c (TLSLE_MOVW_TPREL_G2)
3124	(TLSLE_MOVW_TPREL_G1, TLSLE_MOVW_TPREL_G1_NC)
3125	(TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC): Fix bit field
3126	width.
3127
31282015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3129
3130	* elfnn-aarch64.c: (TLSIE_MOVW_GOTTPREL_G0_NC): Fix HOWTO bit
3131	field width.
3132
31332015-02-26  Nick Clifton  <nickc@redhat.com>
3134
3135	PR binutils/17512
3136	* coffcode.h (coff_compute_section_file_positions): Report
3137	negative page sizes.
3138	* elf.c (elf_fake_sections): Handle excessive alignmment powers.
3139	(assign_file_positions_for_non_load_sections): Replace assertion
3140	with an error message.
3141	(rewrite_elf_program_header): Handle excessive segment
3142	alignments.
3143	* mach-o.c (bfd_mach_o_read_section_32): Likewise.
3144	(bfd_mach_o_read_section_64): Likewise.
3145	* peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Use %B to
3146	print a bfd name, not %A.
3147
31482015-02-26  Alan Modra  <amodra@gmail.com>
3149
3150	* elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
3151	thread-safe stubs for iplt.
3152	(build_tls_get_addr_stub): Restore r2 immediately after call.
3153
31542015-02-26  Terry Guo  <terry.guo@arm.com>
3155
3156	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Update how we
3157	merge Tag_ABI_HardFP_use.
3158
31592015-02-26  Alan Modra  <amodra@gmail.com>
3160
3161	* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Heed -z nocopyreloc.
3162	Use text relocs rather than giving an error on trying to use
3163	.dynbss for protected shared lib vars.
3164	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
3165
31662015-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
3167
3168	* elf32-avr.c (struct elf_avr_section_data): New structure.
3169	(struct avr_relax_info): New structure.
3170	(elf_avr_new_section_hook): New function.
3171	(struct elf_avr_section_data): Add relax_info.
3172	(get_avr_relax_info): New function.
3173	(init_avr_relax_info): New function.
3174	(elf32_avr_relax_delete_bytes): Find next property record before
3175	deleting bytes.  When deleting don't move bytes beyond the next
3176	property record.
3177	(avr_elf32_assign_records_to_section): New function.
3178	(avr_property_record_compare): New function.
3179	(avr_load_all_property_sections): New function.
3180	(elf32_avr_relax_section): Load property data.  After relaxing the
3181	section, move any .align directives that have enough deleted bytes
3182	before them.
3183	(bfd_elf32_new_section_hook): Define.
3184
31852015-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
3186
3187	* elf32-avr.h (struct avr_property_header): New strucure.
3188	(avr_elf32_load_property_records): Declare.
3189	(avr_elf32_property_record_name): Declare.
3190	* elf32-avr.c: Add bfd_stdint.h include.
3191	(retrieve_local_syms): New function.
3192	(get_elf_r_symndx_section): New function.
3193	(get_elf_r_symndx_offset): New function.
3194	(internal_reloc_compare): New function.
3195	(struct avr_find_section_data): New structure.
3196	(avr_is_section_for_address): New function.
3197	(avr_find_section_for_address): New function.
3198	(avr_elf32_load_records_from_section): New function.
3199	(avr_elf32_load_property_records): New function.
3200	(avr_elf32_property_record_name): New function.
3201
32022015-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
3203
3204	* elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
3205	(AVR_PROPERTY_RECORDS_VERSION): Define.
3206	(AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
3207	(struct avr_property_record): New structure.
3208
32092015-02-24  Nick Clifton  <nickc@redhat.com>
3210
3211	* elf32-v850.c (v850_set_note): New function.  Creates a Renesas
3212	style note entry.
3213	(v850_elf_make_note_section): New function.  Creates a note
3214	section.
3215	(v850_elf_create_sections): New function.  Create a note section
3216	if one is not already present.
3217	(v850_elf_set_note): New function.  Adds a note to a bfd.
3218	(v850_elf_copy_private_bfd_data): New function.  Copies V850
3219	notes.
3220	(v850_elf_merge_notes): New function.  Merges V850 notes.
3221	(print_v850_note): New function.  Displays a V850 note.
3222	(v850_elf_print_notes): New function. Displays all notes attached
3223	to a bfd.
3224	(v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
3225	(v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
3226	(v850_elf_fake_sections): Set the type of the V850 note section.
3227	* bfd-in.h (v850_elf_create_sections): Add prototype.
3228	(v850_elf_set_note): Add prototype.
3229	* bfd-in2.h: Regenerate.
3230
32312015-02-24  Nick Clifton  <nickc@redhat.com>
3232
3233	* configure.ac (AC_CHECK_HEADERS): Add wctype.h.
3234	* configure: Regenerate.
3235	* config.in: Regenerate.
3236	* peXXigen.c: Include wctype.h if HAVE_WCTYPE_H is defined.
3237	(u16_mbtowc): Use wint_t types if HAVE_WCTYPE_H is defined.
3238	(rsrc_cmp): Use towlower instead of wcsncasecmp if HAVE_WCTYPE_H
3239	is defined.
3240
32412015-02-24  Nick Clifton  <nickc@redhat.com>
3242
3243	* pdp11.c (set_section_contents): Pad the .text and .data sections
3244	to their aligned sizes.
3245
32462015-02-23  Yoshinori Sato <ysato@users.sourceforge.jp>
3247
3248	* config.bfd: Add h8300-*-linux.
3249	* configure.ac: Add h8300_elf32_linux_vec.
3250	* configure: Regenerate.
3251	* elf32-h8300.c: Likewise.
3252	* targets.c(_bfd_target_vector): Likewise.
3253
32542015-02-23  Nick Clifton  <nickc@redhat.com>
3255
3256	PR 17914
3257	* cpu-w65.c: Correct typos in license notice.
3258
3259	PR 17940
3260	* elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug
3261	symbols at end of sections.  Adjust function sizes.
3262
32632015-02-20  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3264
3265	* elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
3266	(elfcore_write_s390_vxrs_high): Likewise.
3267	* elf.c (elfcore_grok_s390_vxrs_low): New function.
3268	(elfcore_grok_s390_vxrs_high): New function.
3269	(elfcore_grok_note): Call them.
3270	(elfcore_write_s390_vxrs_low): New function.
3271	(elfcore_write_s390_vxrs_high): New function.
3272	(elfcore_write_register_note): Call them.
3273
32742015-02-19  Branko Drevensek  <branko.drevensek@gmail.com>
3275
3276	PR 17995
3277	* verilog.c (verilog_write_record): Correct buffer size.
3278
32792015-02-19  Alan Modra  <amodra@gmail.com>
3280
3281	* elflink.c (_bfd_elf_define_linkage_sym): Set 'bed' earlier.
3282
32832015-02-19  Alan Modra  <amodra@gmail.com>
3284
3285	PR ld/4317
3286	* elflink.c (elf_link_input_bfd): Drop undefined local syms.
3287	(elf_link_output_extsym): Drop local and global undefined syms.
3288	Tidy.  Expand comment.
3289
32902015-02-17  Alan Modra  <amodra@gmail.com>
3291
3292	PR ld/17975
3293	* elflink.c (struct elf_outext_info): Remove need_second_pass
3294	and second_pass.
3295	(elf_link_output_extsym): Delete code handling second forced
3296	local pass.  Move code emitting NULL STT_FILE symbol later, so
3297	that it can be omitted if forced local is stripped.  Don't
3298	emit the NULL STT_FILE if no file symbols have been output.
3299	(bfd_elf_final_link): Remove second forced local pass.
3300	* elf32-ppc.c (add_stub_sym): Set linker_def on linker syms.
3301	(ppc_elf_size_dynamic_sections): Likewise.
3302	* elf64-ppc.c (ppc_build_one_stub): Likewise.
3303	(build_global_entry_stubs): Likewise.
3304	(ppc64_elf_build_stubs): Likewise.
3305
33062015-02-16  H.J. Lu  <hongjiu.lu@intel.com>
3307
3308	PR ld/17975
3309	* elflink.c (elf_link_output_extsym): Only check filesym_count
3310	when outputting a NULL FILE symbol.  Set second_pass_sym to
3311	h->forced_local && !h->root.linker_def.
3312
33132015-02-15  H.J. Lu  <hongjiu.lu@intel.com>
3314
3315	* elf32-i386.c (elf_i386_always_size_sections): Set root.linker_def
3316	on _TLS_MODULE_BASE_.
3317	* elf64-x86-64.c (elf_x86_64_always_size_sections): Likewise.
3318
33192015-02-15  Alan Modra  <amodra@gmail.com>
3320
3321	* dwarf2.c (read_rangelist): Correct buffer overflow check
3322	Whitespace throughout file.
3323
33242015-02-14  Alan Modra  <amodra@gmail.com>
3325
3326	PR ld/17973
3327	* bfd.c (struct bfd): Add lto_output.
3328	* linker.c (_bfd_handle_already_linked): Explicitly test for
3329	objects added by the lto plugin.
3330	* opncls.c (_bfd_new_bfd_contained_in): Copy lto_output and
3331	no_export flags from archive.
3332	* archive.c (open_nested_file): New function, setting lto_output
3333	and no_export, extracted from..
3334	(find_nested_archive): ..here.  Flip params.  Rename from
3335	_bfd_find_nested_archive.
3336	(_bfd_get_elt_at_filepos): Correct var typo.  Use open_nested_file.
3337	(_bfd_look_for_bfd_in_cache): Copy no_export.
3338	* elflink.c (elf_link_add_object_symbols): Remove now unnecessary
3339	my_archive->no_export test.
3340	(elf_link_input_bfd): Drop existing lto_output STT_FILE syms.
3341	Don't use the file name when adding lto_output STT_FILE sym.
3342	* bfd-in2.h: Regenerate.
3343
33442015-02-13  Alan Modra  <amodra@gmail.com>
3345
3346	PR binutils/17512
3347	* elf64-ppc.c (opd_entry_value): Tighten offset check.  Remove
3348	now redundant assert.
3349
33502015-02-12  Nick Clifton  <nickc@redhat.com>
3351
3352	PR binutils/17512
3353	* dwarf.c (read_1_byte, read_1_signed_byte, read_2_bytes)
3354	(read_4_bytes, read_8_bytes, read_n_bytes, read_string)
3355	(read_indirect_string, read_alt_indirect_string)
3356	(read_alt_indirect_ref, read_address, read_abbrevs)
3357	(read_attribute_value, read_attribute, decode_line_info)
3358	(find_abstract_instance_name, read_rangelist)
3359	(scan_unit_for_symbols, parse_comp_unit)
3360	(_bfd_dwarf2_find_nearest_line): Harden DWARF reading code.  Pass
3361	end pointers to reading functions and check for offsets taking
3362	pointers out of range.  Replace calls to read_*_leb128 with calls
3363	to safe_read_leb128.
3364
3365	(* elf64-ppc.c (opd_entry_value): Add a check for an overlarge
3366	offset.
3367	* syms.c (_bfd_stab_section_find_nearest_line): Add checks for
3368	computed file_name address being before the start of the string
3369	table.
3370
33712015-02-11  H.J. Lu  <hongjiu.lu@intel.com>
3372
3373	PR ld/17878
3374	* bfd.c (bfd_plugin_format): New.
3375	(bfd): Add plugin_format and plugin_dummy_bfd.
3376	* plugin.c (try_load_plugin): Take a pointer to bfd_boolean
3377	argument to return TRUE if any plugin is found.  Set plugin_format.
3378	(has_plugin): New.
3379	(bfd_plugin_target_p): New.
3380	(bfd_plugin_specified_p): Likewise.
3381	(bfd_plugin_target_p): Likewise.
3382	(register_ld_plugin_object_p): Likewise.
3383	(bfd_plugin_set_plugin): Set has_plugin.
3384	(load_plugin): Cache try_load_plugin result.
3385	(bfd_plugin_object_p): Try ld_plugin_object_p first.  Check
3386	plugin_format.
3387	* plugin.h (bfd_plugin_target_p): New.
3388	(bfd_plugin_specified_p): Likewise.
3389	(register_ld_plugin_object_p): Likewise.
3390	* bfd-in2.h: Regenerated.
3391
33922015-02-11  Pedro Alves  <palves@redhat.com>
3393
3394	* libbfd-in.h [__cplusplus]: Open extern "C" scope.
3395	* libcoff-in.h [__cplusplus]: Open extern "C" scope.
3396	* libbfd.h: Regenerate.
3397	* libcoff.h: Regenerate.
3398
3399	* elf-bfd.h [__cplusplus]: Wrap in extern "C".
3400	* mach-o.h [__cplusplus]: Wrap in extern "C".
3401	* som.h [__cplusplus]: Wrap in extern "C".
3402
34032015-02-10  Nick Clifton  <nickc@redhat.com>
3404
3405	PR binutils/17512
3406	* coffcode.h (styp_to_sec_flags): Use an unsigned long type to
3407	hold the flag bits.
3408	* peXXigen.c (pe_print_reloc): Use unsigned types to hold the
3409	size and number of relocs.
3410	(pe_print_debugdata): Use a 32-bit aligned buffer to store the
3411	codeview record.
3412	* versados.c (process_otr): Check the esdid value before using it
3413	to access the EDATA.
3414
34152015-02-09  Ed Maste  <emaste@freebsd.org>
3416
3417	* elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing
3418	uninitialized and unused variable.
3419	* elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3420
34212015-02-09  Alan Modra  <amodra@gmail.com>
3422
3423	* elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
3424	tls_sec.
3425	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3426	* elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.
3427
34282015-02-09  Alan Modra  <amodra@gmail.com>
3429
3430	* elflink.c: Whitespace, formatting fixes.
3431	(elf_link_input_bfd): Clarify comment.
3432	(elf_link_output_extsym): Exclude symbols in linker created
3433	sections when testing for plugin symbols.
3434
34352015-02-07  H.J. Lu  <hongjiu.lu@intel.com>
3436
3437	PR ld/17935
3438	* elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a
3439	warning for relocation in readonly section for -z text.
3440	(elf_i386_size_dynamic_sections): Likewise.
3441	* elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
3442	(elf_x86_64_size_dynamic_sections): Likewise.
3443
34442015-02-06  H.J. Lu  <hongjiu.lu@intel.com>
3445
3446	PR ld/12365
3447	PR ld/14272
3448	* elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change.
3449	(elf_link_input_bfd): Mark the plugin symbol undefined if it is
3450	referenced from a non-IR file.
3451
34522015-02-06  Nick Clifton  <nickc@redhat.com>
3453
3454	PR binutils/17512
3455	* peXXigen.c (rsrc_print_resource_entries): Add range check for
3456	addresses that wrap around the address space.
3457	(rsrc_parse_entry): Likewise.
3458
34592015-02-03  H.J. Lu  <hongjiu.lu@intel.com>
3460
3461	PR ld/12365
3462	PR ld/14272
3463	* elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol
3464	undefined if it is referenced from a non-IR file.
3465
34662015-02-03  Nick Clifton  <nickc@redhat.com>
3467
3468	PR binutils/17512
3469	* ecoff.c: Use bfd_alloc2 to allocate space for structure arrays.
3470	(_bfd_ecoff_slurp_symbol_table): Check for a negative symbol
3471	index or an out of range fdr index.
3472	* elf-m10300.c (mn10300_info_to_howto): Fix typo in error message.
3473	* elf32-arc.c (arc_info_to_howto_rel): Likewise.
3474	* elf32-avr.c (avr_info_to_howto_rela): Likewise.
3475	* elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
3476	* elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
3477	* elf32-cris.c (cris_info_to_howto_rela): Likewise.
3478	* elf32-crx.c (elf_crx_info_to_howto): Likewise.
3479	* elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
3480	* elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
3481	* elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
3482	* elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
3483	* elf32-frv.c (frv_info_to_howto_rela): Likewise.
3484	* elf32-i370.c (i370_elf_info_to_howto): Likewise.
3485	* elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
3486	* elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
3487	* elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
3488	* elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
3489	* elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
3490	* elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
3491	* elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
3492	* elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
3493	* elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3494	* elf32-mep.c (mep_info_to_howto_rela): Likewise.
3495	* elf32-metag.c (metag_info_to_howto_rela): Likewise.
3496	* elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3497	* elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
3498	* elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
3499	* elf32-mt.c (mt_info_to_howto_rela): Likewise.
3500	* elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
3501	* elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
3502	* elf32-pj.c (pj_elf_info_to_howto): Likewise.
3503	* elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3504	* elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
3505	* elf32-rx.c (rx_info_to_howto_rela): Likewise.
3506	* elf32-sh.c (sh_elf_info_to_howto): Likewise.
3507	* elf32-spu.c (spu_elf_info_to_howto): Likewise.
3508	* elf32-v850.c (v850_elf_perform_relocation): Likewise.
3509	* elf32-vax.c (rtype_to_howto): Likewise.
3510	* elf32-visium.c (visium_info_to_howto_rela): Likewise.
3511	* elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
3512	* elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
3513	* elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3514	* elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
3515	* mach-o.c: Use bfd_alloc2 to allocate space for structure arrays.
3516	(bfd_mach_o_canonicalize_one_reloc): Fix check on out
3517	of range symbol indicies.
3518	(bfd_mach_o_canonicalize_relocs): Check for out of range alloc.
3519	(bfd_mach_o_canonicalize_dynamic_reloc): Likewise.
3520	(bfd_mach_o_build_dysymtab): Likewise.
3521	(bfd_mach_o_write_symtab_content): Set the string table size to
3522	zero upon error.
3523	(bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the
3524	read fails.
3525	* peXXigen.c (pe_print_edata):  Check for numeric overflow in edt
3526	fields.
3527	* tekhex.c (first_phase): Check for src pointer reaching end of
3528	buffer.
3529
35302015-02-03  Will Newton  <will.newton@linaro.org>
3531
3532	* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
3533	Set st_value to zero for undefined symbols if the reference
3534	is weak or pointer_equality_needed is FALSE.
3535
3536	* elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
3537	  comment discussing why we clear st_value for some symbols.
3538
35392015-02-02  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3540
3541	* elf32-nds32.c (nds32_get_section_contents): Add one more argument.
3542	(nds32_elf_relocate_section): Do not relocate R_NDS32_LONGJUMP7.
3543
35442015-01-29  Alan Modra  <amodra@gmail.com>
3545
3546	* elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
3547	optimization.  Tidy mask for GOT_TLSGD optimization.
3548	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.  Correct
3549	location of nop zapping high insn too.
3550
35512015-01-28  Alan Modra  <amodra@gmail.com>
3552
3553	* elf64-ppc.h (struct ppc64_elf_params): Add "object_in_toc".
3554	* elf64-ppc.c (ppc64_elf_add_symbol_hook): Assume that global symbols
3555	in .toc indicate xlc compiled code that might require a rw .toc.
3556
35572015-01-28  James Bowman  <james.bowman@ftdichip.com>
3558
3559	* Makefile.am: Add FT32 files.
3560	* archures.c (enum bfd_architecture): Add bfd_arch_ft32.
3561	(bfd_mach_ft32): Define.
3562	(bfd_ft32_arch): Declare.
3563	(bfd_archures_list): Add bfd_ft32_arch.
3564	* config.bfd: Handle FT32.
3565	* configure.ac: Likewise.
3566	* cpu-ft32.c: New file.
3567	* elf32-ft32.c: New file.
3568	* reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
3569	BFD_RELOC_FT32_18): Define.
3570	* targets.c (_bfd_target_vector): Add ft32_elf32_vec.
3571	* bfd-in2.h: Regenerate.
3572	* libbfd.h: Regenerate.
3573	* Makefile.in: Regenerate.
3574	* configure: Regenerate.
3575	* po/SRC-POTFILES.in: Regenerate.
3576
35772015-01-27  Nick Clifton  <nickc@redhat.com>
3578
3579	PR binutils/17512
3580	* pdp11.c (aout_get_external_symbols): Return false if there are
3581	no symbols.
3582
3583	* dwarf2.c (concat_filename): Check for an empty directory table.
3584	(scan_unit_for_symbols): Check for reading off the end of the
3585	unit.
3586	(parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
3587	non-string form.
3588	* elf64-ppc.c (opd_entry_value): Fail if there are no relocs
3589	available.
3590
35912015-01-26  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3592
3593	* elf32-nds32.c (nds32_elf_pick_relax): Fix again setting.
3594
35952015-01-22  DJ Delorie  <dj@redhat.com>
3596
3597	* elf32-m32c.c (m32c_apply_reloc_24): New.
3598	(m32c_elf_howto_table): Use it for R_M32C_24.
3599	(m32c_elf_relocate_section): Handle R_M32C_24 specially.
3600
36012015-01-22  Nick Clifton  <nickc@redhat.com>
3602
3603	PR binutils/17512
3604	* coffcode.h (handle_COMDAT): When searching for the section
3605	symbol, make sure that there is space left in the symbol table.
3606	* vms-alpha.c (_bfd_vms_slurp_ehdr): Add range checks.
3607
36082015-01-21  Nick Clifton  <nickc@redhat.com>
3609
3610	PR binutils/17512
3611	* coffcode.h (coff_set_arch_mach_hook): Check return value from
3612	bfd_malloc.
3613	(coff_slurp_line_table): Return FALSE if the line number
3614	information was corrupt.
3615	(coff_slurp_symbol_table): Return FALSE if the symbol information
3616	was corrupt.
3617	* mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
3618	initialise the fields of the dyld_info structure.
3619	(bfd_mach_o_build_exec_seg_command): Replace assertion with an
3620	error message and a return value.
3621	(bfd_mach_o_layout_commands): Change the function to boolean.
3622	Return FALSE if the function fails.
3623	(bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
3624	fails.
3625	(bfd_mach_o_read_command): Fail if an unrecognised command is
3626	encountered.
3627	* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
3628	read fails.
3629	(slurp_symtab): Check the return from bfd_malloc.
3630	(_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
3631	encountered an error.
3632	(_bfd_XXi_final_link_postscript): Fail if a section could not be
3633	copied.
3634	* peicode.h (pe_bfd_object_p): Fail if the header could not be
3635	swapped in.
3636	* tekhex.c (first_phase): Fail if the section is too big.
3637	* versados.c (struct esdid): Add content_size field.
3638	(process_otr): Use and check the new field.
3639	(versados_get_section_contents): Check that the section exists and
3640	that the requested data is available.
3641
36422015-01-20  Chung-Lin Tang  <cltang@codesourcery.com>
3643
3644	* elf32-nios2.c (elf_backend_default_execstack): Define as 0.
3645
36462015-01-20  Alan Modra  <amodra@gmail.com>
3647
3648	PR ld/17615
3649	* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
3650	ELF_COMMON_DEF syms.
3651
36522015-01-19  Alan Modra  <amodra@gmail.com>
3653
3654	PR ld/17615
3655	* elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
3656	linker script assignments too.
3657	* elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
3658	(bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
3659
36602015-01-19  Alan Modra  <amodra@gmail.com>
3661
3662	* elf32-bfin.c (bfin_bfd_reloc_type_lookup): Correct loop iteration
3663	to allow return of first howto.
3664	* elf32-fr30.c (fr30_reloc_type_lookup): Likewise.
3665	* elf32-m32c.c (m32c_reloc_type_lookup): Likewise.
3666	* elf32-moxie.c (moxie_reloc_type_lookup): Likewise.
3667	* elf32-or1k.c (or1k_reloc_type_lookup): Likewise.
3668	* elf32-rl78.c (rl78_reloc_type_lookup): Likewise.
3669	* elf32-rx.c (rx_reloc_type_lookup): Likewise.
3670	* elf32-tilepro.c (tilepro_reloc_type_lookup): Likewise.
3671	* elf32-xstormy16.c (xstormy16_reloc_type_lookup): Likewise.
3672	* elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
3673	* elf32-nios2.c (nios2_reloc_map): Add mapping for R_NIOS2_NONE.
3674	* elf32-spu.c (spu_elf_bfd_to_reloc_type): Allow return of R_SPU_NONE.
3675	(spu_elf_reloc_type_lookup): Adjust to suit.
3676
36772015-01-19  Alan Modra  <amodra@gmail.com>
3678
3679	* bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
3680	(bfd_get_section_limit): ..here.
3681	* reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
3682	(bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
3683	* elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
3684	* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
3685	bfd_reloc_outofrange check.
3686	* bfd-in2.h: Regenerate.
3687
3688	* cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
3689	on zero size relocs.
3690	* ecoff.c (ecoff_reloc_link_order): Likewise.
3691	* elf32-nds32.c (nds32_relocate_contents): Likewise.
3692	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3693
3694	* reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
3695	(_bfd_clear_contents): Likewise.
3696	* elfxx-mips.c (mips_elf_obtain_contents): Likewise.
3697	(mips_elf_perform_relocation): Likewise.
3698
3699	* aoutx.h (aout_link_reloc_link_order): Allow for NULL return
3700	from malloc on zero size alloc.
3701	* cofflink.c (_bfd_coff_reloc_link_order): Likewise.
3702	* elflink.c (elf_reloc_link_order): Likewise.
3703	* linker.c (_bfd_generic_reloc_link_order): Likewise.
3704	* pdp11.c (aout_link_reloc_link_order): Likewise.
3705	* xcofflink.c (xcoff_reloc_link_order): Likewise.
3706
3707	* aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
3708	bitsize 0, and complain_overflow_dont.
3709	* coff-sparc.c (coff_sparc_howto_table): Likewise.
3710	* elf-hppa.h (elf_hppa_howto_table): Likewise.
3711	* elf-m10200.c (elf_mn10200_howto_table): Likewise.
3712	* elf-m10300.c (elf_mn10300_howto_table): Likewise.
3713	* elf32-arc.c (elf_arc_howto_table): Likewise.
3714	* elf32-arm.c (elf32_arm_howto_table_1): Likewise.
3715	* elf32-avr.c (elf_avr_howto_table): Likewise.
3716	* elf32-bfin.c (bfin_howto_table): Likewise.
3717	* elf32-cr16.c (cr16_elf_howto_table): Likewise.
3718	* elf32-cris.c (cris_elf_howto_table): Likewise.
3719	* elf32-crx.c (crx_elf_howto_table): Likewise.
3720	* elf32-d10v.c (elf_d10v_howto_table): Likewise.
3721	* elf32-d30v.c (elf_d30v_howto_table): Likewise.
3722	* elf32-dlx.c (dlx_elf_howto_table): Likewise.
3723	* elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
3724	* elf32-fr30.c (fr30_elf_howto_table): Likewise.
3725	* elf32-frv.c (elf32_frv_howto_table): Likewise.
3726	* elf32-h8300.c (h8_elf_howto_table): Likewise.
3727	* elf32-i370.c (i370_elf_howto_raw): Likewise.
3728	* elf32-i386.c (elf_howto_table): Likewise.
3729	* elf32-i860.c (elf32_i860_howto_table): Likewise.
3730	* elf32-i960.c (elf32_i960_relocate): Likewise.
3731	* elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
3732	* elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
3733	* elf32-lm32.c (lm32_elf_howto_table): Likewise.
3734	* elf32-m32c.c (m32c_elf_howto_table): Likewise.
3735	* elf32-m32r.c (m32r_elf_howto_table): Likewise.
3736	* elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
3737	* elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
3738	* elf32-m68k.c (howto_table): Likewise.
3739	* elf32-mcore.c (mcore_elf_howto_raw): Likewise.
3740	* elf32-mep.c (mep_elf_howto_table): Likewise.
3741	* elf32-metag.c (elf_metag_howto_table): Likewise.
3742	* elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
3743	* elf32-mips.c (elf_mips_howto_table_rel): Likewise.
3744	* elf32-moxie.c (moxie_elf_howto_table): Likewise.
3745	* elf32-msp430.c (elf_msp430_howto_table): Likewise.
3746	* elf32-mt.c (mt_elf_howto_table): Likewise.
3747	* elf32-nds32.c (nds32_elf_howto_table): Likewise.
3748	* elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
3749	* elf32-or1k.c (or1k_elf_howto_table): Likewise.
3750	* elf32-pj.c (pj_elf_howto_table): Likewise.
3751	* elf32-ppc.c (ppc_elf_howto_raw): Likewise.
3752	* elf32-rl78.c (rl78_elf_howto_table): Likewise.
3753	* elf32-rx.c (rx_elf_howto_table): Likewise.
3754	* elf32-s390.c (elf_howto_table): Likewise.
3755	* elf32-score.c (elf32_score_howto_table): Likewise.
3756	* elf32-score7.c (elf32_score_howto_table): Likewise.
3757	* elf32-sh-relocs.h (R_SH_NONE): Likewise.
3758	* elf32-spu.c (elf_howto_table): Likewise.
3759	* elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
3760	* elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
3761	* elf32-v850.c (v850_elf_howto_table): Likewise.
3762	* elf32-vax.c (howto_table): Likewise.
3763	* elf32-visium.c (visium_elf_howto_table): Likewise.
3764	* elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
3765	* elf32-xgate.c (elf_xgate_howto_table): Likewise.
3766	* elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
3767	* elf32-xtensa.c (elf_howto_table): Likewise.
3768	* elf64-alpha.c (elf64_alpha_howto_table): Likewise.
3769	* elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
3770	* elf64-mmix.c (elf_mmix_howto_table): Likewise.
3771	* elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
3772	* elf64-s390.c (elf_howto_table): Likewise.
3773	* elf64-sh64.c (sh_elf64_howto_table): Likewise.
3774	* elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
3775	* elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
3776	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
3777	(elfNN_aarch64_howto_none): Likewise.
3778	* elfxx-ia64.c (ia64_howto_table): Likewise.
3779	* elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
3780	* elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
3781	* nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
3782
37832015-01-15  H.J. Lu  <hongjiu.lu@intel.com>
3784
3785	PR ld/17847
3786	* elf64-x86-64.c (elf_x86_64_relocate_section): Don't complain
3787	about -fPIC if the symbol is undefined when building executable.
3788
37892015-01-15  Nick Clifton  <nickc@redhat.com>
3790
3791	PR binutils/17512
3792	* elf-m10300.c (mn10300_info_to_howto): Replace assertion with an
3793	error message.  Never return an invalid howto pointer.
3794	* elf32-cr16.c (cr16_info_to_howto): Likewise.
3795	* elf32-crx.c (elf_crx_info_to_howto): Likewise.
3796	* elf32-i370.c (i370_elf_info_to_howto): Likewise.
3797	* elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3798	* elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3799	* elf32-mips.c (mips_elf32_rtype_to_howto): Likewise.
3800	* elf32-pj.c (pj_elf_info_to_howto): Likewise.
3801	* elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3802	* elf32-spu.c (spu_elf_info_to_howto): Likewise.
3803	* elf32-v850.c (v850_elf_info_to_howto_rela): Likewise.
3804	* elf32-vax.c (rtype_to_howto): Likewise.
3805	* elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3806	* elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
3807	* elfn32-mips.c (sh_elf_info_to_howto): Likewise.
3808	* elf32-sh.c (sh_elf_info_to_howto): Likewise.
3809	(sh_elf_reloc): Check that the reloc is in range.
3810	* reloc.c (bfd_perform_relocation): Check that the section is big
3811	enough for the entire reloc.
3812	(bfd_generic_get_relocated_section_contents): Report unexpected
3813	return values from perform_reloc.
3814
38152015-01-15  Nick Clifton  <nickc@redhat.com>
3816
3817	* elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
3818	relocs.  Include PC-relative adjustment for R_MSP430X_ABS16
3819	relaxation.
3820
38212015-01-15  Alan Modra  <amodra@gmail.com>
3822
3823	* elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
3824	any output section matching a linker created dynobj section.
3825
38262015-01-15  Alan Modra  <amodra@gmail.com>
3827
3828	PR 17842
3829	* elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
3830	(bfd_elf_final_link): Always create a symbol table when emit_relocs.
3831	Don't assign symtab file position unless symbols will be output.
3832	Merge blocks with condition in common.  Don't call
3833	elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
3834	unless other symbols are output.  Move assignment of symtab_shndx
3835	file position.  Localize variable.
3836
38372015-01-14  Jiong Wang  <jiong.wang@arm.com>
3838
3839	* elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when
3840	trying to defer them to runtime.
3841
38422015-01-13  Thomas Preud'homme <thomas.preudhomme@arm.com>
3843
3844	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
3845	to check if a symbol should be bound symbolically.
3846
38472015-01-13  Jiong Wang  <jiong.wang@arm.com>
3848
3849	* elfnn-aarch64.c: (elfNN_aarch64_howto_table): Enable overflow check
3850	for TLSLE_MOVW_TPREL_G2.
3851
38522015-01-13  Jiong Wang  <jiong.wang@arm.com>
3853
3854	PR ld/17415
3855	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark
3856	R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned.
3857	* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the
3858	bit mask.
3859
38602015-01-12  Terry Guo  <terry.guo@arm.com>
3861
3862	* elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New
3863	function.
3864	(_bfd_elf_gc_mark_extra_sections): Use it.
3865
38662015-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3867
3868	PR ld/17827
3869	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
3870	only discard space for pc-relative relocs symbols which turn
3871	out to need copy relocs.
3872
38732015-01-09  Nick Clifton  <nickc@redhat.com>
3874
3875	* tekhex.c (getvalue): Fix thinko in test for correct extraction
3876	of value.
3877	(getsym): Return false if there was not enough data to extract the
3878	symbol.
3879
38802015-01-09  Anthony Green  <green@moxielogic.com>
3881
3882	* elf32-moxie.c (ELF_MACHINE_ALT1): Define.
3883
38842015-01-08  Nick Clifton  <nickc@redhat.com>
3885
3886	* elf32-msp430.c (msp430_elf_relax_section): Add relaxation of
3887	16-bit absolute BR instructions to 10-bit pc-relative JMP
3888	instructions.
3889
38902015-01-08  Nick Clifton  <nickc@redhat.com>
3891
3892	PR binutils/17512
3893	* coffcode.h (coff_slurp_symbol_table): Return false if we failed
3894	to load the line table.
3895	* elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum
3896	maxpagesize of 1.
3897	* peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if
3898	the Data Directory Size is too large.
3899
39002015-01-06  H.J. Lu  <hongjiu.lu@intel.com>
3901
3902	PR binutils/17512
3903	* elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation.
3904	* elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3905
39062015-01-06  Nick Clifton  <nickc@redhat.com>
3907
3908	PR binutils/17512
3909	* mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the
3910	string table.
3911
3912	* reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
3913	(bfd_perform_relocation): Include the size of the reloc in the
3914	test for an out of range relocation.
3915	(bfd_generic_get_relocated_section_contents): Remove reloc range
3916	test.
3917
3918	* coff-i860.c (CALC_ADDEND): Always set an addend value.
3919	* tekhex.c (getvalue): Add an end pointer parameter.  Use it to
3920	avoid reading off the end of the buffer.
3921	(getsym): Likewise.
3922	(first_phase): Likewise.
3923	(pass_over): Pass an end pointer to the invoked function.
3924
39252015-01-05  H.J. Lu  <hongjiu.lu@intel.com>
3926
3927	PR binutils/17512
3928	* elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt
3929	input.
3930	* elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3931
39322015-01-05  Nick Clifton  <nickc@redhat.com>
3933
3934	PR binutils/17512
3935	* archive.c (do_slurp_bsd_armap): Make sure that the parsed sized
3936	is at least big enough for the header to be read.
3937	* elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocs.
3938	* mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks.
3939	(bfd_mach_o_read_command): Prevetn duplicate error messages about
3940	unrecognized commands.
3941	* syms.c (_bfd_stab_section_find_nearest_line): Add range checks
3942	when indexing into the string table.
3943
39442015-01-01  Alan Modra  <amodra@gmail.com>
3945
3946	Update year range in copyright notice of all files.
3947
3948For older changes see ChangeLog-2014
3949
3950Copyright (C) 2015 Free Software Foundation, Inc.
3951
3952Copying and distribution of this file, with or without modification,
3953are permitted in any medium without royalty provided the copyright
3954notice and this notice are preserved.
3955
3956Local Variables:
3957mode: change-log
3958left-margin: 8
3959fill-column: 74
3960version-control: never
3961End:
3962