]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/ChangeLog
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
533f049e
GN
12020-05-12 Gunther Nikl <gnikl@justmail.de>
2
3 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
4 relocation size.
5
94ba9882
AM
62020-05-11 Alan Modra <amodra@gmail.com>
7
8 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
9
7c1f4227
AM
102020-05-11 Alan Modra <amodra@gmail.com>
11
12 * elf64-ppc.c: Rename powerxx to power10 throughout.
13
4d5acb1e
AM
142020-05-11 Alan Modra <amodra@gmail.com>
15
16 PR 25961
17 * coffgen.c (coff_get_normalized_symtab): Check that buffer
18 contains required number of auxents before processing any auxent.
19 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
20 file name from auxents for PE.
21
7242fa8a
GN
222020-05-04 Gunther Nikl <gnikl@justmail.de>
23
24 * aout-cris.c (DEFAULT_ARCH): Delete define.
25 (MY_set_arch_mach): Likewise.
26 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
27 of bfd_arch_cris.
28 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
29 of r_type before the shift.
30
312020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
cff69cf4
WD
32
33 PR ld/25665
34 * elfnn-aarch64.c (group_sections): Copy implementation from
35 elf32-arm.c.
36
a2714d6c
AM
372020-05-01 Alan Modra <amodra@gmail.com>
38
39 PR 25900
40 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
41 accessing root.u.def of symbols. Also check root.u.def.section
42 is non-NULL. Reverse tests so as to make the logic positive.
43
a8acd6ee
AM
442020-05-01 Alan Modra <amodra@gmail.com>
45
46 PR 25882
47 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
48 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
49
6b728d32
AM
502020-05-01 Alan Modra <amodra@gmail.com>
51
52 PR 25882
53 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
54 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
55 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
56 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
57 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
58 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
59 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
60 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
61 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
62 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
63
91ed9b71
AM
642020-05-01 Alan Modra <amodra@gmail.com>
65
66 PR 25882
67 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
68 from shared libraries.
69
d548f47d
MF
702020-04-29 Max Filippov <jcmvbkbc@gmail.com>
71
72 * elf32-xtensa.c (relax_section): Don't negate diff_value for
73 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
74 equals 0. Report overflow when the result has negative sign but
75 all significant bits are zero.
76
dfa85db1
GN
772020-04-29 Gunther Nikl <gnikl@justmail.de>
78
79 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
80 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
81
48e5bada
AM
822020-04-28 Alan Modra <amodra@gmail.com>
83
84 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
85 Emit warning message.
86
251dae91
TC
872020-04-27 Tamar Christina <tamar.christina@arm.com>
88
89 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
90 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
91 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
92 to x86_64_pe_big_vec as it not a big-endian format.
93 (vec i386_pe_big_vec): New.
94 * configure.ac: Likewise.
95 * targets.c: Likewise.
96 * configure: Regenerate.
97 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
98 COFF_WITH_PE_BIGOBJ): New.
99 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
100 New.
101 (x86_64_pe_be_vec): Moved.
102
27456742
AK
1032020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
104
105 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
106 * elf.c (elfcore_grok_arc_v2): New function.
107 (elfcore_grok_note): Call the new function to handle the corresponding
108 note.
109 (elfcore_write_arc_v2): New function.
110 (elfcore_write_register_note): Call the new function to handle the
111 corresponding pseudo-sections.
112
30ce8e47
MF
1132020-04-22 Max Filippov <jcmvbkbc@gmail.com>
114
115 PR ld/25861
116 * bfd-in2.h: Regenerated.
117 * elf32-xtensa.c (elf_howto_table): New entries for
118 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
119 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
120 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
121 R_XTENSA_NDIFF{8,16,32}.
122 * libbfd.h (bfd_reloc_code_real_names): Add names for
123 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
124 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
125 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
126 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
127
c36876fe
TC
1282020-04-21 Tamar Christina <tamar.christina@arm.com>
129
130 PR binutils/24753
131 * compress.c (bfd_get_full_section_contents): Exclude sections with no
132 content.
133
6f6fd151
L
1342020-04-21 H.J. Lu <hongjiu.lu@intel.com>
135
136 PR ld/25849
137 * elf-bfd.h (elf_backend_data): Add
138 elf_backend_strip_zero_sized_dynamic_sections.
139 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
140 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
141 New macro.
142 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
143 function.
144 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
145 New macro.
146 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
147
1f7f2abb
L
1482020-04-21 H.J. Lu <hongjiu.lu@intel.com>
149
150 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
151 sec.
152 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
153 DT_TEXTREL with -M.
154 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
155
e04f33c0
NC
1562020-04-21 Nick Clifton <nickc@redhat.com>
157
158 * po/sr.po: Updated Serbian translation.
159
fad3d2c1
AM
1602020-04-21 Alan Modra <amodra@gmail.com>
161
162 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
163 processing.
164
23c8270e
SC
1652020-04-20 Stephen Casner <casner@acm.org>
166
167 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
168 causing globals from linker script to be treated as debug symbols.
169 (translate_symbol_table): Don't sign-extend symbol values from 16
170 to 64 bits in nm output.
171
2efec98b
AM
1722020-04-20 Alan Modra <amodra@gmail.com>
173
174 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
175
18f97353
AM
1762020-04-18 Alan Modra <amodra@gmail.com>
177
178 * section.c (bfd_is_const_section): Correct test for special
179 sections.
180 * bfd-in2.h: Regenerate.
181
8d55d10a
AM
1822020-04-17 Alan Modra <amodra@gmail.com>
183
184 PR 25842
185 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
186 NULL nodename.
187
8e4979ac
NC
1882020-04-16 Nick Clifton <nickc@redhat.com>
189
190 PR 25803
191 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
192 abort with a more helpful error message.
193
aec72fda
AM
1942020-04-16 Alan Modra <amodra@gmail.com>
195
196 PR 25827
197 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
198 strdup(0).
199
95a51568
FS
2002020-04-15 Fangrui Song <maskray@google.com>
201
202 PR binutils/24613
203 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
204 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
205 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
206 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
207 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
208 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
209 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
210 * elf32-sh.c (sh_elf_relocate_section): Likewise.
211 * elf32-spu.c (spu_elf_relocate_section): Likewise.
212 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
213 * elflink.c (elf_link_output_extsym): Likewise.
214 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
215
7ecb5154
AM
2162020-04-15 Alan Modra <amodra@gmail.com>
217
218 PR 25823
219 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
220 pointer into strings that may be freed for section name, always
221 allocate a new string.
222
f717994f
JMG
2232020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
224 Jan W. Jagersma <jwjagersma@gmail.com>
225
226 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
227 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
228 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
229 (_bfd_go32_mkobject): New functions.
230 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
231 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
232 (go32exe_mkobject): Call _bfd_go32_mkobject.
233 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
234 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
235 and COFF_GO32.
236 (coff_write_relocs): Enable extended reloc counter code if
237 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
238 (coff_write_object_contents): Likewise. Pad section headers
239 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
240 instead of coff_swap_scnhdr_out.
241 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
242 enable extended reloc counter.
243 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
244 Declare with ATTRIBUTE_UNUSED.
245 * libcoff-in.h: (struct coff_tdata): New field go32.
246 (obj_go32): Define.
247 * libcoff.h: Regenerate.
248
34ca5531
FS
2492020-04-14 Fangrui Song <maskray@google.com>
250
251 PR gas/25768
252 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
253 12.
254
fa1477dc
SC
2552020-04-14 Stephen Casner <casner@acm.org>
256
257 PR ld/25677
258 * pdp11.c: Add implementation of --imagic option.
259 (adjust_o_magic): Fix objcopy --extract-symbol test.
260 * libaout.h (enum aout_magic): Add i_magic.
261
a0543b0b
RO
2622020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
263 Nick Clifton <nickc@redhat.com>
264
265 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
266 <0>: Ignore.
267 <default>: Error rather than abort.
268
3349112e
L
2692020-04-03 H.J. Lu <hongjiu.lu@intel.com>
270
271 PR ld/25767
272 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
273 relocation section from section group.
274
4d095f5b
JJ
2752020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
276
277 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
278 bfd->origin to file offset.
279 * bfdwin.c (bfd_get_file_window): Likewise.
280 * bfd.c: Clarify the use of the bfd->origin field.
281 * bfd-in2.h: Regenerate.
282 * coff-i386.c: Don't include go32exe.h. Allow overriding
283 coff_write_object_contents via COFF_WRITE_CONTENTS.
284 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
285 (go32exe_write_object_contents): New functions.
286 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
287 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
288 (create_go32_stub): Remove check for 2k size limit. Read stub
289 from go32exe_temp_stub if present.
290 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
291 copy variable-length stub.
292 (go32_check_format): Read stub to go32exe_temp_stub, set
293 origin, return go32exe_cleanup.
294 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
295 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
296 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
297 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
298 Remove functions and their associated #defines.
299 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
300 * libcoff-in.h: (struct coff_tdata): New field stub_size.
301 Rename field go32stub to stub.
302 * libcoff.h: Regenerate.
303 * coff-stgo32.c (go32_check_format): Rename to...
304 (go32exe_check_format): ...this.
305 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
306 (go32exe_copy_private_bfd_data): ...this.
307 (stub_bytes): Rename to...
308 (go32exe_default_stub): ...this.
309 (create_go32_stub): Rename to...
310 (go32exe_create_stub): ...this.
311 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
312 when possible.
313
382aae06
L
3142020-04-01 H.J. Lu <hongjiu.lu@intel.com>
315
316 PR ld/25749
317 PR ld/25754
318 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
319 relocation to R_386_32 for relocation against non-preemptible
320 absolute symbol.
321 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
322 allocate dynamic relocation for non-preemptible absolute symbol.
323 (elf_i386_relocate_section): Pass sec to
324 GENERATE_DYNAMIC_RELOCATION_P.
325 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
326 (elf_x86_64_convert_load_reloc): Covert load relocation to
327 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
328 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
329 for non-preemptible absolute symbol if they overflow.
330 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
331 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
332 symbol. Don't allocate dynamic relocation for non-preemptible
333 absolute symbol.
334 (elf_x86_64_relocate_section): Don't generate relative relocation
335 for GOTPCREL relocations aganst local absolute symbol. Pass sec
336 to GENERATE_DYNAMIC_RELOCATION_P.
337 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
338 against non-preemptible absolute symbol.
339 (_bfd_elf_x86_valid_reloc_p): New function.
340 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
341 GOT_ABS GOT slot.
342 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
343 argument. Don't generate dynamic relocation against
344 non-preemptible absolute symbol.
345 (ABS_SYMBOL_P): New.
346 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
347 against non-preemptible absolute symbol.
348 (GOT_ABS): New.
349 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
350 (_bfd_elf_x86_valid_reloc_p): New.
351
a7618269
TC
3522020-04-01 Tamar Christina <tamar.christina@arm.com>
353
354 PR ld/16017
355 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
356 address in the GOT if in thumb only mode.
357
15ccbdd7
TC
3582020-04-01 Tamar Christina <tamar.christina@arm.com>
359
360 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
361
7b948a25
HPN
3622020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
363
364 * mmo.c (mmo_scan): Create .text section only when needed, not
365 from the start.
366
89b599df
AM
3672020-03-31 Alan Modra <amodra@gmail.com>
368
369 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
370 return value check.
371
81699544
AM
3722020-03-31 Alan Modra <amodra@gmail.com>
373
374 * vms-alpha.c (image_write): Check bounds for sections without
375 contents too. Error on non-zero write to section without
376 contents.
377 (_bfd_vms_slurp_etir): Check return of image_write* functions.
378
b3b360de
AM
3792020-03-31 Alan Modra <amodra@gmail.com>
380
381 * tekhex.c (pass_over): Check is_eof before reading buffer.
382
00386881
NC
3832020-03-30 Nick Clifton <nickc@redhat.com>
384
385 PR binutils/pr25662
386 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
387 field to timestamp and make it an integer.
388 * libcoff.h: Regenerate.
389 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
390 field in the pe_data structure rather than the insert_timestamp
391 field.
392
988b7300
AM
3932020-03-30 Alan Modra <amodra@gmail.com>
394
395 PR 25745
396 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
397 statistics message.
398
aa49fc22
NC
3992020-03-26 Nick Clifton <nickc@redhat.com>
400
401 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
402 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
403 prototype.
404 * libbfd.h: Regenerate.
405
ff768510
AM
4062020-03-26 Alan Modra <amodra@gmail.com>
407
408 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
409
f75fbe8a
AM
4102020-03-26 Alan Modra <amodra@gmail.com>
411
412 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
413 array.
414 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
415
aac88046
NC
4162020-03-25 Nick Clifton <nickc@redhat.com>
417
418 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
419 function.
420 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
421 * libbfd.h: Regenerate.
422
cf2611fe
SV
4232020-03-25 Shahab Vahedi <shahab@synopsys.com>
424
425 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
426 correct field name in the output string.
427
d16e3d2e
AM
4282020-03-25 Alan Modra <amodra@gmail.com>
429
430 PR 25662
431 * elf.c (assign_file_positions_for_load_sections): Adjust offset
432 for SHT_NOBITS section if first in segment.
433
1081065c
L
4342020-03-24 H.J. Lu <hongjiu.lu@intel.com>
435
436 PR binutils/25708
437 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
438 (_bfd_elf_get_symbol_version_string): This.
439 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
440 (_bfd_elf_get_symbol_version_string): This.
441 (bfd_elf_print_symbol): Pass TRUE to
442 _bfd_elf_get_symbol_version_string.
443 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
444 bfd_boolean argument.
445 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
446 * targets.c (_bfd_get_symbol_version_string): Likewise.
447 (bfd_get_symbol_version_string): Likewise.
448 * bfd-in2.h: Regenerated.
449
0b8448af 4502020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 451 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
452
453 PR 25713
454 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
455 Win32 systems.
456
ec2e748a
NC
4572020-03-24 Nick Clifton <nickc@redhat.com>
458
459 PR 25681
460 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
461 segment to use for PT_GNU_RELRO, ignore empty sections in a
462 segment's current list.
463
cda7e560
L
4642020-03-24 H.J. Lu <hongjiu.lu@intel.com>
465
466 PR binutils/25717
467 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
468
7e6e972f
L
4692020-03-24 H.J. Lu <hongjiu.lu@intel.com>
470
471 PR binutils/25708
472 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
473 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
474 on the previous _bfd_elf_get_symbol_version_string.
475 (_bfd_elf_get_symbol_version_string): Use it.
476
65109548
AM
4772020-03-24 Alan Modra <amodra@gmail.com>
478
479 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
480 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
481 struct areltdata.
482
fdde2fb6
SH
4832020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
484
485 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
486
cf28cfef
AM
4872020-03-23 Alan Modra <amodra@gmail.com>
488
489 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
490 symbol count. Allocate an extra byte to ensure name strings
491 are terminated. Sanity check name offsets. Release memory on
492 error return.
493
5e737279
AM
4942020-03-23 Alan Modra <amodra@gmail.com>
495
496 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
497 field hasn't been read. Remove unnecessary casts.
498
c15a8f17
AM
4992020-03-22 Alan Modra <amodra@gmail.com>
500
501 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
502 enough to read number of symbols.
503
3d98c460
L
5042020-03-20 H.J. Lu <hongjiu.lu@intel.com>
505
506 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
507 (EXECUTABLE_SUFFIX): Likewise.
508 * config.in: Regenerated.
509 * configure: Likewise.
510 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
511 _bfd_generic_close_and_cleanup.
512 (plugin_list_entry): Remove resolution_file, resolution_option,
513 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
514 lto_wrapper, gcc_env and initialized,
515 (need_lto_wrapper_p): Removed.
516 (get_lto_wrapper): Likewise.
517 (setup_lto_wrapper_env): Likewise.
518 (register_all_symbols_read): Likewise.
519 (egister_cleanup): Likewise.
520 (get_symbols): Likewise.
521 (add_input_file): Likewise.
522 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
523 (add_symbols): Updated.
524 (try_claim): Likewise.
525 (try_load_plugin): Likewise.
526 (bfd_plugin_canonicalize_symtab): Likewise.
527 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
528 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
529
c3a1714c
L
5302020-03-19 H.J. Lu <hongjiu.lu@intel.com>
531
532 PR binutils/25640
533 * plugin.c (plugin_list_entry): Add has_symbol_type.
534 (add_symbols_v2): New function.
535 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
536 provides symbol type.
537 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
538 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
539 available.
540
67338173
AM
5412020-03-20 Alan Modra <amodra@gmail.com>
542
543 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
544 enough to read number of symbols.
545
a859124d
AM
5462020-03-20 Alan Modra <amodra@gmail.com>
547
548 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
549 backend functions for NULL before calling.
550 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
551 (bfd_section_from_shdr, assign_section_numbers): Likewise.
552 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
553 * elfnn-ia64.c (ignore_errors): New function.
554 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
555
f3a08f77
NC
5562020-03-19 Nick Clifton <nickc@redhat.com>
557
558 PR 25676
559 * dwarf2.c (struct varinfo): Add unit_offset field to record the
560 location of the varinfo in the unit's debug info data. Change the
561 type of the stack field to a boolean.
562 (lookup_var_by_offset): New function. Returns the varinfo
563 structure for the variable described at the given offset in the
564 unit's debug info.
565 (scan_unit_for_symbols): Add support for variables which have the
566 DW_AT_specification attribute.
567
6a541707
NC
5682020-03-19 Nick Clifton <nickc@redhat.com>
569
570 PR 25699
571 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
572 error return.
573
effc14f5
SH
5742020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
575
576 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
577
ac4bf06c
NC
5782020-03-18 Nick Clifton <nickc@redhat.com>
579
580 PR 25673
581 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
582 memory access when processing a corrupt secondary reloc section.
583
53215f21
CL
5842020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
585
586 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
587 instead of calling abort.
588 * elf32-csky.c (csky_build_one_stub): Likewise.
589 * elf32-hppa.c (hppa_build_one_stub): Likewise.
590 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
591 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
592 * elf32-metag.c (metag_build_one_stub): Likewise.
593 * elf32-nios2.c (nios2_build_one_stub): Likewise.
594 * elf64-ppc.c (ppc_build_one_stub): Likewise.
595 (ppc_size_one_stub): Likewise.
596 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
597
327ef784
NC
5982020-03-17 Nick Clifton <nickc@redhat.com>
599
d3c3c542 600 PR 25688
327ef784
NC
601 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
602 with error messages.
603
ecbbbdba
NC
6042020-03-17 Nick Clifton <nickc@redhat.com>
605
606 PR 25687
607 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
608 free. Add free on another failure path.
609
4b3ecb3b
AM
6102020-03-16 Alan Modra <amodra@gmail.com>
611
612 PR 25675
613 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
614 we have a non-zero section count. Do lma comparison in octets.
615
7bac4137
AM
6162020-03-16 Alan Modra <amodra@gmail.com>
617
618 * vms-alpha.c (dst_restore_location): Validate index into
619 dst_ptr_offsets array before accessing. Return status.
620 (dst_retrieve_location): Similarly, making "loc" parameter a
621 pointer to return value.
622 (_bfd_vms_slurp_etir): Update calls to above functions.
623
8b5d0a4f
KR
6242020-03-14 Kamil Rytarowski <n54@gmx.com>
625
626 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
627 targets.
628 * configure: Regenerated.
629
48e81d7f
AM
6302020-03-14 Alan Modra <amodra@gmail.com>
631
632 * section.c (BFD_FAKE_SECTIONS): Formatting.
633 * bfd-in2.h: Regenerate.
634
06d949ec
KR
6352020-03-13 Kamil Rytarowski <n54@gmx.com>
636
637 * elf.c (elfcore_grok_netbsd_note): Add support for
638 NT_NETBSDCORE_LWPSTATUS notes.
639
abf874aa
CL
6402020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
641
642 * bfd-in2.h: Regenerate.
643 * section.c (asection): Add already_assigned field.
644 (BFD_FAKE_SECTION): Add default initializer for it.
645 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
646 * elf32-arm.c (arm_build_one_stub): Add support for
647 non_contiguous_regions.
648 * elf32-csky.c (csky_build_one_stub): Likewise.
649 * elf32-hppa.c (hppa_build_one_stub): Likewise.
650 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
651 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
652 * elf32-metag.c (metag_build_one_stub): Likewise.
653 * elf32-nios2.c (nios2_build_one_stub): Likewise.
654 * elf64-ppc.c (ppc_build_one_stub): Likewise.
655 (ppc_size_one_stub): Likewise.
656 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
657 * elflink.c (elf_link_input_bfd): Likewise.
658
74e10d17
L
6592020-03-13 H.J. Lu <hongjiu.lu@intel.com>
660
661 PR ld/24920
662 * elf-linker-x86.h (elf_linker_x86_params): Add
663 static_before_all_inputs and has_dynamic_linker.
664 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
665 dynamic input objects if -static is passed at command-line
666 before all input files without --dynamic-linker unless
667 --no-dynamic-linker is used.
668
015ec493
KR
6692020-03-13 Kamil Rytarowski <n54@gmx.com>
670
671 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
672
66631823
CE
6732020-03-13 Christian Eggers <ceggers@gmx.de>
674
675 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
676 "p_paddr" from "at".
677 * elfcode.h (bfd_from_remote_memory): Add units to several
678 parameters. New local "opb". Fix usage of p_align. Fix
679 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
680 call of target_read_memory.
681 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
682 calculation of "offset" and "output_offset".
683 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
684 from "offset" and fix calculation of "end" from "vma+size". Fix
685 comparison between "sh_addr" and "vma"/"output_offset".
686 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
687 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
688 member.
689 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
690 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
691 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
692 assignment of p_paddr from phdr_lma. Fix comparison between
693 "lma+size" and "next->lma".
694 (elf_sort_segments): Fix assignment from p_paddr to lma.
695 (assign_file_positions_for_load_sections): Add unit (bytes) to
696 local "align". Fix calculation of local "off_adjust". Fix
697 calculation of local "filehdr_vaddr".
698 (assign_file_positions_for_non_load_sections): New local "opb".
699 Fix calculation of "end" from "p_size". Fix comparison between
700 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
701 from "end" and "p_vaddr".
702 (rewrite_elf_program_header): Fix comparison between p_vaddr and
703 vma. Fix assignment to p_paddr from lma. Fix comparison between
704 p_paddr and lma. Fix assignment to p_paddr from lma.
705 * merge.c (sec_merge_emit): New local "opb". Convert
706 "alignment_power" to octets.
707 (_bfd_add_merge_section): New locals "alignment_power" and
708 "opb". Fix comparison between "alignment_power" and
709 "sizeof(align)".
710 (_bfd_merge_sections): New local "opb". Divide size by opb
711 before checking align mask.
712
502794d4
CE
7132020-03-13 Christian Eggers <ceggers@gmx.de>
714
715 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
716 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
717 section LMA/VMA.
718 (_bfd_elf_make_section_from_phdr): Similarly.
719 (elf_fake_sections): Fix calculation of
720 Elf_Internal_shdr::sh_addr from section VMA.
721 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
722 and bytes.
723 (assign_file_positions_for_load_sections): Fix calculations of
724 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
725 comparison between program header address and section LMA.
726 (assign_file_positions_for_non_load_sections): Likewise.
727 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
728 (IS_CONTAINED_BY_VMA): Add parameter opb.
729 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
730 INCLUDE_SECTION_IN_SEGMENT): Likewise.
731 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
732 Fix calculations of p_addr_valid and p_vaddr_offset.
733 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
734 with octets per byte when comparing against p_vaddr.
735
8248d21a
AM
7362020-03-11 Alan Modra <amodra@gmail.com>
737
738 * som.c (setup_sections): Sanity check subspace.name.
739
435edf0b
AM
7402020-03-11 Alan Modra <amodra@gmail.com>
741
742 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
743
6b5e16ff
AM
7442020-03-10 Alan Modra <amodra@gmail.com>
745
746 PR 25648
747 * ihex.c (ihex_write_object_contents): Don't assume ordering of
748 addresses here.
749
2f57795b
AM
7502020-03-09 Alan Modra <amodra@gmail.com>
751
752 * wasm-module.c (wasm_scan): Sanity check file name length
753 before allocating memory. Move common section setup code. Do
754 without bfd_tell to calculate section size.
755
a0dcf297
NC
7562020-03-06 Nick Clifton <nickc@redhat.com>
757
758 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
759 with error messages and failure return values.
760
e15a8da9
MF
7612020-03-05 Max Filippov <jcmvbkbc@gmail.com>
762
763 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
764 relocation sections for any removed reference to a dynamic symbol.
765
a8e14f4c
NC
7662020-03-05 Nick Clifton <nickc@redhat.com>
767
768 * elf-bfd.h (struct elf_backend_data): Add new fields:
769 init_secondary_reloc_section, slurp_secondary_reloc_section,
770 write_secondary_reloc_section.
771 (_bfd_elf_init_secondary_reloc_section): Prototype.
772 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
773 (_bfd_elf_write_secondary_reloc_section): Prototype.
774 * elf.c ( bfd_section_from_shdr): Invoke the new
775 init_secondary_reloc_section backend function, if defined, when a
776 second reloc section is encountered.
777 (swap_out_syms): Invoke the new symbol_section_index function, if
778 defined, when computing the section index of an OS/PROC specific
779 symbol.
780 (_bfd_elf_init_secondary_reloc_section): New function.
781 (_bfd_elf_slurp_secondary_reloc_section): New function.
782 (_bfd_elf_write_secondary_reloc_section): New function.
783 (_bfd_elf_copy_special_section_fields): New function.
784 * elfcode.h (elf_write_relocs): Invoke the new
785 write_secondary_relocs function, if defined, in order to emit
786 secondary relocs.
787 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
788 function, if defined, in order to read in secondary relocs.
789 * elfxx-target.h (elf_backend_copy_special_section_fields):
790 Provide a non-NULL default definition.
791 (elf_backend_init_secondary_reloc_section): Likewise.
792 (elf_backend_slurp_secondary_reloc_section): Likewise.
793 (elf_backend_write_secondary_reloc_section): Likewise.
794 (struct elf_backend_data elfNN_bed): Add initialisers for the new
795 fields.
796 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
797 * configure: Regenerate.
798
6f8f95b4
AM
7992020-03-05 Alan Modra <amodra@gmail.com>
800
801 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
802 against file size before allocating memory. Use bfd_alloc rather
803 than bfd_zalloc for carsym/strings memory.
804
233bf4f8
AM
8052020-03-04 Alan Modra <amodra@gmail.com>
806
807 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
808 sh_addr mod sh_addalign is zero.
809
1039fd9a
AM
8102020-03-04 Alan Modra <amodra@gmail.com>
811
812 * format.c (bfd_check_format_matches): Call cleanup on error exit.
813
f5714099
AM
8142020-03-03 Alan Modra <amodra@gmail.com>
815
816 * format.c (struct bfd_preserve): Add cleanup field.
817 (bfd_preserve_save): Add cleanup param and save.
818 (bfd_preserve_restore): Return cleanup.
819 (bfd_preserve_finish): Call the cleanup for the discarded match.
820 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
821 and clear when preserving a match. Restore cleanup too when
822 restoring that match.
823
40b35c78
AM
8242020-03-02 Alan Modra <amodra@gmail.com>
825
826 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
827 * hpux-core.c (hpux_core_core_file_p): Update prototype.
828 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
829 (core_sco5_vec): Correct initialisers.
830
601b73d5
AM
8312020-03-02 Alan Modra <amodra@gmail.com>
832
833 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
834 * aix5ppc-core.c (xcoff64_core_p): Likewise.
835 * cisco-core.c (cisco_core_file_validate): Likewise.
836 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
837 * hpux-core.c (hpux_core_core_file_p): Likewise.
838 * irix-core.c (irix_core_core_file_p): Likewise.
839 * lynx-core.c (lynx_core_file_p): Likewise.
840 * netbsd-core.c (netbsd_core_file_p): Likewise.
841 * osf-core.c (osf_core_core_file_p): Likewise.
842 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
843 * sco5-core.c (sco5_core_file_p): Likewise.
844
728d32c4
L
8452020-03-02 H.J. Lu <hongjiu.lu@intel.com>
846
847 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
848
cb001c0d
AM
8492020-03-02 Alan Modra <amodra@gmail.com>
850
851 * targets.c (bfd_cleanup): New typedef.
852 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
853 * libbfd-in.h (_bfd_no_cleanup): Define.
854 * format.c (bfd_reinit): Add cleanup parameter, call it.
855 (bfd_check_format_matches): Set cleanup from _bfd_check_format
856 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
857 * aout-target.h (callback, object_p): Return bfd_cleanup.
858 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
859 * archive.c (bfd_generic_archive_p): Likewise.
860 * binary.c (binary_object_p): Likewise.
861 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
862 * coff-ia64.c (ia64coff_object_p): Likewise.
863 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
864 * coff-sh.c (coff_small_object_p): Likewise.
865 * coff-stgo32.c (go32_check_format): Likewise.
866 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
867 (xcoff64_core_p): Likewise.
868 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
869 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
870 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
871 * elfcode.h (elf_object_p): Likewise.
872 * elfcore.h (elf_core_file_p): Likewise.
873 * i386msdos.c (msdos_object_p): Likewise.
874 * ihex.c (ihex_object_p): Likewise.
875 * libaout.h (some_aout_object_p): Likewise.
876 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
877 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
878 * libbfd.c (_bfd_dummy_target): Likewise.
879 * libcoff-in.h (coff_object_p): Likewise.
880 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
881 (bfd_mach_o_arm64_core_p): Likewise.
882 * mach-o-arm.c (bfd_mach_o_arm_object_p),
883 (bfd_mach_o_arm_core_p): Likewise.
884 * mach-o-i386.c (bfd_mach_o_i386_object_p),
885 (bfd_mach_o_i386_core_p): Likewise.
886 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
887 (bfd_mach_o_x86_64_core_p): Likewise.
888 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
889 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
890 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
891 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
892 * mmo.c (mmo_object_p): Likewise.
893 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
894 * peicode.h (coff_real_object_p, pe_ILF_object_p),
895 (pe_bfd_object_p): Likewise.
896 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
897 * ppcboot.c (ppcboot_object_p): Likewise.
898 * rs6000-core.c (rs6000coff_core_p): Likewise.
899 * som.c (som_object_setup, som_object_p): Likewise.
900 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
901 * tekhex.c (tekhex_object_p): Likewise.
902 * vms-alpha.c (alpha_vms_object_p): Likewise.
903 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
904 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
905 * wasm-module.c (wasm_object_p): Likewise.
906 * xsym.c (bfd_sym_object_p): Likewise.
907 * xsym.h (bfd_sym_object_p): Likewise.
908 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
909 return type.
910 * pdp11.c (some_aout_object_p): Likewise.
911 * plugin.c (register_ld_plugin_object_p): Update object_p
912 parameter type.
913 * plugin.h (register_ld_plugin_object_p): Likewise.
914 * bfd-in2.h: Regenerate.
915 * libbfd.h: Regenerate.
916 * libcoff.h: Regenerate.
917
a4dd6c97
AM
9182020-03-02 Alan Modra <amodra@gmail.com>
919
920 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
921 applicable section flags.
922 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
923 (mips_ecoff_bele_vec): Likewise.
924 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
925 and .sbss sections.
926 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
927 (_bfd_ecoff_styp_to_sec_flags): Likewise.
928
bf577467
AM
9292020-03-02 Alan Modra <amodra@gmail.com>
930
931 * elf32-m32r.c (m32r_elf_section_flags): New function.
932 (elf_backend_section_flags): Define.
933 * elf32-nds32.c (nds32_elf_section_flags): New function.
934 (elf_backend_section_flags): Define.
935 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
936 .sbss and .sdata sections.
937 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
938 for SHF_V850_GPREL sections.
939 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
940 FIXME.
941 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
942 for SHF_PARISC_SHORT sections.
943 * elf64-ppc.c (ppc64_elf_section_flags): New function.
944 (elf_backend_section_flags): Define.
945 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
946 for SHF_MIPS_GPREL sections. Delete FIXME.
947
8c803a2d
AM
9482020-03-02 Alan Modra <amodra@gmail.com>
949
950 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
951 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
952 calling elf_backend_section_flags with adjusted params. Use
953 newsect->flags past that point.
954 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
955 special sections.
956 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
957 to have their type overridden, and all sh_flags but processor and
958 os specific.
959 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
960 * elf32-mep.c (mep_elf_section_flags): Likewise.
961 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
962 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
963 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
964 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
965 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
966 stub BFD and non-aarch64 input files when scanning for stubs.
967
7d4b2d2d
AM
9682020-03-02 Alan Modra <amodra@gmail.com>
969
970 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
971 limit to decompressed element size.
972
26f60d59
AM
9732020-03-02 Alan Modra <amodra@gmail.com>
974
975 * vms-lib.c (vms_traverse_index): Add recur_count param and
976 update calls. Fail on excessive recursion.
977
9cb56943
AM
9782020-03-02 Alan Modra <amodra@gmail.com>
979
980 * vms-alpha.c (vms_get_remaining_object_record): Use
981 bfd_realloc_or_free rather than bfd_realloc.
982 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
983 (dst_define_location, parse_module): Likewise, and check realloc
984 return status before using memory. Return status from function
985 adjusting all callers.
986
182ec670
AM
9872020-02-28 Alan Modra <amodra@gmail.com>
988
989 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
990
1b088c82
AM
9912020-02-28 Alan Modra <amodra@gmail.com>
992
993 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
994 Remove duplicate undersize check.
995
5f602802
AM
9962020-02-27 Alan Modra <amodra@gmail.com>
997
998 PR 24511
999 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1000
49d9fd42
AM
10012020-02-27 Alan Modra <amodra@gmail.com>
1002
1003 PR 24511
1004 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1005 (coff_section_type): Adjust comment.
1006 (decode_section_type): Likewise. Call coff_section_type before
1007 decode_section_type.
1008 (bfd_decode_symclass): Use 'c' for common sections other than
1009 the standard one.
1010
05f52dc2
AM
10112020-02-27 Alan Modra <amodra@gmail.com>
1012
1013 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1014 malloc'd block.
1015
ff69a894
AM
10162020-02-27 Alan Modra <amodra@gmail.com>
1017
1018 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1019 if file is an archive element.
1020 * bfd-in2.h: Regenerate.
1021
02f7e7ee
AM
10222020-02-26 Alan Modra <amodra@gmail.com>
1023
1024 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1025 bfd_set_error on failing test. Don't bother changing bfd_error on
1026 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1027 Check sym name is within string buffer. Use size_t for some vars.
1028 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1029 int_buf. Don't change bfd_error on file read error. Use
1030 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1031 calculations to catch overflows before they occur. malloc and
1032 free raw armap rather than using bfd_alloc. Read raw armap before
1033 allocating carsym+strings buffer.
1034 (_bfd_slurp_extended_name_table): Localize variables. Check
1035 name size against file size.
1036
cc4c4f40
AM
10372020-02-26 Alan Modra <amodra@gmail.com>
1038
1039 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1040
e0b317de
AM
10412020-02-26 Alan Modra <amodra@gmail.com>
1042
1043 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1044 malloc. Check for NULL return from bfd_malloc.
1045 (rx_table_find, rx_table_map): Likewise.
1046 (rx_set_section_contents): Check bfd_alloc return.
1047 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1048
dc1e8a47
AM
10492020-02-26 Alan Modra <amodra@gmail.com>
1050
1051 * aoutx.h: Indent labels correctly. Format error strings.
1052 * archive.c: Likewise.
1053 * archive64.c: Likewise.
1054 * coff-arm.c: Likewise.
1055 * coff-rs6000.c: Likewise.
1056 * coff-stgo32.c: Likewise.
1057 * cpu-arm.c: Likewise.
1058 * dwarf2.c: Likewise.
1059 * elf-ifunc.c: Likewise.
1060 * elf-properties.c: Likewise.
1061 * elf-s390-common.c: Likewise.
1062 * elf-strtab.c: Likewise.
1063 * elf.c: Likewise.
1064 * elf32-arm.c: Likewise.
1065 * elf32-bfin.c: Likewise.
1066 * elf32-cr16.c: Likewise.
1067 * elf32-csky.c: Likewise.
1068 * elf32-i386.c: Likewise.
1069 * elf32-m68k.c: Likewise.
1070 * elf32-msp430.c: Likewise.
1071 * elf32-nds32.c: Likewise.
1072 * elf32-nios2.c: Likewise.
1073 * elf32-pru.c: Likewise.
1074 * elf32-xtensa.c: Likewise.
1075 * elf64-ia64-vms.c: Likewise.
1076 * elf64-x86-64.c: Likewise.
1077 * elfcode.h: Likewise.
1078 * elfcore.h: Likewise.
1079 * elflink.c: Likewise.
1080 * elfnn-aarch64.c: Likewise.
1081 * elfnn-ia64.c: Likewise.
1082 * elfnn-riscv.c: Likewise.
1083 * elfxx-mips.c: Likewise.
1084 * elfxx-sparc.c: Likewise.
1085 * elfxx-x86.c: Likewise.
1086 * i386lynx.c: Likewise.
1087 * merge.c: Likewise.
1088 * pdp11.c: Likewise.
1089 * plugin.c: Likewise.
1090 * reloc.c: Likewise.
1091
e310298c
AM
10922020-02-26 Alan Modra <amodra@gmail.com>
1093
1094 PR 25593
1095 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1096 "dyn_loaded".
1097 (bfd_elf_add_dt_needed_tag): Declare.
1098 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1099 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1100 from elf_add_dt_needed_tag. Remove soname and doit param.
1101 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1102 to see whether as-needed lib is already loaded, use dyn_loaded
1103 list instead. When saving and restoring around as-needed lib
1104 handle possibility that dynstr has not been initialised. Don't
1105 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1106 Mark libs loaded via DT_NEEDED entries of other libs with
1107 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1108 the output.
1109 (elf_link_check_versioned_symbol): Remove now unneccesary
1110 DYNAMIC check when traversing dyn_loaded list.
1111
b570b954
AM
11122020-02-26 Alan Modra <amodra@gmail.com>
1113
1114 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1115
ecda9016
L
11162020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1117
1118 PR binutils/25584
1119 * plugin.c (need_lto_wrapper_p): New.
1120 (bfd_plugin_set_program_name): Add an int argument to set
1121 need_lto_wrapper_p.
1122 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1123 set.
1124 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1125
a98c743f
AM
11262020-02-24 Alan Modra <amodra@gmail.com>
1127
1128 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1129
c893ce36
AM
11302020-02-24 Alan Modra <amodra@gmail.com>
1131
1132 * vms-lib.c (struct carsym_mem): Add limit.
1133 (vms_add_index): Heed limit.
1134 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1135 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1136 Always return actual number read.
1137 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1138 assertion with error exit.
1139
7b3c2715
AM
11402020-02-22 Alan Modra <amodra@gmail.com>
1141
1142 PR 25585
1143 * elf.c (assign_file_positions_for_load_sections): Continue linking
1144 on "PHDR segment not covered by LOAD segment" errors.
1145
a4425a57
AM
11462020-02-21 Alan Modra <amodra@gmail.com>
1147
1148 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1149 overflow check.
1150 (bfd_mach_o_canonicalize_reloc): Likewise.
1151 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1152 counts and offsets against file size.
1153 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1154 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1155 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1156 against file size. Delete symbol table error message.
1157 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1158 against file size.
1159 (bfd_mach_o_read_symtab): Likewise.
1160 (bfd_mach_o_read_command): Pass file size.
1161 (bfd_mach_o_scan): Sanity check command count against file size.
1162
dda2980f
AM
11632020-02-21 Alan Modra <amodra@gmail.com>
1164
1165 PR 25569
1166 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1167 "text", "data" and "bss" section pointer vars. Don't update
1168 section size, just exec header sizes.
1169 (adjust_sizes_and_vmas): Don't update text section size. Set
1170 initial exec header a_text. Print exec headers sizes.
1171 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1172 (adjust_sizes_and_vmas): Similarly. Formatting.
1173 (final_link): Correct final file extension.
1174
00e49dff
NC
11752020-02-20 Nick Clifton <nickc@redhat.com>
1176
1177 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1178 callback.
1179 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1180 default definition.
1181 (elfNN_bed): Initialise the symbol_section_index field.
1182 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1183 OS and PROC specific section indicies. Warn if converting other
1184 reserved incidies to SHN_ABS.
1185
fcaaac0a
SB
11862020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1187
1188 PR 25537
1189 * cpu-z80.c: Add machine type compatibility checking.
1190
dcf06b89
L
11912020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1192
1193 PR binutils/25355
1194 * plugin.c (plugin_list_entry): Remove handle.
1195 (try_load_plugin): Call dlclose before return.
1196
2c7c5554
AM
11972020-02-19 Alan Modra <amodra@gmail.com>
1198
1199 * libbfd-in.h (_bfd_constant_p): Define.
1200 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1201 file size before allocating memory.
1202 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1203 * elf.c (bfd_elf_get_str_section): Likewise.
1204 (_bfd_elf_slurp_version_tables): Likewise.
1205 * libbfd.h: Regenerate.
1206
2bb3687b
AM
12072020-02-19 Alan Modra <amodra@gmail.com>
1208
1209 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1210 * aoutx.h (aout_get_external_symbols): Replace calls to
1211 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1212 (slurp_reloc_table): Likewise.
1213 * archive.c (do_slurp_bsd_armap): Likewise.
1214 (do_slurp_coff_armap): Likewise.
1215 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1216 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1217 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1218 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1219 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1220 (_bfd_coff_get_external_symbols): Likewise.
1221 * ecoff.c (ecoff_slurp_symbolic_header),
1222 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1223 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1224 (ecoff_indirect_link_order): Likewise.
1225 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1226 (_bfd_elf_slurp_version_tables): Likewise.
1227 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1228 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1229 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1230 * elf64-alpha.c (READ): Likewise.
1231 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1232 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1233 * elfcode.h (elf_slurp_symbol_table),
1234 (elf_slurp_reloc_table_from_section): Likewise.
1235 * elflink.c (elf_link_add_object_symbols),
1236 (elf_link_check_versioned_symbol): Likewise.
1237 * elfxx-mips.c (READ): Likewise.
1238 * i386lynx.c (slurp_reloc_table): Likewise.
1239 * lynx-core.c (lynx_core_file_p): Likewise.
1240 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1241 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1242 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1243 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1244 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1245 (bfd_pef_parse_symbols): Likewise.
1246 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1247 * som.c (setup_sections, som_slurp_string_table),
1248 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1249 (som_bfd_fill_in_ar_symbols): Likewise.
1250 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1251 (evax_bfd_print_image): Likewise.
1252 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1253 * wasm-module.c (wasm_scan): Likewise.
1254 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1255 * xsym.c (bfd_sym_read_name_table),
1256 (bfd_sym_print_type_information_table_entry): Likewise.
1257 * libbfd.h: Regenerate.
1258
806470a2
AM
12592020-02-19 Alan Modra <amodra@gmail.com>
1260
1261 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1262 reading external relocs.
1263 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1264 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1265 after bfd_bread.
1266 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1267 bfd_release.
1268 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1269 (m32c_elf_relax_section): Likewise.
1270 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1271 (rl78_elf_relax_section): Likewise.
1272 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1273 (elf32_rx_relax_section): Likewise.
1274 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1275 parameter types and use..
1276 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1277 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1278 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1279 being read from file, just the extra.
1280 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1281 after reading external syms. Free on failure.
1282
1f4361a7
AM
12832020-02-19 Alan Modra <amodra@gmail.com>
1284
1285 * coffcode.h (buy_and_read, coff_slurp_line_table),
1286 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1287 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1288 corresponding bfd_alloc call. Adjust variables to suit.
1289 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1290 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1291 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1292 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1293 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1294 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1295 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1296 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1297 * elf64-alpha.c (READ): Likewise.
1298 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1299 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1300 (bfd_from_remote_memory): Likewise.
1301 * elfcore.h (core_find_build_id): Likewise.
1302 * elfxx-mips.c (READ): Likewise.
1303 * mach-o.c (bfd_mach_o_mangle_sections),
1304 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1305 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1306 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1307 * som.c (setup_sections, som_prep_for_fixups)
1308 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1309 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1310 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1311 (som_bfd_ar_write_symbol_stuff): Likewise.
1312 * vms-alpha.c (vector_grow1): Likewise.
1313 * vms-lib.c (vms_add_index): Likewise.
1314 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1315 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1316 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1317 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1318 (bfd_alloc2, bfd_zalloc2): Delete.
1319 (_bfd_mul_overflow): Define.
1320 * libbfd.h: Regenerate.
1321
446f7ed5
AM
13222020-02-19 Alan Modra <amodra@gmail.com>
1323
1324 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1325 bfd_zalloc2.
1326 (assign_section_numbers): Likewise.
1327 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1328 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1329 bfd_malloc2, size_t amt, and unsigned tls_count.
1330 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1331 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1332 (elf_output_implib): Use bfd_alloc.
1333
b03202e3
AM
13342020-02-19 Alan Modra <amodra@gmail.com>
1335
1336 * bfd.c (struct bfd): Move format and direction to other
1337 bitfields. Add "size".
1338 * bfdio.c (bfd_get_size): Cache size when not writing file.
1339 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1340 returning zero, ie. unknown.
1341 (bfd_get_alt_debug_link_info): Likewise.
1342 * bfd-in2.h: Regenerate.
1343
7c5fa58e
AM
13442020-02-19 Alan Modra <amodra@gmail.com>
1345
1346 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1347 bfd_get_file_size twice.
1348 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1349 zero, ie. unknown, return.
1350 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1351 * elfcode.h (elf_swap_shdr_in): Likewise.
1352 (elf_object_p): Don't call bfd_get_file_size twice and correct
1353 file size check.
1354
96d3b80f
AM
13552020-02-19 Alan Modra <amodra@gmail.com>
1356
1357 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1358 FALSE if memory alloc fails. Adjust calls.
1359 * som.c (som_prep_for_fixups): Likewise.
1360 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1361 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1362 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1363 * som.c (som_build_and_write_symbol_table): Return via error_return
1364 on seek failure.
1365 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1366 (VEC_APPEND_EL): Delete.
1367 (vector_grow1): Return pointer to element. Catch overflow.
1368 Return NULL on memory allocation failure.
1369 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1370 (alpha_vms_add_fixup_ca): Likewise.
1371 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1372 before using.
1373 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1374
986f0783
AM
13752020-02-19 Alan Modra <amodra@gmail.com>
1376
1377 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1378 * aout-target.h (object_p): Likewise.
1379 * aout-tic30.c (tic30_aout_object_p): Likewise.
1380 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1381 (emit_stringtab, write_syms, link_hash_table_create),
1382 (aout_link_write_other_symbol): Likewise.
1383 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1384 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1385 (_bfd_compute_and_write_armap): Likewise.
1386 * archures.c (bfd_arch_list): Likewise.
1387 * bfd.c (bfd_record_phdr): Likewise.
1388 * binary.c (binary_canonicalize_symtab): Likewise.
1389 * cisco-core.c (cisco_core_file_validate): Likewise.
1390 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1391 (find_arm_glue, record_arm_to_thumb_glue),
1392 (record_thumb_to_arm_glue): Likewise.
1393 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1394 (ppc_allocate_toc_section): Likewise.
1395 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1396 * coff-sh.c (sh_relax_section): Likewise.
1397 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1398 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1399 (coff_set_alignment_hook, coff_mkobject),
1400 (coff_compute_section_file_positions): Likewise.
1401 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1402 (coff_find_nearest_line_with_names),
1403 ( bfd_coff_set_symbol_class): Likewise.
1404 * cofflink.c (_bfd_coff_link_hash_table_create),
1405 (_bfd_coff_link_input_bfd): Likewise.
1406 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1407 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1408 (build_line_info_table, sort_line_sequences),
1409 (line_info_add_include_dir, line_info_add_file_name),
1410 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1411 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1412 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1413 (_bfd_ecoff_find_nearest_line),
1414 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1415 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1416 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1417 * elf-m10300.c (mn10300_elf_relax_section),
1418 (elf32_mn10300_link_hash_table_create): Likewise.
1419 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1420 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1421 * elf32-arm.c (elf32_arm_link_hash_table_create),
1422 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1423 (elf32_arm_new_section_hook): Likewise.
1424 * elf32-avr.c (elf_avr_new_section_hook),
1425 (elf32_avr_link_hash_table_create, get_local_syms),
1426 (elf32_avr_setup_section_lists): Likewise.
1427 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1428 (bfin_link_hash_table_create): Likewise.
1429 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1430 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1431 * elf32-csky.c (csky_elf_link_hash_table_create),
1432 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1433 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1434 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1435 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1436 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1437 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1438 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1439 (m32r_elf_check_relocs): Likewise.
1440 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1441 (elf32_m68hc11_setup_section_lists),
1442 (elf32_m68hc11_size_stubs): Likewise.
1443 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1444 * elf32-metag.c (elf_metag_link_hash_table_create),
1445 (elf_metag_setup_section_lists): Likewise.
1446 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1447 (microblaze_elf_check_relocs): Likewise.
1448 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1449 (nds32_elf_check_relocs): Likewise.
1450 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1451 (get_local_syms, nios2_elf32_check_relocs),
1452 (nios2_elf32_link_hash_table_create): Likewise.
1453 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1454 (or1k_elf_check_relocs): Likewise.
1455 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1456 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1457 * elf32-s390.c (elf_s390_link_hash_table_create),
1458 (elf_s390_check_relocs): Likewise.
1459 * elf32-score.c (score_elf_create_got_section),
1460 (s3_elf32_score_new_section_hook),
1461 (elf32_score_link_hash_table_create): Likewise.
1462 * elf32-score7.c (score_elf_create_got_section),
1463 (s7_elf32_score_new_section_hook): Likewise.
1464 * elf32-sh.c (sh_elf_link_hash_table_create),
1465 (sh_elf_check_relocs): Likewise.
1466 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1467 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1468 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1469 (tilepro_elf_check_relocs): Likewise.
1470 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1471 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1472 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1473 (elf_xtensa_new_section_hook): Likewise.
1474 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1475 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1476 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1477 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1478 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1479 * elf64-ppc.c (ppc64_elf_new_section_hook),
1480 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1481 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1482 * elf64-s390.c (elf_s390_link_hash_table_create),
1483 (elf_s390_check_relocs): Likewise.
1484 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1485 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1486 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1487 (elf_link_add_archive_symbols, compute_bucket_count),
1488 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1489 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1490 (bfd_elf_final_link): Likewise.
1491 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1492 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1493 (elfNN_aarch64_new_section_hook): Likewise.
1494 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1495 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1496 (riscv_elf_check_relocs): Likewise.
1497 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1498 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1499 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1500 (_bfd_mips_elf_link_hash_table_create): Likewise.
1501 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1502 (_bfd_sparc_elf_check_relocs),
1503 (_bfd_sparc_elf_new_section_hook): Likewise.
1504 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1505 (tilegx_elf_check_relocs): Likewise.
1506 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1507 * format.c (bfd_check_format_matches): Likewise.
1508 * hash.c (_bfd_stringtab_init): Likewise.
1509 * ihex.c (ihex_scan): Likewise.
1510 * irix-core.c (irix_core_core_file_p): Likewise.
1511 * linker.c (bfd_wrapped_link_hash_lookup),
1512 (_bfd_generic_link_hash_table_create),
1513 (_bfd_generic_reloc_link_order): Likewise.
1514 * lynx-core.c (lynx_core_file_p): Likewise.
1515 * netbsd-core.c (netbsd_core_file_p): Likewise.
1516 * osf-core.c (osf_core_core_file_p): Likewise.
1517 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1518 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1519 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1520 * peicode.h (pe_mkobject): Likewise.
1521 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1522 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1523 * sco5-core.c (read_uarea): Likewise.
1524 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1525 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1526 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1527 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1528 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1529 * srec.c (srec_scan): Likewise.
1530 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1531 * targets.c (bfd_target_list): Likewise.
1532 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1533 * trad-core.c (trad_unix_core_file_p): Likewise.
1534 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1535 (vms_new_section_hook): Likewise.
1536 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1537 * xcofflink.c (xcoff_get_section_contents),
1538 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1539 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1540 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1541
2d0e1217
AM
15422020-02-19 Alan Modra <amodra@gmail.com>
1543
1544 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1545
99845b3b
L
15462020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1547
1548 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1549 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1550 a build_list_p argument. Don't search plugin_list. Short circuit
1551 when building the plugin list.
1552 (has_plugin): Renamed to has_plugin_list.
1553 (bfd_plugin_set_plugin): Don't set has_plugin.
1554 (bfd_plugin_specified_p): Check plugin_list instead.
1555 (build_plugin_list): New function.
1556 (load_plugin): Call build_plugin_list and use plugin_list.
1557
22fe7df8
L
15582020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1559
1560 PR binutils/25355
1561 * plugin.c (try_claim): Always clean up for LTO wrapper.
1562 (try_load_plugin): Treat each object as independent. Create a
1563 copy for plugin name.
1564
c675ec1e
NC
15652020-02-11 Nick Clifton <nickc@redhat.com>
1566
1567 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1568 for addresses in print statements.
1569 (msp430_elf_relax_delete_bytes): Likewise.
1570 (msp430_elf_relax_add_words): Likewise.
1571 (msp430_elf_relax_section): Likewise.
1572
1d07a805
L
15732020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1574
1575 * plugin.c (add_symbols): Clear plugin_data memory.
1576
0aa99dcd
L
15772020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1578
1579 PR binutils/25355
1580 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1581 (EXECUTABLE_SUFFIX): Likewise.
1582 * config.in: Regenerated.
1583 * configure: Likewise.
1584 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1585 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1586 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1587 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1588 (get_lto_wrapper): New.
1589 (setup_lto_wrapper_env): Likewise.
1590 (current_plugin): Likewise.
1591 (register_all_symbols_read): Likewise.
1592 (register_cleanup): Likewise.
1593 (get_symbols): Likewise.
1594 (add_input_file): Likewise.
1595 (bfd_plugin_close_and_cleanup): Likewise.
1596 (claim_file): Removed.
1597 (register_claim_file): Set current_plugin->claim_file.
1598 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1599 lto_syms in current_plugin.
1600 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1601 all_symbols_read handler. Copy real symbols to plugin_data.
1602 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1603 (try_load_plugin): Don't reuse the previous plugin for LTO
1604 wrapper. Set up GCC LTO wrapper if possible. Don't set
1605 plugin_list_iter->claim_file.
1606 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1607 possible.
1608 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1609 real_syms.
1610
ac4280da
JL
16112020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1612
1613 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1614 check if previous instruction matches a conditional jump inserted
1615 earlier. Invert conditional jump and delete branch in this case.
1616
8d6cb116
JL
16172020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1618
1619 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1620 msp430_elf_relax_add_words. Support insertion of either one or two
1621 words.
1622 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1623 needs to be grown. Handle insertion of branch instruction to replace
1624 jump.
1625
d60f5448
JL
16262020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1627
1628 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1629 debugging relocations.
1630 (msp430_elf_relax_delete_bytes): Likewise.
1631 (msp430_elf_relax_add_two_words): Likewise.
1632 (msp430_elf_relax_section): Likewise.
1633
e1f85e11
AM
16342020-02-10 Alan Modra <amodra@gmail.com>
1635
1636 * archures.c: Wrap overlong z80 comments.
1637 * bfd-in2.h: Regenerate.
1638
9fc0b501
SB
16392020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1640
1641 PR 25469
1642 * archures.c: Add GBZ80 and Z80N machine values.
1643 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1644 * coff-z80.c: Add support for new reloc.
1645 * coffcode.h: Add support for new machine values.
1646 * cpu-z80.c: Add support for new machine names.
1647 * elf32-z80.c: Add support for new reloc.
1648 * bfd-in2.h: Regenerate.
1649 * libbfd.h: Regenerate.
1650
9984857c
NC
16512020-02-07 Nick Clifton <nickc@redhat.com>
1652
1653 PR 23932
1654 * elf.c (rewrite_elf_program_header): Do not complain if no
1655 sections are mapped to a segment.
1656
5242a0a0
L
16572020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1658
1659 PR ld/25490
1660 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1661 for garbage collection on __patchable_function_entries section
1662 without linked-to section.
1663
b7d07216
L
16642020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1665
1666 PR gas/25381
1667 * bfd-in2.h: Regenerated.
1668 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1669 on section if gc_mark of any of its linked-to sections is set
1670 and don't set gc_mark again.
1671 * section.c (asection): Add linked_to_symbol_name to map_head
1672 union.
1673
b93a662b
MR
16742020-02-06 Maciej W. Rozycki <macro@wdc.com>
1675
1676 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1677 reporting an unrecognized instruction with R_V850_LONGJUMP.
1678
6df4c9c2
AM
16792020-02-05 Alan Modra <amodra@gmail.com>
1680
1681 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1682
24872cb3
AM
16832020-02-04 Alan Modra <amodra@gmail.com>
1684
1685 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1686 R_PPC_VLE_ADDR20, goto copy_reloc.
1687
ef4627fa
L
16882020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1689
1690 * bfd-in2.h: Regenerated.
1691 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1692
a8c4d40b
L
16932020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1694
1695 PR gas/25380
1696 * bfd-in2.h: Regenerated.
1697 * ecoff.c (bfd_debug_section): Add section_id.
1698 * section.c (bfd_section): Add section_id.
1699 (SEC_ASSEMBLER_SECTION_ID): New.
1700 (BFD_FAKE_SECTION): Add section_id.
1701
5a9212a1
NC
17022020-02-01 Nick Clifton <nickc@redhat.com>
1703
1704 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1705 obsolete list.
1706
e7cbe0c4
SL
17072020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1708
1709 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1710 encodings are relative to the GOT on nios2, too.
1711
72ebe8c5
AM
17122020-01-31 Alan Modra <amodra@gmail.com>
1713
1714 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1715 file. Use $< and $@ in rules.
1716 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1717 (elf32-ia64.c, elf64-ia64.c): Likewise.
1718 (elf32-riscv.c, elf64-riscv.c): Likewise.
1719 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1720 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1721 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1722 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1723 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1724 * Makefile.in: Regenerate.
1725
327301a4
AM
17262020-01-31 Alan Modra <amodra@gmail.com>
1727
1728 PR 4110
1729 * elf.c (setup_group): Don't clear entire section contents,
1730 just the padding after group flags. Release alloc'd memory
1731 after a seek or read failure.
1732
b5d36aaa
JT
17332020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1734
1735 * peXXigen.c (pe_is_repro): New function.
1736 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1737 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1738
1957ab10
JT
17392020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1740
1741 * peXXigen.c (debug_type_names): Add names for new debug data type
1742 values.
1743
87b2920f
JT
17442020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1745
1746 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1747 inner loop. Fix a memory leak.
1748
72913831
AM
17492020-01-30 Alan Modra <amodra@gmail.com>
1750
1751 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1752 or obj_coff_keep_strings here.
1753 (coff_get_normalized_symtab): Free external syms directly.
1754 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1755 on error exit path.
1756
c35d018b
JW
17572020-01-27 Jim Wilson <jimw@sifive.com>
1758
1759 * cpu-riscv.c (riscv_scan): New.
1760 (N): Change bfd_default_scan to riscv_scan.
1761
086b06f3
AS
17622020-01-27 Andreas Schwab <schwab@suse.de>
1763
1764 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1765 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1766 * Makefile.in: Regenerate.
1767 * cpu-plugin.c: Remove.
1768 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1769 (bfd_plugin_arch): Remove declaration.
1770 * bfd-in2.h: Regenerate.
1771 * po/SRC-POTFILES.in: Regenerate.
1772
3024a17a
AM
17732020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1774 Alan Modra <amodra@gmail.com>
1775
1776 PR ld/25458
1777 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1778
b5f998b2
JW
17792020-01-24 Jim Wilson <jimw@sifive.com>
1780
1781 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1782 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1783 avoid over long line.
1784
caa31cfa
NC
17852020-01-24 Nick Clifton <nickc@redhat.com>
1786
1787 PR 25447
1788 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1789 syms and keep strings flags as these may have been set in order to
1790 prevent a bogus call to free.
1791
24e648d4
NC
17922020-01-23 Nick Clifton <nickc@redhat.com>
1793
1794 * po/fr.po: Updated French translation.
1795
67641dd3
AM
17962020-01-23 Alan Modra <amodra@gmail.com>
1797
1798 PR 25444
1799 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1800 by zero when p_align is zero.
1801
403d1bd9
JW
18022020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1803
1804 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1805 (riscv_prefix_cmp): Likewise.
1806 (riscv_non_std_ext_p): Deleted.
1807 (riscv_std_sv_ext_p): Likewise.
1808 (riscv_non_std_sv_ext_p): Likewise.
1809 (riscv_merge_non_std_and_sv_ext): Rename to...
1810 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1811 (riscv_merge_arch_attr_info): Replace 3 calls to
1812 riscv_merge_non_std_and_sv_ext with single call to
1813 riscv_merge_multi_letter_ext.
1814 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1815 encounter a 'z' prefix.
1816 (riscv_get_prefix_class): New function, return prefix class based
1817 on first few characters of input string.
1818 (riscv_parse_config): New structure to factor out minor differences
1819 in extension class parsing behaviour.
1820 (riscv_parse_sv_or_non_std_ext): Rename to...
1821 (riscv_parse_prefixed_ext): and parameterise with
1822 riscv_parse_config.
1823 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1824 (riscv_multi_letter_ext_valid_p): New.
1825 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1826 (riscv_parse_subset): Delegate all non-single-letter parsing work
1827 to riscv_parse_prefixed_ext.
1828 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1829 (riscv_get_prefix_class): Declare.
1830
a804e476
AM
18312020-01-22 Alan Modra <amodra@gmail.com>
1832
1833 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1834 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1835 __tls_get_addr_desc.
1836 (ppc64_elf_size_stubs): Add section for linker generated
1837 __tls_get_addr_desc wrapper function. Loop at least once if
1838 generating this function.
1839 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1840 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1841
9e7028aa
AM
18422020-01-22 Alan Modra <amodra@gmail.com>
1843
1844 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1845 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1846 tga_desc_fd.
1847 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1848 (STDU_R1_0R1, ADDI_R1_R1): Define.
1849 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1850 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1851 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1852 no_tls_get_addr_regsave.
1853 (branch_reloc_hash_match): Add hash3 and hash4.
1854 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1855 (ppc64_elf_size_dynamic_sections): Likewise.
1856 (ppc64_elf_relocate_section): Likewise.
1857 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1858 __tls_get_addr stub.
1859 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1860 eh_frame.
1861 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1862 eh_frame for regsave __tls_get_addr.
1863
abc489c6
AM
18642020-01-22 Alan Modra <amodra@gmail.com>
1865
1866 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1867 which __tls_get_addr calls will be eliminated.
1868
26916852
NC
18692020-01-20 Nick Clifton <nickc@redhat.com>
1870
1871 * po/pt.po: Updates Portuguese translation.
1872 * po/ru.po: Updated Russian translation.
1873 * po/uk.po: Updated Ukranian translation.
1874
14470f07
L
18752020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1876
1877 PR ld/25416
1878 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1879 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1880 X32 mode.
1881 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1882 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1883 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1884 "rex leal x@tlsdesc(%rip), %reg" to
1885 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1886 "call *(%eax)" to "nopl (%rax)".
1887
b9ca1af6
AM
18882020-01-20 Alan Modra <amodra@gmail.com>
1889
1890 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1891 (MTLR_R11): Don't define.
1892 (LD_R0_0R3, CMPDI_R0_0): Define.
1893 (build_tls_get_addr_stub): Don't use r11 in stub.
1894
ed7007c1
AM
18952020-01-20 Alan Modra <amodra@gmail.com>
1896
1897 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1898 (defined_sym_val, is_tls_get_addr): Likewise.
1899
1b1bb2c6
NC
19002020-01-18 Nick Clifton <nickc@redhat.com>
1901
1902 * version.m4 (BFD_VERSION): Set to 2.34.50.
1903 * configure: Regenerate.
1904 * po/bfd.pot: Regenerate.
1905
ae774686
NC
19062020-01-18 Nick Clifton <nickc@redhat.com>
1907
1908 Binutils 2.34 branch created.
1909
07f1f3aa
CB
19102020-01-17 Christian Biesinger <cbiesinger@google.com>
1911
1912 * coff-arm.c: Fix spelling error (seperate).
1913 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1914 error (seperate).
1915 * sysdep.h (strnlen): Fix spelling error (seperate).
1916
0d1cc75d
LB
19172020-01-15 Lars Brinkhoff <lars@nocrew.org>
1918
1919 PR 20694
1920 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1921
e1c6cf61
AM
19222020-01-15 Alan Modra <amodra@gmail.com>
1923
1924 PR 25384
1925 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1926 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1927 of function symbols unless dot symbols are present. Do warn
1928 whenever one is created, regardles of whether a PLT entry is
1929 also emitted for the function symbol.
1930
ef4e5ba5
AM
19312020-01-14 Alan Modra <amodra@gmail.com>
1932
1933 * som.c (som_bfd_count_ar_symbols): Error when file position
1934 of symbols on chains is not strictly increasing.
1935
8ab484c2
AM
19362020-01-14 Alan Modra <amodra@gmail.com>
1937
1938 * vms.h (VMS_DEBUG): Define as 0.
1939 * vms-alpha.c (image_write): Move debug output after bounds check.
1940 Tidy bounds check.
1941 (_bfd_vms_slurp_eihd): Warning fix.
1942 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1943
b50ef514
AM
19442020-01-13 Alan Modra <amodra@gmail.com>
1945
1946 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1947 for "ignored" records.
1948
0c0adcc5
AM
19492020-01-13 Alan Modra <amodra@gmail.com>
1950
1951 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1952 Delete asect name check. Move asect NULL check to wasm_object_p.
1953 Correct bounds check of sizes against end. Replace uses of
1954 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1955 just one bfd_release.
1956 (wasm_scan): Don't use malloc/strdup for section names,
1957 bfd_alloc instead. Simplify code prefixing section name.
1958 Formatting. Don't attempt to free memory here..
1959 (wasm_object_p): ..do so here.
1960
7f026732
SN
19612020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1962
1963 PR ld/22269
1964 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1965 UNDEFWEAK_NO_DYNAMIC_RELOC.
1966 (allocate_dynrelocs_for_symbol): Likewise.
1967
8cd0e5e9
TC
19682020-01-10 Tamar Christina <tamar.christina@arm.com>
1969
1970 PR 25210
1971 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1972
71780f45
AM
19732020-01-10 Alan Modra <amodra@gmail.com>
1974
1975 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1976
b899eb3b
NC
19772020-01-09 Nick Clifton <nickc@redhat.com>
1978
1979 PR 25221
1980 * bfd.c (bfd_convert_section_contents): Check for a compress
1981 header size that is larger than the actual section size.
1982
4c6ee646
AM
19832020-01-08 Alan Modra <amodra@gmail.com>
1984
1985 PR 25351
1986 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1987 after removing sections.
1988
85f78364
JW
19892020-01-06 Jim Wilson <jimw@sifive.com>
1990
1991 PR 25205
1992 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1993 check for !bfd_link_pic (info).
1994 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1995 <R_RISCV_JAL>: Add comment.
1996 (_bfd_riscv_relax_section): For plt.offset check, add check for
1997 bfd_link_pic (info). Add comment.
1998
49078ece
AM
19992020-01-06 Alan Modra <amodra@gmail.com>
2000
2001 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2002 match failures. Don't init to bfd_error_wrong_format before
2003 calling _bfd_check_format.
2004
ab356be7
AM
20052020-01-06 Alan Modra <amodra@gmail.com>
2006
2007 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2008 status rather than exiting on stack overflow or underflow.
2009 (_bfd_vms_slurp_etir): Adjust to suit.
2010
85d86817
AM
20112020-01-06 Alan Modra <amodra@gmail.com>
2012
2013 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2014
3e6aa775
AM
20152020-01-06 Alan Modra <amodra@gmail.com>
2016
2017 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2018 command. Check name offset is within command.
2019 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2020 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2021 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2022 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2023 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2024 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2025 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2026 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2027 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2028 (bfd_mach_o_read_segment): Similarly.
2029 (bfd_mach_o_read_thread): Properly bound check thread struct.
2030 Don't repeat checks on second loop.
2031 (bfd_mach_o_read_command): Fail on invalid command length.
2032
ea933f17
AM
20332020-01-04 Alan Modra <amodra@gmail.com>
2034
2035 * format.c (bfd_check_format_matches): Add preserve_match.
2036 Save initial bfd state in "preserve", matched bfd state in
2037 "preserve_match". Save just the first match. Release
2038 bfd_alloc memory. Restore and finish preserved state as
2039 appropriate on all function exit paths.
2040
f24bdec4
AM
20412020-01-04 Alan Modra <amodra@gmail.com>
2042
2043 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2044
991fb595
AM
20452020-01-04 Alan Modra <amodra@gmail.com>
2046
2047 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2048 match too.
2049
f2a3559d
NC
20502020-01-03 Nick Clifton <nickc@redhat.com>
2051
2052 PR 25307
2053 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2054 there is enough data remaining in the code buffer before
2055 attempting to read a function stub.
2056
7a0fb7be
NC
20572020-01-03 Nick Clifton <nickc@redhat.com>
2058
2059 PR 25308
2060 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2061 return value from bfd_malloc.
2062 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2063 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2064 (elf32_arm_filter_cmse_symbols): Likewise.
2065 (elf32_arm_write_section): Likewise.
2066 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2067 (bfd_mach_o_follow_dsym): Likewise.
2068 * pef.c (bfd_pef_print_loader_section): Likewise.
2069 (bfd_pef_scan_start_address): Likewise.
2070 (bfd_pef_parse_function_stubs): Likewise.
2071 (bfd_pef_parse_symbols): Likewise.
2072
b26a3d58
ST
20732020-01-03 Sergei Trofimovich <siarheit@google.com>
2074
2075 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2076 on binary inputs ld/PR25316.
2077 (is_ia64_elf): new helper to filter on ia64 objects.
2078
4bb7a87e
JB
20792020-01-03 Jan Beulich <jbeulich@suse.com>
2080
2081 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2082 in parameter names.
2083 (bfd_mach_o_scan): Insert underscore in two variable names.
2084
6655dba2
SB
20852020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2086
2087 * Makefile.am: Add z80-elf target support.
2088 * configure.ac: Likewise.
2089 * targets.c: Likewise.
2090 * Makefile.in: Regenerate.
2091 * configure: Regenerate.
2092 * config.bfd: Add z80-elf target support and new arches: ez80 and
2093 z180.
2094 * elf32-z80.c: New file.
2095 * archures.c: Add new z80 architectures: eZ80 and Z180.
2096 * coffcode.h: Likewise.
2097 * cpu-z80.c: Likewise.
2098 * coff-z80.c: Add new relocations for Z80 target and local label
2099 check.
2100 * reloc.c: Add new relocs.
2101 * bfd-in2.h: Regenerate.
2102 * libbfd.h: Regenerate.
2103
0db131fb
TC
21042020-01-02 Tamar Christina <tamar.christina@arm.com>
2105
2106 PR 25210
2107 PR 24753
2108 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2109
b14ce8bf
AM
21102020-01-01 Alan Modra <amodra@gmail.com>
2111
2112 Update year range in copyright notice of all files.
2113
0b114740 2114For older changes see ChangeLog-2019
3499769a 2115\f
0b114740 2116Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
2117
2118Copying and distribution of this file, with or without modification,
2119are permitted in any medium without royalty provided the copyright
2120notice and this notice are preserved.
2121
2122Local Variables:
2123mode: change-log
2124left-margin: 8
2125fill-column: 74
2126version-control: never
2127End: