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