Add support for DT_MIPS_RLD_MAP_REL.
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
a5499fa4
MF
12015-06-26 Matthew Fortune <matthew.fortune@imgtec.com>
2
3 * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable
4 instead of !shared to indicate an application vs shared library.
5 (_bfd_mips_elf_size_dynamic_sections): Likewise.
6 (_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL.
7 (_bfd_mips_elf_get_target_dtag): Likewise.
8
3f307074
DD
92015-06-25 DJ Delorie <dj@redhat.com>
10
11 * elf32-msp430.c (msp430_final_link_relocate): Fix comments. Fix
12 REL loads to match RELA stores.
13
946748d5
L
142015-06-25 H.J. Lu <hongjiu.lu@intel.com>
15
16 * elf.c (_bfd_elf_compute_section_file_positions): Don't
17 initialize sh_size for .shstrtab here.
18
ef10c3ac
L
192015-06-25 H.J. Lu <hongjiu.lu@intel.com>
20
21 PR gas/18451
22 * elf-bfd.h (elf_sym_strtab): New.
23 (elf_link_hash_table): Add strtabcount, strtabsize and
24 strtab.
25 (_bfd_elf_stringtab_init): Removed.
26 * elf.c (_bfd_elf_stringtab_init): Removed.
27 (_bfd_elf_compute_section_file_positions): Replace
28 bfd_strtab_hash/_bfd_elf_stringtab_init/_bfd_stringtab_free/
29 _bfd_stringtab_size with
30 elf_strtab_hash/_bfd_elf_strtab_init/_bfd_elf_strtab_free/
31 _bfd_elf_strtab_size. Use _bfd_elf_strtab_add,
32 _bfd_elf_strtab_finalize and _bfd_elf_strtab_offset to get
33 st_name.
34 (swap_out_syms): Likewise.
35 * elflink.c (elf_final_link_info): Replace bfd_strtab_hash
36 with elf_strtab_hash. Remove symbuf, symbuf_count,
37 symbuf_size and shndxbuf_size.
38 (elf_link_flush_output_syms): Removed.
39 (elf_link_output_sym): Renamed to ...
40 (elf_link_output_symstrtab): This. Replace _bfd_stringtab_add
41 with _bfd_elf_strtab_add. Don't flush symbols to the file nor
42 swap out symbols.
43 (elf_link_swap_symbols_out): New.
44 (elf_link_output_extsym): Replace elf_link_output_sym with
45 elf_link_output_symstrtab.
46 (elf_link_input_bfd): Likewise.
47 (elf_final_link_free): Replace _bfd_stringtab_free with
48 _bfd_elf_strtab_free. Remove symbuf.
49 (bfd_elf_final_link): Replace _bfd_elf_stringtab_init with
50 _bfd_elf_strtab_init. Don't set symbuf, symbuf_count,
51 symbuf_size nor shndxbuf_size. Initialize strtabsize and
52 strtab. Initialize symshndxbuf to -1 when number of sections
53 >= 64K. Replace elf_link_output_sym/elf_link_output_sym with
54 elf_link_output_symstrtab/elf_link_output_symstrtab. Don't
55 call elf_link_flush_output_syms. Call _bfd_elf_strtab_finalize
56 and elf_link_swap_symbols_out. Replace _bfd_stringtab_size
57 and _bfd_stringtab_emit with _bfd_elf_strtab_size and
58 _bfd_elf_strtab_emit.
59
7cc152be
L
602015-06-24 H.J. Lu <hongjiu.lu@intel.com>
61
62 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Silence older
63 GCC warning.
64
7c1e8d3e
L
652015-06-24 H.J. Lu <hongjiu.lu@intel.com>
66
67 * elf32-i386.c (elf_i386_allocate_dynrelocs): Always allocate
68 space for the first .plt entry.
69 (elf_i386_size_dynamic_sections): Always add DT_PLTGOT for .plt
70 section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
71 there are PLT relocations.
72 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Always
73 allocate space for the first .plt entry.
74 (elf_x86_64_size_dynamic_sections): Always add DT_PLTGOT for
75 .plt section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
76 there are PLT relocations.
77
59cab532
L
782015-06-24 H.J. Lu <hongjiu.lu@intel.com>
79
80 PR ld/18591
81 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert
82 R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation
83 overflow.
84
c2170589
JW
852015-06-23 Jiong Wang <jiong.wang@arm.com>
86
87 * elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function.
88 (elfNN_aarch64_size_dynamic_sections): Traverse hash table to check
89 relocations against read-only sections.
90
75c11999
NC
912015-06-18 Nick Clifton <nickc@redhat.com>
92
93 PR 18481
94 * elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.
95
56f40832
JT
962015-06-15 Jon Turney <jon.turney@dronecode.org.uk>
97
98 * bfd.c: Change struct bfd_build_id to use bfd_size_type.
99 * bfd-in2.h : Regenerate.
100
1d5c94cb
AM
1012015-06-16 Alan Modra <amodra@gmail.com>
102
103 * elf32-ppc.c (ppc_elf_relocate_section): Correct binary search of
104 dynamic relocs.
105
c74f7d1c
JT
1062015-06-10 Jon Turney <jon.turney@dronecode.org.uk>
107
108 * elf-bfd.h : Remove struct elf_build_id.
109 * bfd.c : Add struct bfd_build_id.
110 * bfd-in2.h: Regenerate.
111 * elf.c (elfobj_grok_gnu_build_id): Update to use bfd_build_id.
112 * libpei.h: Add protoype and macros for
113 bfd_XXi_slurp_codeview_record.
114 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Make public
115 * peicode.h (pe_bfd_read_buildid): Add.
116 (pe_bfd_object_p): Use pe_bfd_read_buildid().
117
87f5fbcc
RL
1182015-06-15 Renlin Li <renlin.li@arm.com>
119
120 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry.
121 * bfd-in2.h: Regenerate.
122 * libbfd.h: Regenerate.
123 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
124 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15.
125
3a062fa1
AM
1262015-06-15 Alan Modra <amodra@gmail.com>
127
128 * cofflink.c (_bfd_coff_generic_relocate_section): Revert
129 2014-03-26 change. Call _bfd_clear_contents for relocs against
130 local and global symbols defined in discarded input sections.
131
1ade7175
NC
1322015-06-05 Nick Clifton <nickc@redhat.com>
133
134 * elf32-msp430.c (rl78_sym_diff_handler): New function.
135 (msp430_howto_table): Use the new function for the SYM_DIFF reloc.
136 (msp430x_howto_table): Likewise.
137
f8b44781
AM
1382015-06-05 Alan Modra <amodra@gmail.com>
139
140 * elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
141 relocs with insns moved by --ppc476-workaround. Correct
142 output of REL16 relocs.
143
7018c030
JW
1442015-06-01 Jiong Wang <jiong.wang@arm.com>
145
146 * elfnn-aarch64.c (aarch64_reloc_got_type): Support
147 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
148 (elfNN_aarch64_final_link_relocate): Ditto.
149 (elfNN_aarch64_gc_swap_hook): Ditto.
150 (elfNN_aarch64_check_relocs): Ditto.
151 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
152
3d715ce4
JW
1532015-06-01 Jiong Wang <jiong.wang@arm.com>
154
155 * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
156 * bfd-in2.h: Regenerate.
157 * libbfd.h: Regenerate.
158 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
159 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
160
36e6c140
JW
1612015-06-01 Jiong Wang <jiong.wang@arm.com>
162
163 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
164 complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
165 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
166 PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
167
99ad26cb
JW
1682015-06-01 Jiong Wang <jiong.wang@arm.com>
169
170 * elfnn-aarch64.c (aarch64_reloc_got_type): Support
171 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
172 (elfNN_aarch64_final_link_relocate): Ditto.
173 (elfNN_aarch64_gc_swap_hook): Ditto.
174 (elfNN_aarch64_check_relocs): Ditto.
175 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
176
a921b5bd
JW
1772015-06-01 Jiong Wang <jiong.wang@arm.com>
178
179 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
180 * bfd-in2.h: Regenerate.
181 * libbfd.h: Regenerate.
182 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
183 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
184
2f0c68f2
CM
1852015-05-28 Catherine Moore <clm@codesourcery.com>
186 Bernd Schmidt <bernds@codesourcery.com>
187 Paul Brook <paul@codesourcery.com>
188
189 bfd/
190 * bfd-in2.h: Regenerated.
191 * elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
192 (COMPACT_EH_CANT_UNWIND_OPCODE): Define.
193 (dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
194 eh_frame_hdr_info.
195 (compact_eh_frame_hdr_info): Declare.
196 (eh_frame_hdr_info): Redeclare with union for dwarf-specific
197 fields and compact-eh fields.
198 (elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
199 (bfd_elf_section_data): Add eh_frame_entry_field.
200 (elf_section_eh_frame_entry): Define.
201 (bfd_elf_parse_eh_frame_entries): Declare.
202 (_bfd_elf_parse_eh_frame_entry): Declare.
203 (_bfd_elf_end_eh_frame_parsing): Declare.
204 (_bfd_elf_write_section_eh_frame_entry): Declare.
205 (_bfd_elf_eh_frame_entry_present): Declare.
206 (_bfd_elf_section_for_symbol): Declare.
207 * elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
208 (bfd_elf_record_eh_frame_entry): New function.
209 (_bfd_elf_parse_eh_frame_entry): New function.
210 (_bfd_elf_parse_eh_frame): Update hdr_info field references.
211 (cmp_eh_frame_hdr): New function.
212 (add_eh_frame_hdr_terminator): New function.
213 (_bfd_elf_end_eh_frame_parsing): New function.
214 (find_merged_cie): Update hdr_info field references.
215 (_bfd_elf_discard_section_eh_frame): Likewise.
216 (_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
217 (_bfd_elf_eh_frame_entry_present): New function.
218 (_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
219 (_bfd_elf_write_section_eh_frame_entry): New function.
220 (_bfd_elf_write_section_eh_frame): Update hdr_info field references.
221 (_bfd_elf_fixup_eh_frame_hdr): New function.
222 (write_compact_eh_frame_hdr): New function.
223 (write_dwarf_eh_frame_hdr): New function.
224 (_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
225 * elflink.c (_bfd_elf_section_for_symbol): New function.
226 (elf_section_ignore_discarded_relocs): Add Compact EH support.
227 (elf_link_input_bfd): Likewise.
228 (bfd_elf_final_link): Likewise.
229 (_bfd_elf_gc_mark): Likewise.
230 (bfd_elf_parse_eh_frame_entries): New function.
231 (bfd_elf_gc_sections): Add Compact EH support.
232 (bfd_elf_discard_info): Likewise.
233 * elfxx-mips.c: Include dwarf2.h.
234 (_bfd_mips_elf_compact_eh_encoding): New function.
235 (_bfd_mips_elf_cant_unwind_opcode): New function.
236 * elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
237 (_bfd_mips_elf_cant_unwind_opcode): Declare.
238 (elf_backend_compact_eh_encoding): Define.
239 (elf_backend_cant_unwind_opcode): Define.
240 * elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
241 (elf_backend_cant_unwind_opcode): Provide default.
242 (elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
243 elf_backend_cant_unwind_opcode.
244 * section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.
245
8ded2ddc
L
2462015-05-27 H.J. Lu <hongjiu.lu@intel.com>
247
248 PR binutils/18458
249 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
250 for now binding only if pointer equality isn't needed.
251 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
252 binding only if pointer equality isn't needed.
253 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
254 section for now binding only if pointer equality isn't needed.
255 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
256 binding only if pointer equality isn't needed.
257
fca6ae69
L
2582015-05-26 H.J. Lu <hongjiu.lu@intel.com>
259
260 PR binutils/18437
261 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
262 in .rel.plt/.rela.plt.
263 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
264
ce336788
JW
2652015-05-19 Jiong Wang <jiong.wang@arm.com>
266
267 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
268 relocation case labels alphabetically.
269 (elfNN_aarch64_final_link_relocate): Ditto.
270 (elfNN_aarch64_tls_relax): Ditto.
271 (elfNN_aarch64_relocate_section): Ditto.
272 (elfNN_aarch64_gc_sweep_hook): Ditto.
273 (elfNN_aarch64_check_relocs): Ditto.
274 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
275 (_bfd_aarch64_elf_resolve_relocation): Ditto.
276
80de0c6d
JW
2772015-05-18 Jiong Wang <jiong.wang@arm.com>
278
279 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite
280 comments.
281
25070364
L
2822015-05-16 H.J. Lu <hongjiu.lu@intel.com>
283
284 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
285 for now binding.
286 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
287 binding.
288 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
289 section for now binding.
290 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
291 binding.
292
dab394de
L
2932015-05-14 H.J. Lu <hongjiu.lu@intel.com>
294
295 * bfd.c (bfd_update_compression_header): Also write the zlib
296 header if the SHF_COMPRESSED bit cleared..
297 (bfd_check_compression_header): Return the uncompressed size.
298 * compress.c (decompress_contents): Don't skip the zlib header.
299 (bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
300 which doesn't have the zlib header.
301 (bfd_init_section_decompress_status): Likewise.
302 (bfd_get_full_section_contents): Updated.
303 (bfd_is_section_compressed): Likewise.
304 (bfd_is_section_compressed_with_header): Return the uncompressed
305 size.
306 * elf.c (_bfd_elf_make_section_from_shdr): Updated.
307 * bfd-in2.h: Regenerated.
308
fdc3b1b1
JW
3092015-05-14 Jiong Wang <jiong.wang@arm.com>
310
311 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow
312 check restrictions.
313
e6c9a083
MF
3142015-05-14 Max Filippov <jcmvbkbc@gmail.com>
315
316 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
317 as GOT reference when plt.refcount is not positive.
318
a3747075
L
3192015-05-12 H.J. Lu <hongjiu.lu@intel.com>
320
321 * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
322 for the first .plt entry only if needed.
323 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
324
bf64a951
L
3252015-05-11 H.J. Lu <hongjiu.lu@intel.com>
326
327 * Makefile.am (ALL_MACHINES): Add cpu-iamcu.lo.
328 (ALL_MACHINES_CFILES): Likewise.
329 * archures.c (bfd_mach_iamcu): New.
330 (bfd_mach_i386_iamcu): Likewise.
331 (bfd_mach_i386_iamcu_intel_syntax): Likewise.
332 (bfd_iamcu_arch): Likewise.
333 (bfd_archures_list): Add &bfd_iamcu_arch.
334 * config.bfd (targ_selvecs): Add iamcu_elf32_vec to
335 i386_elf32_vec.
336 (targ_archs): Add bfd_iamcu_arch if needed.
337 * configure.ac: Support iamcu_elf32_vec.
338 * cpu-iamcu.c: New file.
339 * elf32-i386.c (elf32_iamcu_elf_object_p): New function.
340 Add support for iamcu_elf32_vec and elf32_iamcu_bed.
341 * targets.c (iamcu_elf32_vec): New.
342 (_bfd_target_vector): Add iamcu_elf32_vec.
343 * Makefile.in: Regenerated.
344 * bfd-in2.h: Likewise.
345 * configure: Likewise.
346
22abe556
L
3472015-05-11 H.J. Lu <hongjiu.lu@intel.com>
348
349 * elfcode.h (elf_object_p): Replace EM_486 with EM_IAMCU.
350
4b71eec6
L
3512015-05-10 H.J. Lu <hongjiu.lu@intel.com>
352
353 * elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
354 and output_bfd with abfd.
355 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
356
9ac47a43
TS
3572015-05-06 Toni Spets <toni.spets@iki.fi>
358
359 PR ld/18372
360 * peXXigen.c (rsrc_process_section): Skip discarded resource
361 sections.
362
b633b725
L
3632015-05-01 H.J. Lu <hongjiu.lu@intel.com>
364
365 * config.bfd: Support i[3-7]86-*-elf*.
366
914082d1
L
3672015-04-30 H.J. Lu <hongjiu.lu@intel.com>
368
369 * elf32-i386.c (elf_backend_post_process_headers): Undef for
370 Solaris 2.
371
153a2776
NC
3722015-04-30 Nick Clifton <nickc@redhat.com>
373
374 PR 18317
375 * elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
376 mep_reloc.
377 (mep_reloc): Delete unused function.
378
a93d5cb1
NC
3792015-04-29 Nick Clifton <nickc@redhat.com>
380
381 PR 17099
382 * coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
383 relocs.
384
643f7afb
AK
3852015-04-27 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
386
387 * elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
388 * elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
389 elf_s390_merge_obj_attributes.
390 * elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.
391
b53b1bed
JW
3922015-04-24 Jiong Wang <jiong.wang@arm.com>
393
394 PR ld/18270
395 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
396 GOT_NORMAL for both sgot/srelgot section.
397 (elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
398 and generate necessary runtime relocation for GOT entry.
399
69b52ab8
L
4002015-04-24 H.J. Lu <hongjiu.lu@intel.com>
401
402 PR binutils/18209
403 * archive.c (_bfd_get_elt_at_filepos): Copy is_linker_input.
404
dcbd20eb
JW
4052015-04-24 Jiong Wang <jiong.wang@arm.com>
406
407 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
408 PC-relative relocation for external symbol.
409
de13ef81
NC
4102015-04-24 Nick Clifton <nickc@redhat.com>
411
412 PR 18313
413 * compress.c (decompress_contents): Zero initialse the z_stream
414 structure.
415
b1fa9dd6
NC
4162015-04-24 Nick Clifton <nickc@redhat.com>
417
418 * elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
419 local labels to include local labels with a numeric suffix and
420 fake symbols.
421
9361e630
L
4222015-04-24 H.J. Lu <hongjiu.lu@intel.com>
423
424 PR binutils/18316
425 * section.c (SEC_MEP_VLIW): New.
426 * bfd-in2.h: Regenerated.
427
3e19fb8f
L
4282015-04-23 H.J. Lu <hongjiu.lu@intel.com>
429
430 PR ld/18277
431 * compress.c (bfd_compress_section_contents): Remove the
432 write_compress argument.
433 (bfd_init_section_compress_status): Updated.
434 (bfd_compress_section): Likewise.
435 * elf.c (_bfd_elf_set_reloc_sh_name): New.
436 (_bfd_elf_init_reloc_shdr): Add delay_st_name_p. Set sh_name
437 to (unsigned int) -1 if delay_st_name_p is TRUE. Use
438 _bfd_elf_set_reloc_sh_name.
439 (elf_fake_sections): Don't rename DWARF debug section for
440 linker output if it will be compressed. Instead, set
441 delay_st_name_p to TRUE and pass it to _bfd_elf_init_reloc_shdr.
442 (assign_section_numbers): Call _bfd_elf_strtab_addref only if
443 sh_name != (unsigned int) -1. Don't finalize nor assign
444 shstrtab section here. Delay setting output section names to
445 _bfd_elf_write_object_contents.
446 (_bfd_elf_compute_section_file_positions): Update comments on
447 sh_offset for shstrtab section.
448 (assign_file_positions_for_non_load_sections): Set sh_offset to
449 -1 for shstrtab section.
450 (assign_file_positions_except_relocs): Likewise.
451 (_bfd_elf_assign_file_positions_for_non_load): Set up sh_name
452 when compressing DWARF debug sections. Place shstrtab section
453 after DWARF debug sections have been compressed.
454 (_bfd_elf_write_object_contents): Setting sh_name for output
455 sections.
456
f6fe1ccd
L
4572015-04-23 H.J. Lu <hongjiu.lu@intel.com>
458
459 PR binutils/18209
460 * bfd.c (bfd): Add is_linker_input.
461 * elf.c (convert_debug_to_zdebug): New.
462 (convert_zdebug_to_debug): Likewise.
463 (_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
464 .zdebug_* here. Use convert_zdebug_to_debug. Set SEC_ELF_RENAME.
465 (_bfd_elf_init_reloc_shdr): Pass a pointer to section name
466 instead of a pointer to section.
467 (elf_fake_sections): Rename the section name if SEC_ELF_RENAME
468 is set.
469 * section.c (SEC_ELF_RENAME): New.
470 * bfd-in2.h: Regenerated.
471
a27e685f
AM
4722015-04-23 Alan Modra <amodra@gmail.com>
473
474 * elf64-ppc.c (TOC_BASE_ALIGN): Define.
475 (ppc64_elf_next_toc_section): Align multi-got toc base.
476 (ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol.
2f0c68f2
CM
477=======
4782015-05-04 Catherine Moore <clm@codesourcery.com>
479
480 * elfxx-target.h: Add missing #endif.
481
4822015-04-22 Catherine Moore <clm@codesourcery.com>
483
484 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_entry): Don't write
485 the .eh_frame_entry section if the corresponding text section is marked
486 with SEC_EXCLUDE.
487
4882015-04-22 Catherine Moore <clm@codesourcery.com>
489 Bernd Schmidt <bernds@codesourcery.com>
490 Paul Brook <paul@codesourcery.com>
491
492 * bfd-in2.h (SEC_INFO_TYPE_EH_FRAME_ENTRY): Define.
493 * elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
494 (COMPACT_EH_CANT_UNWIND_OPCODE): Define.
495 (dwarf_eh_frame_hdr_info): New struct.
496 (compact_eh_frame_hdr_info): New struct.
497 (eh_frame_hdr_info): Separate dwarf and compact fields.
498 (elf_backend_data): Add compact_eh_encoding and cant_unwind_opcode
499 fields.
500 (bfd_elf_section_data): Add eh_frame_entry field.
501 (elf_section_eh_frame_entry): Define.
502 (bfd_elf_parse_eh_frame_entries): Declare.
503 (_bfd_elf_parse_eh_frame_entry): Declare.
504 (_bfd_elf_end_eh_frame_parsing): Declare.
505 (_bfd_elf_write_section_eh_frame_entry): Declare.
506 (_bfd_elf_fixup_eh_frame_hdr): Declare.
507 (_bfd_elf_eh_frame_entry_present): Declare.
508 (_bfd_elf_section_for_symbol): Declare.
509 * elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
510 (bfd_elf_record_eh_frame_entry): New function.
511 (_bfd_elf_parse_eh_frame_entry): New function.
512 (_bfd_elf_parse_eh_frame): Update hdr_info field references.
513 (cmp_eh_frame_hdr): New function.
514 (add_eh_frame_hdr_terminator): New function.
515 (_bfd_elf_end_eh_frame_parsing): New function.
516 (find_merged_cie): Update hdr_info field references.
517 (_bfd_elf_discard_section_eh_frame): Likewise.
518 (_bfd_elf_discard_section_eh_frame_hdr): Likewise.
519 Add Compact EH support.
520 (_bfd_elf_eh_frame_entry_present): New function.
521 (_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
522 (_bfd_elf_write_section_eh_frame_entry): New function.
523 (_bfd_elf_write_section_eh_frame): Update hdr_info field references.
524 (_bfd_elf_write_section_eh_frame): Likewise.
525 (_bfd_elf_fixup_eh_frame_hdr): New function.
526 (write_compact_eh_frame_hdr): New function.
527 (_bfd_elf_write_section_eh_frame_hdr): Compact EH support. Update
528 hdr_info field references.
529 * elflink.c (_bfd_elf_section_for_symbol): New function.
530 (elf_section_ignore_discarded_relocs, elf_link_input_bfd):
531 Handle SEC_INFO_TYPE_EH_FRAME_ENTRY.
532 (bfd_elf_final_link): Call _bfd_elf_fixup_eh_frame_hdr.
533 (_bfd_elf_gc_mark): Support Compact EH.
534 (bfd_elf_parse_eh_frame_entries): New function.
535 (bfd_elf_gc_sections): Support Compact EH.
536 (bfd_elf_discard_info): Likewise.
537 * elfxx-mips.c (_bfd_mips_elf_compact_eh_encoding): New function.
538 (_bfd_mips_elf_cant_unwind_opcode): New function.
539 * elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
540 (_bfd_mips_elf_cant_unwind_opcode): Declare.
541 (elf_backend_compact_eh_encoding): Define.
542 (elf_backend_cant_unwind_opcode): Define.
543 * elfxx-target.h (elf_backend_compact_eh_encoding):
544 Provide default definition.
545 (elf_backend_cant_unwind_opcode): Provide default definition.
546 * section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Define.
547>>>>>>> 2015-05-04 Catherine Moore <clm@codesourcery.com>
a27e685f 548
d5597ebc
L
5492015-04-22 H.J. Lu <hongjiu.lu@intel.com>
550
551 PR ld/18289
552 * elf32-i386.c (elf_i386_link_hash_entry): Add gotoff_ref.
553 (elf_i386_link_hash_newfunc): Initialize gotoff_ref to 0.
554 (elf_i386_create_dynamic_sections): Always allow copy relocs for
555 building executables.
556 (elf_i386_copy_indirect_symbol): Also copy gotoff_ref.
557 (elf_i386_check_relocs): Set gotoff_ref for R_386_GOTOFF.
558 (elf_i386_adjust_dynamic_symbol): Also allocate copy relocs for
559 PIE and R_386_GOTOFF.
560 (elf_i386_relocate_section): Allow R_386_GOTOFF in executable.
561
e9702963
L
5622015-04-20 H.J. Lu <hongjiu.lu@intel.com>
563
564 * elf.c (assign_section_numbers): Always set up sh_name.
565
e06efbf1
L
5662015-04-20 H.J. Lu <hongjiu.lu@intel.com>
567
568 * elf.c (assign_file_positions_for_non_load_sections): Iterate
569 sections by pointer.
570 (_bfd_elf_assign_file_positions_for_non_load): Likewise.
571
0ce398f1
L
5722015-04-14 H.J. Lu <hongjiu.lu@intel.com>
573
574 * bfd-in.h (compressed_debug_section_type): New.
575 * compress.c (bfd_compress_section_contents): Add an argument
576 for linker write compression and always generate .zdebug_*
577 section when linking.
578 (bfd_init_section_compress_status): Pass FALSE to
579 bfd_compress_section_contents.
580 (bfd_compress_section): New function.
581 * elf.c (elf_fake_sections): For linking, set SEC_ELF_COMPRESS
582 on DWARF debug sections if COMPRESS_DEBUG is set and rename
583 section if COMPRESS_DEBUG_GABI_ZLIB isn't set.
584 (assign_file_positions_for_non_load_sections): Set sh_offset
585 to -1 if SEC_ELF_COMPRESS is set.
586 (assign_file_positions_except_relocs): Likwise.
587 (_bfd_elf_assign_file_positions_for_relocs): Renamed to ...
588 (_bfd_elf_assign_file_positions_for_non_load): This. Change
589 return time to bfd_boolean. Compress the section if
590 SEC_ELF_COMPRESS is set.
591 (_bfd_elf_write_object_contents): Updated.
592 (_bfd_elf_set_section_contents): Write section contents to
593 the buffer if SEC_ELF_COMPRESS is set.
594 * merge.c: Include "elf-bfd.h".
595 (sec_merge_emit): Add arguments for contents and offset. Write
596 to contents with offset if contents isn't NULL.
597 (_bfd_write_merged_section): Write section contents to the
598 buffer if SEC_ELF_COMPRESS is set. Pass contents and
599 output_offset to sec_merge_emit.
600 * elflink.c (bfd_elf_final_link): Allocate the buffer for
601 output section contents if SEC_ELF_COMPRESS is set.
602 * section.c (SEC_ELF_COMPRESS): New.
603 * bfd-in2.h: Regenerated.
604
95b57ade
AM
6052015-04-15 Alan Modra <amodra@gmail.com>
606
607 * elf32-rl78.c (rl78_elf_relocate_section): Typo fix.
608
6ff71e76
NC
6092015-04-14 Nick Clifton <nickc@redhat.com>
610
611 * elf32-rl78.c (RL78_OP_REL): New macro.
612 (rl78_elf_howto_table): Use it for complex relocs.
613 (get_symbol_value): Handle the cases when the info or status
614 arguments are NULL.
615 (get_romstart): Cache the status returned by get_symbol_value.
616 (get_ramstart): Likewise.
617 (RL78_STACK_PUSH): Generate an error message if the stack
618 overflows.
619 (RL78_STACK_POP): Likewise for underflows.
620 (rl78_compute_complex_reloc): New function. Contains the basic
621 processing code for all RL78 complex relocs.
622 (rl78_special_reloc): New function. Provides special reloc
623 handling for complex relocs.
624 (rl78_elf_relocate_section): Use rl78_compute_complex_reloc.
625 (rl78_offset_for_reloc): Likewise.
626
889c2a67
L
6272015-04-14 H.J. Lu <hongjiu.lu@intel.com>
628
629 PR ld/pr17709
630 * elflink.c (_bfd_elf_adjust_dynamic_copy): Check
631 info->extern_protected_data when warning copy relocs against
632 protected symbols.
633 (_bfd_elf_symbol_refs_local_p): Check info->extern_protected_data
634 when checking protected non-function symbols.
635
97de3545
JB
6362015-04-13 John Baldwin <jhb@FreeBSD.org>
637
638 * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on
639 FreeBSD.
640 (elfcore_write_xstatereg): Use correct note name on FreeBSD.
641
f0bf6bfd
L
6422015-04-13 H.J. Lu <hongjiu.lu@intel.com>
643
644 PR ld/18250
645 * elflink.c (elf_link_is_defined_archive_symbol): Return FALSE
646 if the object has been claimed by plugin.
647
e3c0e327
L
6482015-04-11 H.J. Lu <hongjiu.lu@intel.com>
649
650 * elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
651 with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
652 protected data symbol when building shared library.
653 * elf64-x86-64.c (elf_x86_64_relocate_section): Check
654 R_X86_64_GOTOFF64 against undefined symbol and replace
655 SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL when checking
656 R_X86_64_GOTOFF64 against protected data symbol when building
657 shared library.
658
3d949995
L
6592015-04-10 H.J. Lu <hongjiu.lu@intel.com>
660
661 PR ld/pr17709
662 * elf32-i386.c (elf_i386_relocate_section): Also check R_386_GOTOFF
663 against protected data symbol when building shared library.
664 * elf64-x86-64.c (elf_x86_64_relocate_section): Also check
665 R_X86_64_GOTOFF64 against protected data symbol when building
666 shared library.
667
f7483970
L
6682015-04-10 H.J. Lu <hongjiu.lu@intel.com>
669
670 PR ld/pr15228
671 PR ld/pr17709
672 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
673 * elf32-i386.c (elf_backend_extern_protected_data): New.
674 Defined to 1.
675 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
676 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
677 copy relocs against protected symbols if extern_protected_data
678 is true.
679 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
680 non-function symbols if extern_protected_data is true.
681 * elfxx-target.h (elf_backend_extern_protected_data): New.
682 Default to 0.
683 (elfNN_bed): Initialize extern_protected_data with
684 elf_backend_extern_protected_data.
685
030aeb75
L
6862015-04-10 H.J. Lu <hongjiu.lu@intel.com>
687
688 * compress.c (bfd_compress_section_contents): Replace bfd_malloc
689 and free with bfd_alloc and bfd_release on compressed buffer.
690 Release buffer if compressed section isn't smaller.
691
d07a1b05
AM
6922015-04-10 Alan Modra <amodra@gmail.com>
693
694 PR ld/18222
695 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error
696 on adding a protected visibility variable to .dynbss.
697
8d2ea2a8
AM
6982015-04-10 Alan Modra <amodra@gmail.com>
699
700 Revert 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
701 PR ld/pr15228
702 PR ld/pr17709
703 * elf-bfd.h (elf_backend_data): Delete extern_protected_data.
704 * elf32-i386.c (elf_backend_extern_protected_data): Delete.
705 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
706 * elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
707 extern_protected_data test.
708 (_bfd_elf_symbol_refs_local_p): Likewise.
709 * elfxx-target.h (elf_backend_extern_protected_data): Delete.
710 (elfNN_bed): Delete elf_backend_extern_protected_data init.
711
18ece1de
L
7122015-04-09 H.J. Lu <hongjiu.lu@intel.com>
713
714 * compress.c (bfd_compress_section_contents): Update comments.
715 (bfd_init_section_decompress_status): Likewise.
716 (bfd_init_section_compress_status): Likewise.
717
cd6faa73
L
7182015-04-09 H.J. Lu <hongjiu.lu@intel.com>
719
720 * elfxx-target.h (TARGET_BIG_SYM): Add BFD_COMPRESS_GABI to
721 object_flags.
722 (TARGET_LITTLE_SYM): Likewise.
723
19424843
MF
7242015-04-09 Max Filippov <jcmvbkbc@gmail.com>
725
726 * elf32-xtensa.c (splay-tree.h): include header.
727 (text_action_struct): drop next pointer.
728 (text_action_list_struct): drop head pointer, add count and
729 tree fields.
730 (find_fill_action): instead of linear search in text_action_list
731 search in the tree.
732 (text_action_compare, action_first, action_next): new functions.
733 (text_action_add, text_action_add_literal): instead of linear
734 search and insertion insert new node into the tree.
735 (removed_by_actions): pass additional parameter: action_list,
736 use it to traverse the tree.
737 (offset_with_removed_text): pass additional action_list parameter
738 to removed_by_actions.
739 (map_action_fn_context): new typedef.
740 (map_action_fn_context_struct): new structure.
741 (map_action_fn): new function.
742 (map_removal_by_action): use splay_tree_foreach to build map.
743 (find_insn_action): replace linear search in text_action_list
744 with series of splay_tree_lookups.
745 (print_action, print_action_list_fn): new functions.
746 (print_action_list): use splay_tree_foreach.
747 (init_xtensa_relax_info): drop action_list.head initialization.
748 Initialize the tree.
749 (compute_text_actions): use non-zero action_list_count instead of
750 non-NULL action list.
751 (xlate_map_context): new typedef.
752 (xlate_map_context_struct): new structure.
753 (xlate_map_fn): new function.
754 (build_xlate_map): use splay_tree_foreach to build map.
755 (action_remove_bytes_fn): new function.
756 (relax_section): use zero action_list_count instead of NULL
757 action list. Use splay_tree_foreach to count final section size.
758 Drop unused variable 'removed'.
759
7602015-04-09 Max Filippov <jcmvbkbc@gmail.com>
761
762 * elf32-xtensa.c (removed_literal_map_entry): new typedef.
763 (removed_literal_map_entry_struct): new structure.
764 (removed_literal_list_struct): add new fields: n_map and map.
765 (map_removed_literal, removed_literal_compare): new functions.
766 (find_removed_literal): build index array for literals ordered
767 by VMA, use binary search to find removed literal.
768
7692015-04-09 Max Filippov <jcmvbkbc@gmail.com>
770
771 * elf32-xtensa.c (removal_by_action_entry_struct,
772 removal_by_action_map_struct): new structures.
773 (removal_by_action_entry, removal_by_action_map): new typedefs.
774 (text_action_list_struct): add new field: map.
775 (map_removal_by_action, removed_by_actions_map,
776 offset_with_removed_text_map): new functions.
777 (relax_section): replace offset_with_removed_text with
778 offset_with_removed_text_map.
779 (translate_reloc, relax_property_section, relax_section_symbols):
780 replace removed_by_actions with removed_by_actions_map.
781
7822015-04-09 Max Filippov <jcmvbkbc@gmail.com>
783
784 * elf32-xtensa.c (reloc_range_list, reloc_range_list_entry,
785 reloc_range): new typedef.
786 (reloc_range_list_struct, reloc_range_list_entry_struct,
787 reloc_range_struct): new structures.
788 (reloc_range_compare, build_reloc_ranges,
789 reloc_range_list_append, reloc_range_list_remove,
790 reloc_range_list_update_range, free_reloc_range_list): new
791 functions.
792 (compute_text_actions): precompute relocation opcodes before the
793 loop. Add relevant_relocs variable, initialize it before the
794 loop, pass it to the check_section_ebb_pcrels_fit.
795 (check_section_ebb_pcrels_fit): add new parameter:
796 relevant_relocs. Update address range in the relevant_relocs if
797 it's non-NULL and iterate only over relevant relocations.
798
3525236c
NC
7992015-04-09 Nick Clifton <nickc@redhat.com>
800
801 * elf32-rx.c (describe_flags): Report the settings of the string
802 insn using bits.
803 (rx_elf_merge_private_bfd_data): Handle merging of the string insn
804 using bits.
805
51509926
L
8062015-04-08 H.J. Lu <hongjiu.lu@intel.com>
807
808 * compress.c (bfd_compress_section_contents): Work around a GCC
809 uninitialized warning bug fixed in GCC 4.7.
810
151411f8
L
8112015-04-08 H.J. Lu <hongjiu.lu@intel.com>
812
813 * archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
814 bit.
815 * bfd.c (bfd::flags): Increase size to 18 bits.
816 (BFD_COMPRESS_GABI): New.
817 (BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
818 (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
819 (bfd_update_compression_header): New fuction.
820 (bfd_check_compression_header): Likewise.
821 (bfd_get_compression_header_size): Likewise.
822 (bfd_is_section_compressed_with_header): Likewise.
823 * compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
824 (bfd_compress_section_contents): Return the uncompressed size if
825 the full section contents is compressed successfully. Support
826 converting from/to .zdebug* sections.
827 (bfd_get_full_section_contents): Call
828 bfd_get_compression_header_size to get compression header size.
829 (bfd_is_section_compressed): Renamed to ...
830 (bfd_is_section_compressed_with_header): This. Add a pointer
831 argument to return compression header size.
832 (bfd_is_section_compressed): Use it.
833 (bfd_init_section_decompress_status): Call
834 bfd_get_compression_header_size to get compression header size.
835 Return FALSE if uncompressed section size is 0.
836 * elf.c (_bfd_elf_make_section_from_shdr): Support converting
837 from/to .zdebug* sections.
838 * bfd-in2.h: Regenerated.
839
87070c08
AM
8402015-04-07 Alan Modra <amodra@gmail.com>
841
842 * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
843 mapped to output .got section.
844
d3e454b9
AM
8452015-04-07 Alan Modra <amodra@gmail.com>
846
847 * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
848 and has_addr16_lo. Make has_sda_refs a bitfield.
849 (ppc_elf_check_relocs): Set new flags.
850 (ppc_elf_link_hash_table_create): Update default_params.
851 (ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
852 where we won't be making .dynbss entries or editing code. Set
853 params->pic_fixup when we'll edit code for protected var access.
854 (allocate_dynrelocs): Allocate got entry for edited code and
855 discard dyn_relocs.
856 (struct ppc_elf_relax_info): Add picfixup_size.
857 (ppc_elf_relax_section): Rename struct one_fixup to struct
858 one_branch_fixup. Rename fixups to branch_fixups. Size space for
859 pic fixups.
860 (ppc_elf_relocate_section): Edit non-PIC accessing protected
861 visibility variables to PIC. Don't emit dyn_relocs for code
862 we've edited.
863 * elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
864
ffa54770
NC
8652015-04-07 Nick Clifton <nickc@redhat.com>
866
867 * elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
868 local labels as local.
869
4aa90cc0
L
8702015-04-06 H.J. Lu <hongjiu.lu@intel.com>
871
872 * compress.c (get_uncompressed_size): Removed.
873 (bfd_compress_section_contents): Use bfd_putb64 to write
874 uncompressed section size.
875 (bfd_init_section_decompress_status): Replace
876 get_uncompressed_size with bfd_getb64.
877
68f5ff89
L
8782015-04-04 H.J. Lu <hongjiu.lu@intel.com>
879
880 * elf.c (_bfd_elf_init_private_section_data): Also preserve the
881 SHF_COMPRESSED bit if not decompress.
882
8bed4e0f
L
8832015-04-04 H.J. Lu <hongjiu.lu@intel.com>
884
885 * compress.c (get_uncompressed_size): New. Extracted from ...
886 (bfd_init_section_decompress_status): This. Use it.
887
15c7659f
AT
8882015-04-02 Andrew Turner <andrew@freebsd.org>
889
890 * config.bfd: Add aarch64-*-freebsd* target triple.
891
39f3de7c
L
8922015-04-02 H.J. Lu <hongjiu.lu@intel.com>
893
894 * configure: Regenerated.
895
4106101c
MS
8962015-04-01 Tejas Belagod <tejas.belagod@arm.com>
897 Marcus Shawcroft <marcus.shawcroft@arm.com>
898 Jiong Wang <jiong.wang@arm.com>
899
900 * bfd-in.h (bfd_elf64_aarch64_set_options)
901 (bfd_elf32_aarch64_set_options): Add parameter.
902 * bfd-in2.h: Regenerated.
903 * elfnn-aarch64.c (aarch64_erratum_843419_stub)
904 (_bfd_aarch64_adrp_p, _bfd_aarch64_erratum_843419_sequence_p)
905 (_bfd_aarch64_erratum_843419_stub_name)
906 (_bfd_aarch64_erratum_843419_fixup)
907 (_bfd_aarch64_erratum_843419_scan)
908 (_bfd_aarch64_erratum_843419_branch_to_stub)
909 (_bfd_aarch64_erratum_843419_p): Define.
910 (enum elf_aarch64_stub_type): Define
911 aarch64_stub_erratum_843419_veneer.
912 (struct elf_aarch64_stub_hash_entry): Define adrp_offset.
913 (struct elf_aarch64_link_hash_table): Define fix_erratum_843419
914 and fix_erratum_843419_adr.
915 (stub_hash_newfunc): Initialize adrp_offset;
916 (_bfd_aarch64_add_stub_entry_after): Define.
917 (aarch64_map_one_stub, aarch64_build_one_stub)
918 (aarch64_size_one_stub): Handle
919 aarch64_stub_erratum_843419_veneer.
920 (_bfd_aarch64_resize_stubs): Round stub section size.
921 (elfNN_aarch64_size_stubs): Add scan for 843419.
922 (bfd_elfNN_aarch64_set_options): Add parameter. Initialize
923 fix_erratum_843419 and fix_erratum_843419_adr.
924 (struct erratum_835769_branch_to_stub_data): Add info.
925 (elfNN_aarch64_write_section): Initialise info. Handle 843419.
926 (elfNN_aarch64_size_dynamic_sections): Handle 843419.
927 * elfxx-aarch64.c (_bfd_aarch64_decode_adrp_imm)
928 (_bfd_aarch64_sign_extend): Define.
929 (reencode_adr_imm): Remove static. Rename to:
930 (_bfd_aarch64_reencode_adr_imm): Define.
931 (_bfd_aarch64_elf_put_addend): Call _bfd_aarch64_reencode_adr_imm.
932 * elfxx-aarch64.h (AARCH64_ADR_OP, AARCH64_ADRP_OP)
933 (AARCH64_ADRP_OP_MASK, _bfd_aarch64_sign_extend)
934 (_bfd_aarch64_decode_adrp_imm, _bfd_aarch64_reencode_adr_imm):
935 Define.
936
afa59b79
L
9372015-04-01 H.J. Lu <hongjiu.lu@intel.com>
938
939 * configure: Regenerated.
940
6036f486
ES
9412015-03-31 Ed Schouten <ed@nuxi.nl>
942
943 * config.bfd (targ_defvec): Set to x86_64_elf64_cloudabi_vec
944 for x86_64-*-cloudabi*.
945 * configure.ac: Handle x86_64_elf64_cloudabi_vec.
946 * configure: Regenerated.
947 * elf64-x86-64.c (TARGET_LITTLE_SYM): Support x86_64-*-cloudabi*.
948 (TARGET_LITTLE_NAME): Likewise.
949 (ELF_OSABI): Likewise.
950 (elf64_bed): Likewise.
951 * targets.c (x86_64_elf64_cloudabi_vec): New.
952 (_bfd_target_vector): Add x86_64_elf64_cloudabi_vec.
953
9ae46699
L
9542015-03-31 H.J. Lu <hongjiu.lu@intel.com>
955
956 * configure.ac: Revert the AM_ZLIB change.
957 * Makefile.in: Regenerated.
958 * aclocal.m4: Likewise.
959 * configure: Likewise.
960 * doc/Makefile.in: Likewise.
961
bd53a53a
L
9622015-03-30 H.J. Lu <hongjiu.lu@intel.com>
963
964 PR ld/18169
965 * elf-bfd.h (elf_backend_data): Add get_reloc_section.
966 (_bfd_elf_get_reloc_section): New.
967 * elf.c (_bfd_elf_get_reloc_section): Likewise.
968 (assign_section_numbers): Call get_reloc_section to look up the
969 section the relocs apply.
970 * elfxx-target.h (elf_backend_get_reloc_section): Likewise.
971 (elfNN_bed): Initialize get_reloc_section with
972 elf_backend_get_reloc_section.
973
243340ad
L
9742015-03-29 H.J. Lu <hongjiu.lu@intel.com>
975
976 * Makefile.am (ZLIB): New.
977 (ZLIBINC): Likewise.
978 (AM_CFLAGS): Add $(ZLIBINC).
979 (libbfd_la_LIBADD): Add $(ZLIB).
980 * compress.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
981 (decompress_contents): Don't check HAVE_ZLIB_H.
243340ad
L
982 (bfd_compress_section_contents): Likewise.
983 (bfd_get_full_section_contents): Likewise.
984 (bfd_init_section_decompress_status): Likewise.
985 (bfd_init_section_compress_status): Likewise.
b51724e8 986 * configure.ac (AM_ZLIB): Removed.
243340ad
L
987 (zlibdir): New. AC_SUBST.
988 (zlibinc): Likewise.
989 Add --with-system-zlib.
990 * Makefile.in: Regenerated.
991 * acinclude.m4: Likewise.
992 * config.in: Likewise.
993 * configure: Likewise.
994 * doc/Makefile.in: Likewise.
995
b8417128
AM
9962015-03-27 Alan Modra <amodra@gmail.com>
997
998 PR ld/15228
999 PR ld/18167
1000 * elflink.c (elf_merge_st_other): Add "sec" parameter. Don't set
1001 protected_def when symbol section is read-only. Adjust all calls.
1002 * elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
1003
93ca8569
TB
10042015-03-26 Tejas Belagod <tejas.belagod@arm.com>
1005
1006 * elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic
1007 _bfd_final_link_relocate with aarch64_relocate.
1008
b19a8f85
L
10092015-03-26 H.J. Lu <hongjiu.lu@intel.com>
1010
1011 PR ld/18160
1012 * elflink.c (elf_gc_sweep): Skip if relocation is incompatible.
1013 (bfd_elf_gc_sections): Likewise.
1014
61865519
MS
10152015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
1016
1017 * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Adjust stub section
1018 size for initial branch.
1019 (elfNN_aarch64_build_stubs): Write initial branch.
1020 _bfd_aarch64_decode_(elfNN_aarch64_output_arch_local_syms): Write
1021 mapping symbol on initial branch.
1022
d9ced15d 10232015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
357d1523
MS
1024
1025 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan):
1026 Update erratum count.
1027
d422d1c4
SKS
10282015-03-25 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1029
1030 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on
1031 first matching debug section.
1032
8d001214
L
10332015-03-24 H.J. Lu <hongjiu.lu@intel.com>
1034
1035 PR gas/18087
1036 * compress.c (bfd_compress_section_contents): Don't write the
1037 zlib header and set contents as well as compress_status if
1038 compression didn't make the section smaller.
1039 (bfd_init_section_compress_status): Don't check compression
1040 size here.
1041
fc42baf3
NC
10422015-03-24 Nick Clifton <nickc@redhat.com>
1043
1044 PR binutils/17512
1045 * coffgen.c (coff_get_normalized_symtab): Fix test for out of
1046 range auxillary sections.
1047
fc6d53be
MS
10482015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
1049
1050 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor
1051 code into:
1052 (_bfd_aarch64_get_stub_for_link_section): Define.
1053
30068a6d
MS
10542015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
1055
1056 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
1057 update of section_group[].stub_sec.
1058
5421cc6e
MS
10592015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
1060
1061 * elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove.
1062 (erratum_835769_scan) Drop fix_table_size_p and fixes_p arguments.
1063 Delete fixes, fix_table_size and associated code. Call
1064 _bfd_aarch64_add_stub_entry_in_group. Rename to...
1065 (bfd_aarch64_erratum_835769_scan): Define.
1066 (elfNN_aarch64_size_stubs): Delete erratum_835769_fixes,
1067 erratum_835769_fix_table_size, i and associated code. Relocate
1068 call to _bfd_aarch64_erratum_835769_scan. Delete adhoc stub size
1069 correction. Delete construction of stub entry from
1070 erratum_835769_fixes array.
1071
e572930b
MS
10722015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
1073
1074 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Use
1075 _bfd_aarch64_add_stub_entry_in_group.
1076
8131c122
AM
10772015-03-24 Alan Modra <amodra@gmail.com>
1078
1079 * elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
1080 stubs, even those for undefined weak symbols. Otherwise, don't
1081 report relocation overflow on branches to undefined strong
1082 symbols. Fix memory leak.
1083 * elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
1084 overflow on branches to undefined strong symbols.
1085
c53ed7cf
KS
10862015-03-23 Keith Seitz <keiths@redhat.com>
1087
1088 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
1089 missing ';'.
1090
94a75bde
MS
10912015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1092
1093 * elfnn-aarch64.c (erratum_835769_scan): Factor stub name
1094 construction into...
1095 (_bfd_aarch64_erratum_835769_stub_name): Define.
1096
13f622ec
MS
10972015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1098
1099 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Factor out
1100 stub resize code into...
1101 (bfd_aarch64_resize_stubs): Define.
1102
66585675
MS
11032015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1104
1105 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor stub
1106 creation code into...
1107 (bfd_aarch64_create_stub_section): Define.
1108
ef857521
MS
11092015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1110
1111 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Rename
1112 from elf_aarch64_create_or_find_stub_sec.
1113 (_bfd_aarch64_add_stub_entry_in_group): Rename from
1114 elfNN_aarch64_add_stub. Call
1115 _bfd_aarch64_create_or_find_stub_sec.
1116 (elfNN_aarch64_size_stubs, elfNN_aarch64_size_stubs): Call
1117 _bfd_aarch64_add_stub_entry_in_group.
1118
2144188d
MS
11192015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1120
1121 * elfnn-aarch64.c (erratum_835769_scan) Add comment. Reverse
1122 sense of boolean return.
1123 (elfNN_aarch64_size_stubs): Adjust for above.
1124
4c77202d
MS
11252015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1126
1127 * elfnn-aarch64.c (elf_aarch64_create_or_find_stub_sec):
1128 Remove unused parameter.
1129 (elfNN_aarch64_size_stubs): Adjust for above.
1130
9b9971aa
MS
11312015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1132
1133 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Remove bfd_indx.
1134
e2cdef47
MS
11352015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1136
1137 * elfnn-aarch64.c (aarch64_erratum_835769_fixes)
1138 (num_aarch64_erratum_835769_fixes): Remove.
1139 (elfNN_aarch64_size_stubs): Remove assignments to above.
1140
3d14faea
MS
11412015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1142
23956543
MS
1143 * elfnn-aarch64.c (aarch64_mem_op_p): Update comment. Rename rtn
1144 to rt2.
3d14faea
MS
1145 (aarch64_erratum_seqeunce): Rename rtn to rt2.
1146
f872121a
MS
11472015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
1148
1149 * elfnn-aarch64.c (elfNN_aarch64_write_section): Adjust layout.
1150
1740ba0c
NC
11512015-03-19 Nick Clifton <nickc@redhat.com>
1152
1153 * elf32-rl78.c (rl78_cpu_name): New function. Prints the name of
1154 the RL78 core based upon the flags.
1155 (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
1156 flags.
1157 (rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
1158 (elf32_rl78_machine): Always return bfd_mach_rl78.
1159
e2575e05
NC
11602015-03-19 Nick Clifton <nickc@redhat.com>
1161
1162 PR 18078
1163 * compress.c (bfd_compress_section_contents): Do not define this
1164 function if it is not used.
1165
0b0732e1
L
11662015-03-18 H.J. Lu <hongjiu.lu@intel.com>
1167
1168 * compress.c (bfd_compress_section_contents): Make it static.
1169 * bfd/bfd-in2.h: Regenerated.
1170
27aaeda0
NC
11712015-03-18 Eric Youngdale <eyoungdale@ptc.com>
1172
1173 PR ld/16598
1174 * peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs
1175 suitable for the AMD64.
1176
273a4985
JT
11772015-03-18 Jon Turney <jon.turney@dronecode.org.uk>
1178 Nick Clifton <nickc@redhat.com>
1179
1180 PR binutils/18087
1181 * coffgen.c (make_a_section_from_file): Only prepend a z to a
1182 debug section's name if the section was actually compressed.
1183 * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
1184 * compress.c (bfd_init_section_compress_status): Do not compress
1185 the section if doing so would make it bigger. In such cases leave
1186 the section alone and return COMPRESS_SECTION_NONE.
1187
c4b0b099
AM
11882015-03-17 Alan Modra <amodra@gmail.com>
1189
1190 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0
1191 on nothing to do, before malloc of returned symbol array.
1192
9c761a55
NC
11932015-03-16 Nick Clifton <nickc@redhat.com>
1194
1195 * elf32-rx.c (elf32_rx_relax_delete_bytes): If the relocs are not
1196 stored in the elf_section_data structure then load them as
1197 necessary.
1198
b9005ba7
AK
11992015-03-14 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1200
1201 * elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
1202 relocs against code sections.
1203 * elf32-s390.c: Define elf_backend_sort_relocs_p.
1204 * elf64-s390.c: Likewise.
1205
1079403c
AM
12062015-03-11 Alan Modra <amodra@gmail.com>
1207
1208 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
1209 reverse order. Account for larger size of __tls_get_addr_opt stub.
1210
a5721edd
JW
12112015-03-10 Yuri Gribov <y.gribov@samsung.arm>
1212
1213 PR ld/16572
1214 * elf32-arm.c (elf32_arm_final_link_relocate): Remove support for
1215 ELF_ARM_HASENTRY.
1216 (elf32_arm_print_private_bfd_data): Likewise.
1217
65164438
NC
12182015-03-06 Nick Clifton <nickc@redhat.com>
1219
1220 PR binutils/17765
1221 * elflink.c (put_value): Like previous delta, but for the 32-bit
1222 case.
1223
41cd1ad1
NC
12242015-03-05 Nick Clifton <nickc@redhat.com>
1225
1226 PR binutils/17765
1227 * elflink.c (put_value): Avoid using an undefined shift
1228 operation.
1229
ca3fe95e
L
12302015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1231
1232 PR ld/pr15228
1233 PR ld/pr17709
1234 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
1235 * elf32-i386.c (elf_backend_extern_protected_data): New.
1236 Defined to 1.
1237 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
1238 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
1239 copy relocs against protected symbols if extern_protected_data
1240 is true.
1241 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
1242 non-function symbols if extern_protected_data is true.
1243 * elfxx-target.h (elf_backend_extern_protected_data): New.
1244 Default to 0.
1245 (elfNN_bed): Initialize extern_protected_data with
1246 elf_backend_extern_protected_data.
1247
425bd9e1
NC
12482015-03-05 Nick Clifton <nickc@redhat.com>
1249
1250 PR binutils/18025
1251 * coffgen.c (coff_find_nearest_line_with_names): If the dwarf2
1252 lookup fails, check for an address bias in the dwarf info, and if
1253 one exists, retry the lookup with the biased value.
1254 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): New function.
1255 Determines if a bias exists bewteen the addresses of functions
1256 based on DWARF information vs symbol table information.
1257 * libbfd-in.h (_bfd_dwarf2_find_symbol_bias): Prototype.
1258 * libbfd.h: Regenerate.
1259
8ef229f3
MS
12602015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
1261
1262 * elfxx-aarch64.c (decode_add_imm, decode_movw_imm)
1263 (decode_tst_branch_ofs_14, decode_ld_lit_ofs_19)
1264 (decode_cond_branch_ofs_19, decode_branch_ofs_26): Remove.
1265
8e2fe09f
MS
12662015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
1267
1268 * elfnn-aarch64.c (aarch64_build_one_stub): Call abort.
1269 (aarch64_size_one_stub): Likewise.
1270 (aarch64_map_one_stub): Likewise.
1271
df88b702
AA
12722015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
1273
1274 * cpu-s390.c (N): New macro.
1275 (bfd_s390_31_arch): New. Define only if default target word size
1276 is 64 bits. Otherwise define...
1277 (bfd_390_64_arch): ...this. Make static.
1278 (bfd_s390_arch): Define according to the default target word size.
1279 Let the 'next' field point to the alternate arch.
1280
e09ab7ac
RS
12812015-03-04 Richard Sandiford <richard.sandiford@arm.com>
1282
1283 PR gas/17843
1284 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
1285 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
1286 to be used with MOVK rather than MOVZ.
1287
71eef2bd
DD
12882015-03-03 DJ Delorie <dj@redhat.com>
1289
1290 * elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
1291 there's a symbol.
1292
f01f1741
AM
12932015-02-28 Alan Modra <amodra@gmail.com>
1294
1295 * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
1296 not PLT_NEW.
1297
c1d11331
L
12982015-02-27 H.J. Lu <hongjiu.lu@intel.com>
1299
1300 * elf32-i386.c (need_convert_mov_to_lea): New.
1301 (elf_i386_check_relocs): Set need_convert_mov_to_lea if needed.
1302 (elf_i386_convert_mov_to_lea): Return TRUE if
1303 need_convert_mov_to_lea is unset.
1304 * elf64-x86-64.c (need_convert_mov_to_lea): New.
1305 (elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed.
1306 (elf_x86_64_convert_mov_to_lea): Return TRUE if
1307 need_convert_mov_to_lea is unset.
1308
cdb602b1
NC
13092015-02-27 Nick Clifton <nickc@redhat.com>
1310
1311 PR binutils/17910
1312 * coffgen.c (_bfd_coff_internal_syment_name): Only check for
1313 string length overflow when the string table length is actually
1314 set.
1315
96c20bc1
MS
13162015-02-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
1317
1318 * bfd/bfd-in2.h: Regenerate.
1319 * bfd/libbfd.h: Regenerate.
1320
1ada945d
MS
13212015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1322
1323 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix
1324 TLSDESC_LD_PREL19 field width and masks.
1325 (aarch64_tls_transition_without_check)
1326 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
1327 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
1328 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
1329 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19.
1330 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1331 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1332
389b8029
MS
13332015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1334
73920eed
MS
1335 * elfnn-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Reorder R_TYPE
1336 tests.
389b8029
MS
1337 (aarch64_tls_transition_without_check)
1338 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
1339 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
1340 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
1341 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21.
1342 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1343 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1344 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
1345
3c12b054
MS
13462015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1347
1348 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC)
1349 (elfNN_aarch64_howto_table, aarch64_tls_transition_without_check)
1350 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
1351 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
1352 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
1353 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21.
1354 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1355 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1356 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
1357
043bf05a
MS
13582015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1359
1360 * elfnn-aarch64.c: (TLSIE_LD_GOTTREL_PREL19): Fix HOWTO bit field width.
1361 (aarch64_tls_transition_without_check, aarch64_reloc_got_type)
1362 (elfNN_aarch64_final_link_relocate, elfNN_aarch64_tls_relax)
1363 (elfNN_aarch64_relocate_section, elfNN_aarch64_gc_sweep_hook)
1364 (elfNN_aarch64_check_relocs): Handle
1365 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19.
1366
1367 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
1368 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1369
7366006f
MS
13702015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1371
1372 * elfnn-aarch64.c: (TLSDESC_CALL): Fix HOWTO bit field width.
1373
07875fbc
MS
13742015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1375
1376 * elfnn-aarch64.c (TLSLE_MOVW_TPREL_G2)
1377 (TLSLE_MOVW_TPREL_G1, TLSLE_MOVW_TPREL_G1_NC)
1378 (TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC): Fix bit field
1379 width.
1380
49d8f92c
MS
13812015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
1382
1383 * elfnn-aarch64.c: (TLSIE_MOVW_GOTTPREL_G0_NC): Fix HOWTO bit
1384 field width.
1385
c86934ce
NC
13862015-02-26 Nick Clifton <nickc@redhat.com>
1387
1388 PR binutils/17512
1389 * coffcode.h (coff_compute_section_file_positions): Report
1390 negative page sizes.
1391 * elf.c (elf_fake_sections): Handle excessive alignmment powers.
1392 (assign_file_positions_for_non_load_sections): Replace assertion
1393 with an error message.
1394 (rewrite_elf_program_header): Handle excessive segment
1395 alignments.
1396 * mach-o.c (bfd_mach_o_read_section_32): Likewise.
1397 (bfd_mach_o_read_section_64): Likewise.
1398 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Use %B to
1399 print a bfd name, not %A.
1400
bd4d2eaa
AM
14012015-02-26 Alan Modra <amodra@gmail.com>
1402
1403 * elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
1404 thread-safe stubs for iplt.
1405 (build_tls_get_addr_stub): Restore r2 immediately after call.
1406
99654aaf
TG
14072015-02-26 Terry Guo <terry.guo@arm.com>
1408
1409 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Update how we
1410 merge Tag_ABI_HardFP_use.
1411
a127494f
AM
14122015-02-26 Alan Modra <amodra@gmail.com>
1413
1414 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Heed -z nocopyreloc.
1415 Use text relocs rather than giving an error on trying to use
1416 .dynbss for protected shared lib vars.
1417 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
1418
bac13f5a
AB
14192015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
1420
1421 * elf32-avr.c (struct elf_avr_section_data): New structure.
1422 (struct avr_relax_info): New structure.
1423 (elf_avr_new_section_hook): New function.
1424 (struct elf_avr_section_data): Add relax_info.
1425 (get_avr_relax_info): New function.
1426 (init_avr_relax_info): New function.
1427 (elf32_avr_relax_delete_bytes): Find next property record before
1428 deleting bytes. When deleting don't move bytes beyond the next
1429 property record.
1430 (avr_elf32_assign_records_to_section): New function.
1431 (avr_property_record_compare): New function.
1432 (avr_load_all_property_sections): New function.
1433 (elf32_avr_relax_section): Load property data. After relaxing the
1434 section, move any .align directives that have enough deleted bytes
1435 before them.
1436 (bfd_elf32_new_section_hook): Define.
1437
137c83d6
AB
14382015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
1439
1440 * elf32-avr.h (struct avr_property_header): New strucure.
1441 (avr_elf32_load_property_records): Declare.
1442 (avr_elf32_property_record_name): Declare.
1443 * elf32-avr.c: Add bfd_stdint.h include.
1444 (retrieve_local_syms): New function.
1445 (get_elf_r_symndx_section): New function.
1446 (get_elf_r_symndx_offset): New function.
1447 (internal_reloc_compare): New function.
1448 (struct avr_find_section_data): New structure.
1449 (avr_is_section_for_address): New function.
1450 (avr_find_section_for_address): New function.
1451 (avr_elf32_load_records_from_section): New function.
1452 (avr_elf32_load_property_records): New function.
1453 (avr_elf32_property_record_name): New function.
1454
fdd410ac
AB
14552015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
1456
1457 * elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
1458 (AVR_PROPERTY_RECORDS_VERSION): Define.
1459 (AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
1460 (struct avr_property_record): New structure.
1461
685080f2
NC
14622015-02-24 Nick Clifton <nickc@redhat.com>
1463
1464 * elf32-v850.c (v850_set_note): New function. Creates a Renesas
1465 style note entry.
1466 (v850_elf_make_note_section): New function. Creates a note
1467 section.
1468 (v850_elf_create_sections): New function. Create a note section
1469 if one is not already present.
1470 (v850_elf_set_note): New function. Adds a note to a bfd.
1471 (v850_elf_copy_private_bfd_data): New function. Copies V850
1472 notes.
1473 (v850_elf_merge_notes): New function. Merges V850 notes.
1474 (print_v850_note): New function. Displays a V850 note.
1475 (v850_elf_print_notes): New function. Displays all notes attached
1476 to a bfd.
1477 (v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
1478 (v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
1479 (v850_elf_fake_sections): Set the type of the V850 note section.
1480 * bfd-in.h (v850_elf_create_sections): Add prototype.
1481 (v850_elf_set_note): Add prototype.
1482 * bfd-in2.h: Regenerate.
1483
31593e1b
NC
14842015-02-24 Nick Clifton <nickc@redhat.com>
1485
1486 * configure.ac (AC_CHECK_HEADERS): Add wctype.h.
1487 * configure: Regenerate.
1488 * config.in: Regenerate.
1489 * peXXigen.c: Include wctype.h if HAVE_WCTYPE_H is defined.
1490 (u16_mbtowc): Use wint_t types if HAVE_WCTYPE_H is defined.
1491 (rsrc_cmp): Use towlower instead of wcsncasecmp if HAVE_WCTYPE_H
1492 is defined.
1493
3ad797fd
NC
14942015-02-24 Nick Clifton <nickc@redhat.com>
1495
1496 * pdp11.c (set_section_contents): Pad the .text and .data sections
1497 to their aligned sizes.
1498
5518c738
YS
14992015-02-23 Yoshinori Sato <ysato@users.sourceforge.jp>
1500
1501 * config.bfd: Add h8300-*-linux.
1502 * configure.ac: Add h8300_elf32_linux_vec.
1503 * configure: Regenerate.
1504 * elf32-h8300.c: Likewise.
1505 * targets.c(_bfd_target_vector): Likewise.
1506
cb967f0d
NC
15072015-02-23 Nick Clifton <nickc@redhat.com>
1508
1509 PR 17914
1510 * cpu-w65.c: Correct typos in license notice.
1511
0f8f0c57
NC
1512 PR 17940
1513 * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug
1514 symbols at end of sections. Adjust function sizes.
1515
4ef9f41a
AA
15162015-02-20 Andreas Arnez <arnez@linux.vnet.ibm.com>
1517
1518 * elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
1519 (elfcore_write_s390_vxrs_high): Likewise.
1520 * elf.c (elfcore_grok_s390_vxrs_low): New function.
1521 (elfcore_grok_s390_vxrs_high): New function.
1522 (elfcore_grok_note): Call them.
1523 (elfcore_write_s390_vxrs_low): New function.
1524 (elfcore_write_s390_vxrs_high): New function.
1525 (elfcore_write_register_note): Call them.
1526
837914ee
BD
15272015-02-19 Branko Drevensek <branko.drevensek@gmail.com>
1528
1529 PR 17995
1530 * verilog.c (verilog_write_record): Correct buffer size.
1531
cf18fda4
AM
15322015-02-19 Alan Modra <amodra@gmail.com>
1533
1534 * elflink.c (_bfd_elf_define_linkage_sym): Set 'bed' earlier.
1535
d983c8c5
AM
15362015-02-19 Alan Modra <amodra@gmail.com>
1537
1538 PR ld/4317
1539 * elflink.c (elf_link_input_bfd): Drop undefined local syms.
1540 (elf_link_output_extsym): Drop local and global undefined syms.
1541 Tidy. Expand comment.
1542
2ec55de3
AM
15432015-02-17 Alan Modra <amodra@gmail.com>
1544
1545 PR ld/17975
1546 * elflink.c (struct elf_outext_info): Remove need_second_pass
1547 and second_pass.
1548 (elf_link_output_extsym): Delete code handling second forced
1549 local pass. Move code emitting NULL STT_FILE symbol later, so
1550 that it can be omitted if forced local is stripped. Don't
1551 emit the NULL STT_FILE if no file symbols have been output.
1552 (bfd_elf_final_link): Remove second forced local pass.
1553 * elf32-ppc.c (add_stub_sym): Set linker_def on linker syms.
1554 (ppc_elf_size_dynamic_sections): Likewise.
1555 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1556 (build_global_entry_stubs): Likewise.
1557 (ppc64_elf_build_stubs): Likewise.
1558
6dfb72b9
L
15592015-02-16 H.J. Lu <hongjiu.lu@intel.com>
1560
1561 PR ld/17975
1562 * elflink.c (elf_link_output_extsym): Only check filesym_count
1563 when outputting a NULL FILE symbol. Set second_pass_sym to
1564 h->forced_local && !h->root.linker_def.
1565
576fa883
L
15662015-02-15 H.J. Lu <hongjiu.lu@intel.com>
1567
1568 * elf32-i386.c (elf_i386_always_size_sections): Set root.linker_def
1569 on _TLS_MODULE_BASE_.
1570 * elf64-x86-64.c (elf_x86_64_always_size_sections): Likewise.
1571
62f8d217
AM
15722015-02-15 Alan Modra <amodra@gmail.com>
1573
1574 * dwarf2.c (read_rangelist): Correct buffer overflow check
1575 Whitespace throughout file.
1576
ce875075
AM
15772015-02-14 Alan Modra <amodra@gmail.com>
1578
1579 PR ld/17973
1580 * bfd.c (struct bfd): Add lto_output.
1581 * linker.c (_bfd_handle_already_linked): Explicitly test for
1582 objects added by the lto plugin.
1583 * opncls.c (_bfd_new_bfd_contained_in): Copy lto_output and
1584 no_export flags from archive.
1585 * archive.c (open_nested_file): New function, setting lto_output
1586 and no_export, extracted from..
1587 (find_nested_archive): ..here. Flip params. Rename from
1588 _bfd_find_nested_archive.
1589 (_bfd_get_elt_at_filepos): Correct var typo. Use open_nested_file.
1590 (_bfd_look_for_bfd_in_cache): Copy no_export.
1591 * elflink.c (elf_link_add_object_symbols): Remove now unnecessary
1592 my_archive->no_export test.
1593 (elf_link_input_bfd): Drop existing lto_output STT_FILE syms.
1594 Don't use the file name when adding lto_output STT_FILE sym.
1595 * bfd-in2.h: Regenerate.
1596
451dfd38
AM
15972015-02-13 Alan Modra <amodra@gmail.com>
1598
1599 PR binutils/17512
1600 * elf64-ppc.c (opd_entry_value): Tighten offset check. Remove
1601 now redundant assert.
1602
dbb3fbbb
NC
16032015-02-12 Nick Clifton <nickc@redhat.com>
1604
1605 PR binutils/17512
1606 * dwarf.c (read_1_byte, read_1_signed_byte, read_2_bytes)
1607 (read_4_bytes, read_8_bytes, read_n_bytes, read_string)
1608 (read_indirect_string, read_alt_indirect_string)
1609 (read_alt_indirect_ref, read_address, read_abbrevs)
1610 (read_attribute_value, read_attribute, decode_line_info)
1611 (find_abstract_instance_name, read_rangelist)
1612 (scan_unit_for_symbols, parse_comp_unit)
1613 (_bfd_dwarf2_find_nearest_line): Harden DWARF reading code. Pass
1614 end pointers to reading functions and check for offsets taking
1615 pointers out of range. Replace calls to read_*_leb128 with calls
1616 to safe_read_leb128.
1617
1618 (* elf64-ppc.c (opd_entry_value): Add a check for an overlarge
1619 offset.
1620 * syms.c (_bfd_stab_section_find_nearest_line): Add checks for
1621 computed file_name address being before the start of the string
1622 table.
1623
b9dc5a87
L
16242015-02-11 H.J. Lu <hongjiu.lu@intel.com>
1625
1626 PR ld/17878
1627 * bfd.c (bfd_plugin_format): New.
1628 (bfd): Add plugin_format and plugin_dummy_bfd.
1629 * plugin.c (try_load_plugin): Take a pointer to bfd_boolean
1630 argument to return TRUE if any plugin is found. Set plugin_format.
1631 (has_plugin): New.
1632 (bfd_plugin_target_p): New.
1633 (bfd_plugin_specified_p): Likewise.
1634 (bfd_plugin_target_p): Likewise.
1635 (register_ld_plugin_object_p): Likewise.
1636 (bfd_plugin_set_plugin): Set has_plugin.
1637 (load_plugin): Cache try_load_plugin result.
1638 (bfd_plugin_object_p): Try ld_plugin_object_p first. Check
1639 plugin_format.
1640 * plugin.h (bfd_plugin_target_p): New.
1641 (bfd_plugin_specified_p): Likewise.
1642 (register_ld_plugin_object_p): Likewise.
1643 * bfd-in2.h: Regenerated.
1644
55172d69
PA
16452015-02-11 Pedro Alves <palves@redhat.com>
1646
1647 * libbfd-in.h [__cplusplus]: Open extern "C" scope.
1648 * libcoff-in.h [__cplusplus]: Open extern "C" scope.
1649 * libbfd.h: Regenerate.
1650 * libcoff.h: Regenerate.
1651
1652 * elf-bfd.h [__cplusplus]: Wrap in extern "C".
1653 * mach-o.h [__cplusplus]: Wrap in extern "C".
1654 * som.h [__cplusplus]: Wrap in extern "C".
1655
77ef8654
NC
16562015-02-10 Nick Clifton <nickc@redhat.com>
1657
1658 PR binutils/17512
1659 * coffcode.h (styp_to_sec_flags): Use an unsigned long type to
1660 hold the flag bits.
1661 * peXXigen.c (pe_print_reloc): Use unsigned types to hold the
1662 size and number of relocs.
1663 (pe_print_debugdata): Use a 32-bit aligned buffer to store the
1664 codeview record.
1665 * versados.c (process_otr): Check the esdid value before using it
1666 to access the EDATA.
1667
35181b3e
EM
16682015-02-09 Ed Maste <emaste@freebsd.org>
1669
1670 * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing
1671 uninitialized and unused variable.
1672 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
1673
989f9879
AM
16742015-02-09 Alan Modra <amodra@gmail.com>
1675
1676 * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
1677 tls_sec.
1678 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1679 * elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.
1680
ca4be51c
AM
16812015-02-09 Alan Modra <amodra@gmail.com>
1682
1683 * elflink.c: Whitespace, formatting fixes.
1684 (elf_link_input_bfd): Clarify comment.
1685 (elf_link_output_extsym): Exclude symbols in linker created
1686 sections when testing for plugin symbols.
1687
1952c5cd
L
16882015-02-07 H.J. Lu <hongjiu.lu@intel.com>
1689
1690 PR ld/17935
1691 * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a
1692 warning for relocation in readonly section for -z text.
1693 (elf_i386_size_dynamic_sections): Likewise.
1694 * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
1695 (elf_x86_64_size_dynamic_sections): Likewise.
1696
9e2dec47
L
16972015-02-06 H.J. Lu <hongjiu.lu@intel.com>
1698
1699 PR ld/12365
1700 PR ld/14272
1701 * elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change.
1702 (elf_link_input_bfd): Mark the plugin symbol undefined if it is
1703 referenced from a non-IR file.
1704
5929c344
NC
17052015-02-06 Nick Clifton <nickc@redhat.com>
1706
1707 PR binutils/17512
1708 * peXXigen.c (rsrc_print_resource_entries): Add range check for
1709 addresses that wrap around the address space.
1710 (rsrc_parse_entry): Likewise.
1711
60f79275
L
17122015-02-03 H.J. Lu <hongjiu.lu@intel.com>
1713
1714 PR ld/12365
1715 PR ld/14272
1716 * elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol
1717 undefined if it is referenced from a non-IR file.
1718
64d29018
NC
17192015-02-03 Nick Clifton <nickc@redhat.com>
1720
1721 PR binutils/17512
1722 * ecoff.c: Use bfd_alloc2 to allocate space for structure arrays.
1723 (_bfd_ecoff_slurp_symbol_table): Check for a negative symbol
1724 index or an out of range fdr index.
1725 * elf-m10300.c (mn10300_info_to_howto): Fix typo in error message.
1726 * elf32-arc.c (arc_info_to_howto_rel): Likewise.
1727 * elf32-avr.c (avr_info_to_howto_rela): Likewise.
1728 * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
1729 * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
1730 * elf32-cris.c (cris_info_to_howto_rela): Likewise.
1731 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
1732 * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
1733 * elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
1734 * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
1735 * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
1736 * elf32-frv.c (frv_info_to_howto_rela): Likewise.
1737 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
1738 * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
1739 * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
1740 * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
1741 * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
1742 * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
1743 * elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
1744 * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
1745 * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
1746 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
1747 * elf32-mep.c (mep_info_to_howto_rela): Likewise.
1748 * elf32-metag.c (metag_info_to_howto_rela): Likewise.
1749 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
1750 * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
1751 * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
1752 * elf32-mt.c (mt_info_to_howto_rela): Likewise.
1753 * elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
1754 * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
1755 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
1756 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
1757 * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
1758 * elf32-rx.c (rx_info_to_howto_rela): Likewise.
1759 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
1760 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
1761 * elf32-v850.c (v850_elf_perform_relocation): Likewise.
1762 * elf32-vax.c (rtype_to_howto): Likewise.
1763 * elf32-visium.c (visium_info_to_howto_rela): Likewise.
1764 * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
1765 * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
1766 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
1767 * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
1768 * mach-o.c: Use bfd_alloc2 to allocate space for structure arrays.
1769 (bfd_mach_o_canonicalize_one_reloc): Fix check on out
1770 of range symbol indicies.
1771 (bfd_mach_o_canonicalize_relocs): Check for out of range alloc.
1772 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise.
1773 (bfd_mach_o_build_dysymtab): Likewise.
1774 (bfd_mach_o_write_symtab_content): Set the string table size to
1775 zero upon error.
1776 (bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the
1777 read fails.
1778 * peXXigen.c (pe_print_edata): Check for numeric overflow in edt
1779 fields.
1780 * tekhex.c (first_phase): Check for src pointer reaching end of
1781 buffer.
1782
3a635617
WN
17832015-02-03 Will Newton <will.newton@linaro.org>
1784
46b87d49
WN
1785 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
1786 Set st_value to zero for undefined symbols if the reference
1787 is weak or pointer_equality_needed is FALSE.
1788
3a635617
WN
1789 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
1790 comment discussing why we clear st_value for some symbols.
1791
0c4bd9d9
KLC
17922015-02-02 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1793
1794 * elf32-nds32.c (nds32_get_section_contents): Add one more argument.
1795 (nds32_elf_relocate_section): Do not relocate R_NDS32_LONGJUMP7.
1796
b86ac8e3
AM
17972015-01-29 Alan Modra <amodra@gmail.com>
1798
1799 * elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
1800 optimization. Tidy mask for GOT_TLSGD optimization.
1801 * elf32-ppc.c (ppc_elf_relocate_section): Likewise. Correct
1802 location of nop zapping high insn too.
1803
dbd1e97e
AM
18042015-01-28 Alan Modra <amodra@gmail.com>
1805
1806 * elf64-ppc.h (struct ppc64_elf_params): Add "object_in_toc".
1807 * elf64-ppc.c (ppc64_elf_add_symbol_hook): Assume that global symbols
1808 in .toc indicate xlc compiled code that might require a rw .toc.
1809
3f8107ab
AM
18102015-01-28 James Bowman <james.bowman@ftdichip.com>
1811
1812 * Makefile.am: Add FT32 files.
1813 * archures.c (enum bfd_architecture): Add bfd_arch_ft32.
1814 (bfd_mach_ft32): Define.
1815 (bfd_ft32_arch): Declare.
1816 (bfd_archures_list): Add bfd_ft32_arch.
1817 * config.bfd: Handle FT32.
1818 * configure.ac: Likewise.
1819 * cpu-ft32.c: New file.
1820 * elf32-ft32.c: New file.
1821 * reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
1822 BFD_RELOC_FT32_18): Define.
1823 * targets.c (_bfd_target_vector): Add ft32_elf32_vec.
1824 * bfd-in2.h: Regenerate.
1825 * libbfd.h: Regenerate.
1826 * Makefile.in: Regenerate.
1827 * configure: Regenerate.
1828 * po/SRC-POTFILES.in: Regenerate.
1829
37e3922e
NC
18302015-01-27 Nick Clifton <nickc@redhat.com>
1831
1832 PR binutils/17512
1833 * pdp11.c (aout_get_external_symbols): Return false if there are
1834 no symbols.
1835
877a8638
NC
1836 * dwarf2.c (concat_filename): Check for an empty directory table.
1837 (scan_unit_for_symbols): Check for reading off the end of the
1838 unit.
1839 (parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
1840 non-string form.
1841 * elf64-ppc.c (opd_entry_value): Fail if there are no relocs
1842 available.
1843
18393a2e
KLC
18442015-01-26 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1845
1846 * elf32-nds32.c (nds32_elf_pick_relax): Fix again setting.
1847
055173ca
DD
18482015-01-22 DJ Delorie <dj@redhat.com>
1849
1850 * elf32-m32c.c (m32c_apply_reloc_24): New.
1851 (m32c_elf_howto_table): Use it for R_M32C_24.
1852 (m32c_elf_relocate_section): Handle R_M32C_24 specially.
1853
4e5cb37e
NC
18542015-01-22 Nick Clifton <nickc@redhat.com>
1855
1856 PR binutils/17512
1857 * coffcode.h (handle_COMDAT): When searching for the section
1858 symbol, make sure that there is space left in the symbol table.
1859 * vms-alpha.c (_bfd_vms_slurp_ehdr): Add range checks.
1860
86eafac0
NC
18612015-01-21 Nick Clifton <nickc@redhat.com>
1862
1863 PR binutils/17512
1864 * coffcode.h (coff_set_arch_mach_hook): Check return value from
1865 bfd_malloc.
1866 (coff_slurp_line_table): Return FALSE if the line number
1867 information was corrupt.
1868 (coff_slurp_symbol_table): Return FALSE if the symbol information
1869 was corrupt.
1870 * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
1871 initialise the fields of the dyld_info structure.
1872 (bfd_mach_o_build_exec_seg_command): Replace assertion with an
1873 error message and a return value.
1874 (bfd_mach_o_layout_commands): Change the function to boolean.
1875 Return FALSE if the function fails.
1876 (bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
1877 fails.
1878 (bfd_mach_o_read_command): Fail if an unrecognised command is
1879 encountered.
1880 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
1881 read fails.
1882 (slurp_symtab): Check the return from bfd_malloc.
1883 (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
1884 encountered an error.
1885 (_bfd_XXi_final_link_postscript): Fail if a section could not be
1886 copied.
1887 * peicode.h (pe_bfd_object_p): Fail if the header could not be
1888 swapped in.
1889 * tekhex.c (first_phase): Fail if the section is too big.
1890 * versados.c (struct esdid): Add content_size field.
1891 (process_otr): Use and check the new field.
1892 (versados_get_section_contents): Check that the section exists and
1893 that the requested data is available.
1894
03d5b773
CLT
18952015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
1896
1897 * elf32-nios2.c (elf_backend_default_execstack): Define as 0.
1898
1c9177d9
AM
18992015-01-20 Alan Modra <amodra@gmail.com>
1900
1901 PR ld/17615
1902 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
1903 ELF_COMMON_DEF syms.
1904
c4621b33
AM
19052015-01-19 Alan Modra <amodra@gmail.com>
1906
3e2aa5bb 1907 PR ld/17615
c4621b33
AM
1908 * elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
1909 linker script assignments too.
1910 * elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
1911 (bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
1912
0ba38529
AM
19132015-01-19 Alan Modra <amodra@gmail.com>
1914
1915 * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Correct loop iteration
1916 to allow return of first howto.
1917 * elf32-fr30.c (fr30_reloc_type_lookup): Likewise.
1918 * elf32-m32c.c (m32c_reloc_type_lookup): Likewise.
1919 * elf32-moxie.c (moxie_reloc_type_lookup): Likewise.
1920 * elf32-or1k.c (or1k_reloc_type_lookup): Likewise.
1921 * elf32-rl78.c (rl78_reloc_type_lookup): Likewise.
1922 * elf32-rx.c (rx_reloc_type_lookup): Likewise.
1923 * elf32-tilepro.c (tilepro_reloc_type_lookup): Likewise.
1924 * elf32-xstormy16.c (xstormy16_reloc_type_lookup): Likewise.
1925 * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
1926 * elf32-nios2.c (nios2_reloc_map): Add mapping for R_NIOS2_NONE.
1927 * elf32-spu.c (spu_elf_bfd_to_reloc_type): Allow return of R_SPU_NONE.
1928 (spu_elf_reloc_type_lookup): Adjust to suit.
1929
6346d5ca
AM
19302015-01-19 Alan Modra <amodra@gmail.com>
1931
1932 * bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
1933 (bfd_get_section_limit): ..here.
1934 * reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
1935 (bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
1936 * elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
1937 * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
1938 bfd_reloc_outofrange check.
1939 * bfd-in2.h: Regenerate.
1940
1941 * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
1942 on zero size relocs.
1943 * ecoff.c (ecoff_reloc_link_order): Likewise.
1944 * elf32-nds32.c (nds32_relocate_contents): Likewise.
1945 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1946
1947 * reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
1948 (_bfd_clear_contents): Likewise.
1949 * elfxx-mips.c (mips_elf_obtain_contents): Likewise.
1950 (mips_elf_perform_relocation): Likewise.
1951
1952 * aoutx.h (aout_link_reloc_link_order): Allow for NULL return
1953 from malloc on zero size alloc.
1954 * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
1955 * elflink.c (elf_reloc_link_order): Likewise.
1956 * linker.c (_bfd_generic_reloc_link_order): Likewise.
1957 * pdp11.c (aout_link_reloc_link_order): Likewise.
1958 * xcofflink.c (xcoff_reloc_link_order): Likewise.
1959
1960 * aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
1961 bitsize 0, and complain_overflow_dont.
1962 * coff-sparc.c (coff_sparc_howto_table): Likewise.
1963 * elf-hppa.h (elf_hppa_howto_table): Likewise.
1964 * elf-m10200.c (elf_mn10200_howto_table): Likewise.
1965 * elf-m10300.c (elf_mn10300_howto_table): Likewise.
1966 * elf32-arc.c (elf_arc_howto_table): Likewise.
1967 * elf32-arm.c (elf32_arm_howto_table_1): Likewise.
1968 * elf32-avr.c (elf_avr_howto_table): Likewise.
1969 * elf32-bfin.c (bfin_howto_table): Likewise.
1970 * elf32-cr16.c (cr16_elf_howto_table): Likewise.
1971 * elf32-cris.c (cris_elf_howto_table): Likewise.
1972 * elf32-crx.c (crx_elf_howto_table): Likewise.
1973 * elf32-d10v.c (elf_d10v_howto_table): Likewise.
1974 * elf32-d30v.c (elf_d30v_howto_table): Likewise.
1975 * elf32-dlx.c (dlx_elf_howto_table): Likewise.
1976 * elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
1977 * elf32-fr30.c (fr30_elf_howto_table): Likewise.
1978 * elf32-frv.c (elf32_frv_howto_table): Likewise.
1979 * elf32-h8300.c (h8_elf_howto_table): Likewise.
1980 * elf32-i370.c (i370_elf_howto_raw): Likewise.
1981 * elf32-i386.c (elf_howto_table): Likewise.
1982 * elf32-i860.c (elf32_i860_howto_table): Likewise.
1983 * elf32-i960.c (elf32_i960_relocate): Likewise.
1984 * elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
1985 * elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
1986 * elf32-lm32.c (lm32_elf_howto_table): Likewise.
1987 * elf32-m32c.c (m32c_elf_howto_table): Likewise.
1988 * elf32-m32r.c (m32r_elf_howto_table): Likewise.
1989 * elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
1990 * elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
1991 * elf32-m68k.c (howto_table): Likewise.
1992 * elf32-mcore.c (mcore_elf_howto_raw): Likewise.
1993 * elf32-mep.c (mep_elf_howto_table): Likewise.
1994 * elf32-metag.c (elf_metag_howto_table): Likewise.
1995 * elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
1996 * elf32-mips.c (elf_mips_howto_table_rel): Likewise.
1997 * elf32-moxie.c (moxie_elf_howto_table): Likewise.
1998 * elf32-msp430.c (elf_msp430_howto_table): Likewise.
1999 * elf32-mt.c (mt_elf_howto_table): Likewise.
2000 * elf32-nds32.c (nds32_elf_howto_table): Likewise.
2001 * elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
2002 * elf32-or1k.c (or1k_elf_howto_table): Likewise.
2003 * elf32-pj.c (pj_elf_howto_table): Likewise.
2004 * elf32-ppc.c (ppc_elf_howto_raw): Likewise.
2005 * elf32-rl78.c (rl78_elf_howto_table): Likewise.
2006 * elf32-rx.c (rx_elf_howto_table): Likewise.
2007 * elf32-s390.c (elf_howto_table): Likewise.
2008 * elf32-score.c (elf32_score_howto_table): Likewise.
2009 * elf32-score7.c (elf32_score_howto_table): Likewise.
2010 * elf32-sh-relocs.h (R_SH_NONE): Likewise.
2011 * elf32-spu.c (elf_howto_table): Likewise.
2012 * elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
2013 * elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
2014 * elf32-v850.c (v850_elf_howto_table): Likewise.
2015 * elf32-vax.c (howto_table): Likewise.
2016 * elf32-visium.c (visium_elf_howto_table): Likewise.
2017 * elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
2018 * elf32-xgate.c (elf_xgate_howto_table): Likewise.
2019 * elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
2020 * elf32-xtensa.c (elf_howto_table): Likewise.
2021 * elf64-alpha.c (elf64_alpha_howto_table): Likewise.
2022 * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
2023 * elf64-mmix.c (elf_mmix_howto_table): Likewise.
2024 * elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
2025 * elf64-s390.c (elf_howto_table): Likewise.
2026 * elf64-sh64.c (sh_elf64_howto_table): Likewise.
2027 * elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
2028 * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
2029 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
2030 (elfNN_aarch64_howto_none): Likewise.
2031 * elfxx-ia64.c (ia64_howto_table): Likewise.
2032 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
2033 * elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
2034 * nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
2035
6333bc0d
L
20362015-01-15 H.J. Lu <hongjiu.lu@intel.com>
2037
2038 PR ld/17847
2039 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't complain
2040 about -fPIC if the symbol is undefined when building executable.
2041
cd21f5da
NC
20422015-01-15 Nick Clifton <nickc@redhat.com>
2043
2044 PR binutils/17512
2045 * elf-m10300.c (mn10300_info_to_howto): Replace assertion with an
2046 error message. Never return an invalid howto pointer.
2047 * elf32-cr16.c (cr16_info_to_howto): Likewise.
2048 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
2049 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
2050 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
2051 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
2052 * elf32-mips.c (mips_elf32_rtype_to_howto): Likewise.
2053 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
2054 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
2055 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
2056 * elf32-v850.c (v850_elf_info_to_howto_rela): Likewise.
2057 * elf32-vax.c (rtype_to_howto): Likewise.
2058 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
2059 * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
2060 * elfn32-mips.c (sh_elf_info_to_howto): Likewise.
2061 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
2062 (sh_elf_reloc): Check that the reloc is in range.
2063 * reloc.c (bfd_perform_relocation): Check that the section is big
2064 enough for the entire reloc.
2065 (bfd_generic_get_relocated_section_contents): Report unexpected
2066 return values from perform_reloc.
2067
2d071cfc
NC
20682015-01-15 Nick Clifton <nickc@redhat.com>
2069
2070 * elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
2071 relocs. Include PC-relative adjustment for R_MSP430X_ABS16
2072 relaxation.
2073
ca55926c
AM
20742015-01-15 Alan Modra <amodra@gmail.com>
2075
2076 * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
2077 any output section matching a linker created dynobj section.
2078
8539e4e8
AM
20792015-01-15 Alan Modra <amodra@gmail.com>
2080
2081 PR 17842
2082 * elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
2083 (bfd_elf_final_link): Always create a symbol table when emit_relocs.
2084 Don't assign symtab file position unless symbols will be output.
2085 Merge blocks with condition in common. Don't call
2086 elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
2087 unless other symbols are output. Move assignment of symtab_shndx
2088 file position. Localize variable.
2089
52db4ec2
JW
20902015-01-14 Jiong Wang <jiong.wang@arm.com>
2091
2092 * elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when
2093 trying to defer them to runtime.
2094
0941db69
JW
20952015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
2096
2097 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
2098 to check if a symbol should be bound symbolically.
2099
0172429c
JW
21002015-01-13 Jiong Wang <jiong.wang@arm.com>
2101
2102 * elfnn-aarch64.c: (elfNN_aarch64_howto_table): Enable overflow check
2103 for TLSLE_MOVW_TPREL_G2.
2104
bab91cce
JW
21052015-01-13 Jiong Wang <jiong.wang@arm.com>
2106
2107 PR ld/17415
2108 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark
2109 R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned.
2110 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the
2111 bit mask.
2112
3c758495
TG
21132015-01-12 Terry Guo <terry.guo@arm.com>
2114
2115 * elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New
2116 function.
2117 (_bfd_elf_gc_mark_extra_sections): Use it.
2118
9d1d54d5
L
21192015-01-11 H.J. Lu <hongjiu.lu@intel.com>
2120
2121 PR ld/17827
2122 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
2123 only discard space for pc-relative relocs symbols which turn
2124 out to need copy relocs.
2125
c6e8e93a
NC
21262015-01-09 Nick Clifton <nickc@redhat.com>
2127
2128 * tekhex.c (getvalue): Fix thinko in test for correct extraction
2129 of value.
2130 (getsym): Return false if there was not enough data to extract the
2131 symbol.
2132
400cf8cb
AG
21332015-01-09 Anthony Green <green@moxielogic.com>
2134
2135 * elf32-moxie.c (ELF_MACHINE_ALT1): Define.
2136
23d4663e
NC
21372015-01-08 Nick Clifton <nickc@redhat.com>
2138
2139 * elf32-msp430.c (msp430_elf_relax_section): Add relaxation of
2140 16-bit absolute BR instructions to 10-bit pc-relative JMP
2141 instructions.
2142
063bb025
NC
21432015-01-08 Nick Clifton <nickc@redhat.com>
2144
2145 PR binutils/17512
2146 * coffcode.h (coff_slurp_symbol_table): Return false if we failed
2147 to load the line table.
2148 * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum
2149 maxpagesize of 1.
2150 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if
2151 the Data Directory Size is too large.
2152
6f25f223
L
21532015-01-06 H.J. Lu <hongjiu.lu@intel.com>
2154
2155 PR binutils/17512
2156 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation.
2157 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
2158
85880250
NC
21592015-01-06 Nick Clifton <nickc@redhat.com>
2160
2161 PR binutils/17512
e7287c7f
NC
2162 * mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the
2163 string table.
2164
ec93045b
NC
2165 * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
2166 (bfd_perform_relocation): Include the size of the reloc in the
2167 test for an out of range relocation.
2168 (bfd_generic_get_relocated_section_contents): Remove reloc range
2169 test.
2170
85880250
NC
2171 * coff-i860.c (CALC_ADDEND): Always set an addend value.
2172 * tekhex.c (getvalue): Add an end pointer parameter. Use it to
2173 avoid reading off the end of the buffer.
2174 (getsym): Likewise.
2175 (first_phase): Likewise.
2176 (pass_over): Pass an end pointer to the invoked function.
2177
533d0af0
L
21782015-01-05 H.J. Lu <hongjiu.lu@intel.com>
2179
2180 PR binutils/17512
2181 * elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt
2182 input.
2183 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
2184
896ca098
NC
21852015-01-05 Nick Clifton <nickc@redhat.com>
2186
2187 PR binutils/17512
2188 * archive.c (do_slurp_bsd_armap): Make sure that the parsed sized
2189 is at least big enough for the header to be read.
2190 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocs.
2191 * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks.
2192 (bfd_mach_o_read_command): Prevetn duplicate error messages about
2193 unrecognized commands.
2194 * syms.c (_bfd_stab_section_find_nearest_line): Add range checks
2195 when indexing into the string table.
2196
b90efa5b 21972015-01-01 Alan Modra <amodra@gmail.com>
ee3b52e9 2198
b90efa5b 2199 Update year range in copyright notice of all files.
ee3b52e9 2200
b90efa5b 2201For older changes see ChangeLog-2014
56882138 2202\f
b90efa5b 2203Copyright (C) 2015 Free Software Foundation, Inc.
752937aa
NC
2204
2205Copying and distribution of this file, with or without modification,
2206are permitted in any medium without royalty provided the copyright
2207notice and this notice are preserved.
2208
56882138
AM
2209Local Variables:
2210mode: change-log
2211left-margin: 8
2212fill-column: 74
2213version-control: never
2214End:
This page took 1.030848 seconds and 4 git commands to generate.