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