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