]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/ChangeLog
Fix value_literal_complex comment
[thirdparty/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
a7618269
TC
12020-04-01 Tamar Christina <tamar.christina@arm.com>
2
3 PR ld/16017
4 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
5 address in the GOT if in thumb only mode.
6
15ccbdd7
TC
72020-04-01 Tamar Christina <tamar.christina@arm.com>
8
9 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
10
7b948a25
HPN
112020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
12
13 * mmo.c (mmo_scan): Create .text section only when needed, not
14 from the start.
15
89b599df
AM
162020-03-31 Alan Modra <amodra@gmail.com>
17
18 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
19 return value check.
20
81699544
AM
212020-03-31 Alan Modra <amodra@gmail.com>
22
23 * vms-alpha.c (image_write): Check bounds for sections without
24 contents too. Error on non-zero write to section without
25 contents.
26 (_bfd_vms_slurp_etir): Check return of image_write* functions.
27
b3b360de
AM
282020-03-31 Alan Modra <amodra@gmail.com>
29
30 * tekhex.c (pass_over): Check is_eof before reading buffer.
31
00386881
NC
322020-03-30 Nick Clifton <nickc@redhat.com>
33
34 PR binutils/pr25662
35 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
36 field to timestamp and make it an integer.
37 * libcoff.h: Regenerate.
38 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
39 field in the pe_data structure rather than the insert_timestamp
40 field.
41
988b7300
AM
422020-03-30 Alan Modra <amodra@gmail.com>
43
44 PR 25745
45 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
46 statistics message.
47
aa49fc22
NC
482020-03-26 Nick Clifton <nickc@redhat.com>
49
50 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
51 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
52 prototype.
53 * libbfd.h: Regenerate.
54
ff768510
AM
552020-03-26 Alan Modra <amodra@gmail.com>
56
57 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
58
f75fbe8a
AM
592020-03-26 Alan Modra <amodra@gmail.com>
60
61 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
62 array.
63 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
64
aac88046
NC
652020-03-25 Nick Clifton <nickc@redhat.com>
66
67 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
68 function.
69 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
70 * libbfd.h: Regenerate.
71
cf2611fe
SV
722020-03-25 Shahab Vahedi <shahab@synopsys.com>
73
74 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
75 correct field name in the output string.
76
d16e3d2e
AM
772020-03-25 Alan Modra <amodra@gmail.com>
78
79 PR 25662
80 * elf.c (assign_file_positions_for_load_sections): Adjust offset
81 for SHT_NOBITS section if first in segment.
82
1081065c
L
832020-03-24 H.J. Lu <hongjiu.lu@intel.com>
84
85 PR binutils/25708
86 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
87 (_bfd_elf_get_symbol_version_string): This.
88 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
89 (_bfd_elf_get_symbol_version_string): This.
90 (bfd_elf_print_symbol): Pass TRUE to
91 _bfd_elf_get_symbol_version_string.
92 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
93 bfd_boolean argument.
94 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
95 * targets.c (_bfd_get_symbol_version_string): Likewise.
96 (bfd_get_symbol_version_string): Likewise.
97 * bfd-in2.h: Regenerated.
98
0b8448af 992020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 100 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
101
102 PR 25713
103 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
104 Win32 systems.
105
ec2e748a
NC
1062020-03-24 Nick Clifton <nickc@redhat.com>
107
108 PR 25681
109 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
110 segment to use for PT_GNU_RELRO, ignore empty sections in a
111 segment's current list.
112
cda7e560
L
1132020-03-24 H.J. Lu <hongjiu.lu@intel.com>
114
115 PR binutils/25717
116 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
117
7e6e972f
L
1182020-03-24 H.J. Lu <hongjiu.lu@intel.com>
119
120 PR binutils/25708
121 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
122 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
123 on the previous _bfd_elf_get_symbol_version_string.
124 (_bfd_elf_get_symbol_version_string): Use it.
125
65109548
AM
1262020-03-24 Alan Modra <amodra@gmail.com>
127
128 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
129 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
130 struct areltdata.
131
fdde2fb6
SH
1322020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
133
134 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
135
cf28cfef
AM
1362020-03-23 Alan Modra <amodra@gmail.com>
137
138 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
139 symbol count. Allocate an extra byte to ensure name strings
140 are terminated. Sanity check name offsets. Release memory on
141 error return.
142
5e737279
AM
1432020-03-23 Alan Modra <amodra@gmail.com>
144
145 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
146 field hasn't been read. Remove unnecessary casts.
147
c15a8f17
AM
1482020-03-22 Alan Modra <amodra@gmail.com>
149
150 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
151 enough to read number of symbols.
152
3d98c460
L
1532020-03-20 H.J. Lu <hongjiu.lu@intel.com>
154
155 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
156 (EXECUTABLE_SUFFIX): Likewise.
157 * config.in: Regenerated.
158 * configure: Likewise.
159 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
160 _bfd_generic_close_and_cleanup.
161 (plugin_list_entry): Remove resolution_file, resolution_option,
162 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
163 lto_wrapper, gcc_env and initialized,
164 (need_lto_wrapper_p): Removed.
165 (get_lto_wrapper): Likewise.
166 (setup_lto_wrapper_env): Likewise.
167 (register_all_symbols_read): Likewise.
168 (egister_cleanup): Likewise.
169 (get_symbols): Likewise.
170 (add_input_file): Likewise.
171 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
172 (add_symbols): Updated.
173 (try_claim): Likewise.
174 (try_load_plugin): Likewise.
175 (bfd_plugin_canonicalize_symtab): Likewise.
176 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
177 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
178
c3a1714c
L
1792020-03-19 H.J. Lu <hongjiu.lu@intel.com>
180
181 PR binutils/25640
182 * plugin.c (plugin_list_entry): Add has_symbol_type.
183 (add_symbols_v2): New function.
184 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
185 provides symbol type.
186 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
187 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
188 available.
189
67338173
AM
1902020-03-20 Alan Modra <amodra@gmail.com>
191
192 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
193 enough to read number of symbols.
194
a859124d
AM
1952020-03-20 Alan Modra <amodra@gmail.com>
196
197 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
198 backend functions for NULL before calling.
199 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
200 (bfd_section_from_shdr, assign_section_numbers): Likewise.
201 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
202 * elfnn-ia64.c (ignore_errors): New function.
203 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
204
f3a08f77
NC
2052020-03-19 Nick Clifton <nickc@redhat.com>
206
207 PR 25676
208 * dwarf2.c (struct varinfo): Add unit_offset field to record the
209 location of the varinfo in the unit's debug info data. Change the
210 type of the stack field to a boolean.
211 (lookup_var_by_offset): New function. Returns the varinfo
212 structure for the variable described at the given offset in the
213 unit's debug info.
214 (scan_unit_for_symbols): Add support for variables which have the
215 DW_AT_specification attribute.
216
6a541707
NC
2172020-03-19 Nick Clifton <nickc@redhat.com>
218
219 PR 25699
220 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
221 error return.
222
effc14f5
SH
2232020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
224
225 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
226
ac4bf06c
NC
2272020-03-18 Nick Clifton <nickc@redhat.com>
228
229 PR 25673
230 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
231 memory access when processing a corrupt secondary reloc section.
232
53215f21
CL
2332020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
234
235 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
236 instead of calling abort.
237 * elf32-csky.c (csky_build_one_stub): Likewise.
238 * elf32-hppa.c (hppa_build_one_stub): Likewise.
239 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
240 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
241 * elf32-metag.c (metag_build_one_stub): Likewise.
242 * elf32-nios2.c (nios2_build_one_stub): Likewise.
243 * elf64-ppc.c (ppc_build_one_stub): Likewise.
244 (ppc_size_one_stub): Likewise.
245 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
246
327ef784
NC
2472020-03-17 Nick Clifton <nickc@redhat.com>
248
d3c3c542 249 PR 25688
327ef784
NC
250 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
251 with error messages.
252
ecbbbdba
NC
2532020-03-17 Nick Clifton <nickc@redhat.com>
254
255 PR 25687
256 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
257 free. Add free on another failure path.
258
4b3ecb3b
AM
2592020-03-16 Alan Modra <amodra@gmail.com>
260
261 PR 25675
262 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
263 we have a non-zero section count. Do lma comparison in octets.
264
7bac4137
AM
2652020-03-16 Alan Modra <amodra@gmail.com>
266
267 * vms-alpha.c (dst_restore_location): Validate index into
268 dst_ptr_offsets array before accessing. Return status.
269 (dst_retrieve_location): Similarly, making "loc" parameter a
270 pointer to return value.
271 (_bfd_vms_slurp_etir): Update calls to above functions.
272
8b5d0a4f
KR
2732020-03-14 Kamil Rytarowski <n54@gmx.com>
274
275 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
276 targets.
277 * configure: Regenerated.
278
48e81d7f
AM
2792020-03-14 Alan Modra <amodra@gmail.com>
280
281 * section.c (BFD_FAKE_SECTIONS): Formatting.
282 * bfd-in2.h: Regenerate.
283
06d949ec
KR
2842020-03-13 Kamil Rytarowski <n54@gmx.com>
285
286 * elf.c (elfcore_grok_netbsd_note): Add support for
287 NT_NETBSDCORE_LWPSTATUS notes.
288
abf874aa
CL
2892020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
290
291 * bfd-in2.h: Regenerate.
292 * section.c (asection): Add already_assigned field.
293 (BFD_FAKE_SECTION): Add default initializer for it.
294 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
295 * elf32-arm.c (arm_build_one_stub): Add support for
296 non_contiguous_regions.
297 * elf32-csky.c (csky_build_one_stub): Likewise.
298 * elf32-hppa.c (hppa_build_one_stub): Likewise.
299 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
300 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
301 * elf32-metag.c (metag_build_one_stub): Likewise.
302 * elf32-nios2.c (nios2_build_one_stub): Likewise.
303 * elf64-ppc.c (ppc_build_one_stub): Likewise.
304 (ppc_size_one_stub): Likewise.
305 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
306 * elflink.c (elf_link_input_bfd): Likewise.
307
74e10d17
L
3082020-03-13 H.J. Lu <hongjiu.lu@intel.com>
309
310 PR ld/24920
311 * elf-linker-x86.h (elf_linker_x86_params): Add
312 static_before_all_inputs and has_dynamic_linker.
313 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
314 dynamic input objects if -static is passed at command-line
315 before all input files without --dynamic-linker unless
316 --no-dynamic-linker is used.
317
015ec493
KR
3182020-03-13 Kamil Rytarowski <n54@gmx.com>
319
320 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
321
66631823
CE
3222020-03-13 Christian Eggers <ceggers@gmx.de>
323
324 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
325 "p_paddr" from "at".
326 * elfcode.h (bfd_from_remote_memory): Add units to several
327 parameters. New local "opb". Fix usage of p_align. Fix
328 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
329 call of target_read_memory.
330 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
331 calculation of "offset" and "output_offset".
332 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
333 from "offset" and fix calculation of "end" from "vma+size". Fix
334 comparison between "sh_addr" and "vma"/"output_offset".
335 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
336 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
337 member.
338 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
339 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
340 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
341 assignment of p_paddr from phdr_lma. Fix comparison between
342 "lma+size" and "next->lma".
343 (elf_sort_segments): Fix assignment from p_paddr to lma.
344 (assign_file_positions_for_load_sections): Add unit (bytes) to
345 local "align". Fix calculation of local "off_adjust". Fix
346 calculation of local "filehdr_vaddr".
347 (assign_file_positions_for_non_load_sections): New local "opb".
348 Fix calculation of "end" from "p_size". Fix comparison between
349 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
350 from "end" and "p_vaddr".
351 (rewrite_elf_program_header): Fix comparison between p_vaddr and
352 vma. Fix assignment to p_paddr from lma. Fix comparison between
353 p_paddr and lma. Fix assignment to p_paddr from lma.
354 * merge.c (sec_merge_emit): New local "opb". Convert
355 "alignment_power" to octets.
356 (_bfd_add_merge_section): New locals "alignment_power" and
357 "opb". Fix comparison between "alignment_power" and
358 "sizeof(align)".
359 (_bfd_merge_sections): New local "opb". Divide size by opb
360 before checking align mask.
361
502794d4
CE
3622020-03-13 Christian Eggers <ceggers@gmx.de>
363
364 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
365 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
366 section LMA/VMA.
367 (_bfd_elf_make_section_from_phdr): Similarly.
368 (elf_fake_sections): Fix calculation of
369 Elf_Internal_shdr::sh_addr from section VMA.
370 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
371 and bytes.
372 (assign_file_positions_for_load_sections): Fix calculations of
373 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
374 comparison between program header address and section LMA.
375 (assign_file_positions_for_non_load_sections): Likewise.
376 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
377 (IS_CONTAINED_BY_VMA): Add parameter opb.
378 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
379 INCLUDE_SECTION_IN_SEGMENT): Likewise.
380 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
381 Fix calculations of p_addr_valid and p_vaddr_offset.
382 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
383 with octets per byte when comparing against p_vaddr.
384
8248d21a
AM
3852020-03-11 Alan Modra <amodra@gmail.com>
386
387 * som.c (setup_sections): Sanity check subspace.name.
388
435edf0b
AM
3892020-03-11 Alan Modra <amodra@gmail.com>
390
391 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
392
6b5e16ff
AM
3932020-03-10 Alan Modra <amodra@gmail.com>
394
395 PR 25648
396 * ihex.c (ihex_write_object_contents): Don't assume ordering of
397 addresses here.
398
2f57795b
AM
3992020-03-09 Alan Modra <amodra@gmail.com>
400
401 * wasm-module.c (wasm_scan): Sanity check file name length
402 before allocating memory. Move common section setup code. Do
403 without bfd_tell to calculate section size.
404
a0dcf297
NC
4052020-03-06 Nick Clifton <nickc@redhat.com>
406
407 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
408 with error messages and failure return values.
409
e15a8da9
MF
4102020-03-05 Max Filippov <jcmvbkbc@gmail.com>
411
412 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
413 relocation sections for any removed reference to a dynamic symbol.
414
a8e14f4c
NC
4152020-03-05 Nick Clifton <nickc@redhat.com>
416
417 * elf-bfd.h (struct elf_backend_data): Add new fields:
418 init_secondary_reloc_section, slurp_secondary_reloc_section,
419 write_secondary_reloc_section.
420 (_bfd_elf_init_secondary_reloc_section): Prototype.
421 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
422 (_bfd_elf_write_secondary_reloc_section): Prototype.
423 * elf.c ( bfd_section_from_shdr): Invoke the new
424 init_secondary_reloc_section backend function, if defined, when a
425 second reloc section is encountered.
426 (swap_out_syms): Invoke the new symbol_section_index function, if
427 defined, when computing the section index of an OS/PROC specific
428 symbol.
429 (_bfd_elf_init_secondary_reloc_section): New function.
430 (_bfd_elf_slurp_secondary_reloc_section): New function.
431 (_bfd_elf_write_secondary_reloc_section): New function.
432 (_bfd_elf_copy_special_section_fields): New function.
433 * elfcode.h (elf_write_relocs): Invoke the new
434 write_secondary_relocs function, if defined, in order to emit
435 secondary relocs.
436 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
437 function, if defined, in order to read in secondary relocs.
438 * elfxx-target.h (elf_backend_copy_special_section_fields):
439 Provide a non-NULL default definition.
440 (elf_backend_init_secondary_reloc_section): Likewise.
441 (elf_backend_slurp_secondary_reloc_section): Likewise.
442 (elf_backend_write_secondary_reloc_section): Likewise.
443 (struct elf_backend_data elfNN_bed): Add initialisers for the new
444 fields.
445 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
446 * configure: Regenerate.
447
6f8f95b4
AM
4482020-03-05 Alan Modra <amodra@gmail.com>
449
450 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
451 against file size before allocating memory. Use bfd_alloc rather
452 than bfd_zalloc for carsym/strings memory.
453
233bf4f8
AM
4542020-03-04 Alan Modra <amodra@gmail.com>
455
456 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
457 sh_addr mod sh_addalign is zero.
458
1039fd9a
AM
4592020-03-04 Alan Modra <amodra@gmail.com>
460
461 * format.c (bfd_check_format_matches): Call cleanup on error exit.
462
f5714099
AM
4632020-03-03 Alan Modra <amodra@gmail.com>
464
465 * format.c (struct bfd_preserve): Add cleanup field.
466 (bfd_preserve_save): Add cleanup param and save.
467 (bfd_preserve_restore): Return cleanup.
468 (bfd_preserve_finish): Call the cleanup for the discarded match.
469 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
470 and clear when preserving a match. Restore cleanup too when
471 restoring that match.
472
40b35c78
AM
4732020-03-02 Alan Modra <amodra@gmail.com>
474
475 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
476 * hpux-core.c (hpux_core_core_file_p): Update prototype.
477 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
478 (core_sco5_vec): Correct initialisers.
479
601b73d5
AM
4802020-03-02 Alan Modra <amodra@gmail.com>
481
482 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
483 * aix5ppc-core.c (xcoff64_core_p): Likewise.
484 * cisco-core.c (cisco_core_file_validate): Likewise.
485 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
486 * hpux-core.c (hpux_core_core_file_p): Likewise.
487 * irix-core.c (irix_core_core_file_p): Likewise.
488 * lynx-core.c (lynx_core_file_p): Likewise.
489 * netbsd-core.c (netbsd_core_file_p): Likewise.
490 * osf-core.c (osf_core_core_file_p): Likewise.
491 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
492 * sco5-core.c (sco5_core_file_p): Likewise.
493
728d32c4
L
4942020-03-02 H.J. Lu <hongjiu.lu@intel.com>
495
496 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
497
cb001c0d
AM
4982020-03-02 Alan Modra <amodra@gmail.com>
499
500 * targets.c (bfd_cleanup): New typedef.
501 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
502 * libbfd-in.h (_bfd_no_cleanup): Define.
503 * format.c (bfd_reinit): Add cleanup parameter, call it.
504 (bfd_check_format_matches): Set cleanup from _bfd_check_format
505 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
506 * aout-target.h (callback, object_p): Return bfd_cleanup.
507 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
508 * archive.c (bfd_generic_archive_p): Likewise.
509 * binary.c (binary_object_p): Likewise.
510 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
511 * coff-ia64.c (ia64coff_object_p): Likewise.
512 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
513 * coff-sh.c (coff_small_object_p): Likewise.
514 * coff-stgo32.c (go32_check_format): Likewise.
515 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
516 (xcoff64_core_p): Likewise.
517 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
518 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
519 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
520 * elfcode.h (elf_object_p): Likewise.
521 * elfcore.h (elf_core_file_p): Likewise.
522 * i386msdos.c (msdos_object_p): Likewise.
523 * ihex.c (ihex_object_p): Likewise.
524 * libaout.h (some_aout_object_p): Likewise.
525 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
526 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
527 * libbfd.c (_bfd_dummy_target): Likewise.
528 * libcoff-in.h (coff_object_p): Likewise.
529 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
530 (bfd_mach_o_arm64_core_p): Likewise.
531 * mach-o-arm.c (bfd_mach_o_arm_object_p),
532 (bfd_mach_o_arm_core_p): Likewise.
533 * mach-o-i386.c (bfd_mach_o_i386_object_p),
534 (bfd_mach_o_i386_core_p): Likewise.
535 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
536 (bfd_mach_o_x86_64_core_p): Likewise.
537 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
538 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
539 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
540 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
541 * mmo.c (mmo_object_p): Likewise.
542 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
543 * peicode.h (coff_real_object_p, pe_ILF_object_p),
544 (pe_bfd_object_p): Likewise.
545 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
546 * ppcboot.c (ppcboot_object_p): Likewise.
547 * rs6000-core.c (rs6000coff_core_p): Likewise.
548 * som.c (som_object_setup, som_object_p): Likewise.
549 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
550 * tekhex.c (tekhex_object_p): Likewise.
551 * vms-alpha.c (alpha_vms_object_p): Likewise.
552 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
553 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
554 * wasm-module.c (wasm_object_p): Likewise.
555 * xsym.c (bfd_sym_object_p): Likewise.
556 * xsym.h (bfd_sym_object_p): Likewise.
557 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
558 return type.
559 * pdp11.c (some_aout_object_p): Likewise.
560 * plugin.c (register_ld_plugin_object_p): Update object_p
561 parameter type.
562 * plugin.h (register_ld_plugin_object_p): Likewise.
563 * bfd-in2.h: Regenerate.
564 * libbfd.h: Regenerate.
565 * libcoff.h: Regenerate.
566
a4dd6c97
AM
5672020-03-02 Alan Modra <amodra@gmail.com>
568
569 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
570 applicable section flags.
571 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
572 (mips_ecoff_bele_vec): Likewise.
573 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
574 and .sbss sections.
575 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
576 (_bfd_ecoff_styp_to_sec_flags): Likewise.
577
bf577467
AM
5782020-03-02 Alan Modra <amodra@gmail.com>
579
580 * elf32-m32r.c (m32r_elf_section_flags): New function.
581 (elf_backend_section_flags): Define.
582 * elf32-nds32.c (nds32_elf_section_flags): New function.
583 (elf_backend_section_flags): Define.
584 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
585 .sbss and .sdata sections.
586 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
587 for SHF_V850_GPREL sections.
588 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
589 FIXME.
590 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
591 for SHF_PARISC_SHORT sections.
592 * elf64-ppc.c (ppc64_elf_section_flags): New function.
593 (elf_backend_section_flags): Define.
594 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
595 for SHF_MIPS_GPREL sections. Delete FIXME.
596
8c803a2d
AM
5972020-03-02 Alan Modra <amodra@gmail.com>
598
599 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
600 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
601 calling elf_backend_section_flags with adjusted params. Use
602 newsect->flags past that point.
603 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
604 special sections.
605 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
606 to have their type overridden, and all sh_flags but processor and
607 os specific.
608 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
609 * elf32-mep.c (mep_elf_section_flags): Likewise.
610 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
611 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
612 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
613 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
614 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
615 stub BFD and non-aarch64 input files when scanning for stubs.
616
7d4b2d2d
AM
6172020-03-02 Alan Modra <amodra@gmail.com>
618
619 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
620 limit to decompressed element size.
621
26f60d59
AM
6222020-03-02 Alan Modra <amodra@gmail.com>
623
624 * vms-lib.c (vms_traverse_index): Add recur_count param and
625 update calls. Fail on excessive recursion.
626
9cb56943
AM
6272020-03-02 Alan Modra <amodra@gmail.com>
628
629 * vms-alpha.c (vms_get_remaining_object_record): Use
630 bfd_realloc_or_free rather than bfd_realloc.
631 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
632 (dst_define_location, parse_module): Likewise, and check realloc
633 return status before using memory. Return status from function
634 adjusting all callers.
635
182ec670
AM
6362020-02-28 Alan Modra <amodra@gmail.com>
637
638 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
639
1b088c82
AM
6402020-02-28 Alan Modra <amodra@gmail.com>
641
642 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
643 Remove duplicate undersize check.
644
5f602802
AM
6452020-02-27 Alan Modra <amodra@gmail.com>
646
647 PR 24511
648 * mmo.c (mmo_scan): Set SEC_DATA for .data.
649
49d9fd42
AM
6502020-02-27 Alan Modra <amodra@gmail.com>
651
652 PR 24511
653 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
654 (coff_section_type): Adjust comment.
655 (decode_section_type): Likewise. Call coff_section_type before
656 decode_section_type.
657 (bfd_decode_symclass): Use 'c' for common sections other than
658 the standard one.
659
05f52dc2
AM
6602020-02-27 Alan Modra <amodra@gmail.com>
661
662 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
663 malloc'd block.
664
ff69a894
AM
6652020-02-27 Alan Modra <amodra@gmail.com>
666
667 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
668 if file is an archive element.
669 * bfd-in2.h: Regenerate.
670
02f7e7ee
AM
6712020-02-26 Alan Modra <amodra@gmail.com>
672
673 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
674 bfd_set_error on failing test. Don't bother changing bfd_error on
675 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
676 Check sym name is within string buffer. Use size_t for some vars.
677 (do_slurp_coff_armap): Use size_t for some variables, fix size of
678 int_buf. Don't change bfd_error on file read error. Use
679 _bfd_mul_overflow when calculating carsym buffer size. Reorder
680 calculations to catch overflows before they occur. malloc and
681 free raw armap rather than using bfd_alloc. Read raw armap before
682 allocating carsym+strings buffer.
683 (_bfd_slurp_extended_name_table): Localize variables. Check
684 name size against file size.
685
cc4c4f40
AM
6862020-02-26 Alan Modra <amodra@gmail.com>
687
688 * vms-lib.c (vms_lib_read_index): Release correct buffer.
689
e0b317de
AM
6902020-02-26 Alan Modra <amodra@gmail.com>
691
692 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
693 malloc. Check for NULL return from bfd_malloc.
694 (rx_table_find, rx_table_map): Likewise.
695 (rx_set_section_contents): Check bfd_alloc return.
696 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
697
dc1e8a47
AM
6982020-02-26 Alan Modra <amodra@gmail.com>
699
700 * aoutx.h: Indent labels correctly. Format error strings.
701 * archive.c: Likewise.
702 * archive64.c: Likewise.
703 * coff-arm.c: Likewise.
704 * coff-rs6000.c: Likewise.
705 * coff-stgo32.c: Likewise.
706 * cpu-arm.c: Likewise.
707 * dwarf2.c: Likewise.
708 * elf-ifunc.c: Likewise.
709 * elf-properties.c: Likewise.
710 * elf-s390-common.c: Likewise.
711 * elf-strtab.c: Likewise.
712 * elf.c: Likewise.
713 * elf32-arm.c: Likewise.
714 * elf32-bfin.c: Likewise.
715 * elf32-cr16.c: Likewise.
716 * elf32-csky.c: Likewise.
717 * elf32-i386.c: Likewise.
718 * elf32-m68k.c: Likewise.
719 * elf32-msp430.c: Likewise.
720 * elf32-nds32.c: Likewise.
721 * elf32-nios2.c: Likewise.
722 * elf32-pru.c: Likewise.
723 * elf32-xtensa.c: Likewise.
724 * elf64-ia64-vms.c: Likewise.
725 * elf64-x86-64.c: Likewise.
726 * elfcode.h: Likewise.
727 * elfcore.h: Likewise.
728 * elflink.c: Likewise.
729 * elfnn-aarch64.c: Likewise.
730 * elfnn-ia64.c: Likewise.
731 * elfnn-riscv.c: Likewise.
732 * elfxx-mips.c: Likewise.
733 * elfxx-sparc.c: Likewise.
734 * elfxx-x86.c: Likewise.
735 * i386lynx.c: Likewise.
736 * merge.c: Likewise.
737 * pdp11.c: Likewise.
738 * plugin.c: Likewise.
739 * reloc.c: Likewise.
740
e310298c
AM
7412020-02-26 Alan Modra <amodra@gmail.com>
742
743 PR 25593
744 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
745 "dyn_loaded".
746 (bfd_elf_add_dt_needed_tag): Declare.
747 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
748 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
749 from elf_add_dt_needed_tag. Remove soname and doit param.
750 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
751 to see whether as-needed lib is already loaded, use dyn_loaded
752 list instead. When saving and restoring around as-needed lib
753 handle possibility that dynstr has not been initialised. Don't
754 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
755 Mark libs loaded via DT_NEEDED entries of other libs with
756 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
757 the output.
758 (elf_link_check_versioned_symbol): Remove now unneccesary
759 DYNAMIC check when traversing dyn_loaded list.
760
b570b954
AM
7612020-02-26 Alan Modra <amodra@gmail.com>
762
763 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
764
ecda9016
L
7652020-02-25 H.J. Lu <hongjiu.lu@intel.com>
766
767 PR binutils/25584
768 * plugin.c (need_lto_wrapper_p): New.
769 (bfd_plugin_set_program_name): Add an int argument to set
770 need_lto_wrapper_p.
771 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
772 set.
773 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
774
a98c743f
AM
7752020-02-24 Alan Modra <amodra@gmail.com>
776
777 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
778
c893ce36
AM
7792020-02-24 Alan Modra <amodra@gmail.com>
780
781 * vms-lib.c (struct carsym_mem): Add limit.
782 (vms_add_index): Heed limit.
783 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
784 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
785 Always return actual number read.
786 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
787 assertion with error exit.
788
7b3c2715
AM
7892020-02-22 Alan Modra <amodra@gmail.com>
790
791 PR 25585
792 * elf.c (assign_file_positions_for_load_sections): Continue linking
793 on "PHDR segment not covered by LOAD segment" errors.
794
a4425a57
AM
7952020-02-21 Alan Modra <amodra@gmail.com>
796
797 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
798 overflow check.
799 (bfd_mach_o_canonicalize_reloc): Likewise.
800 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
801 counts and offsets against file size.
802 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
803 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
804 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
805 against file size. Delete symbol table error message.
806 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
807 against file size.
808 (bfd_mach_o_read_symtab): Likewise.
809 (bfd_mach_o_read_command): Pass file size.
810 (bfd_mach_o_scan): Sanity check command count against file size.
811
dda2980f
AM
8122020-02-21 Alan Modra <amodra@gmail.com>
813
814 PR 25569
815 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
816 "text", "data" and "bss" section pointer vars. Don't update
817 section size, just exec header sizes.
818 (adjust_sizes_and_vmas): Don't update text section size. Set
819 initial exec header a_text. Print exec headers sizes.
820 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
821 (adjust_sizes_and_vmas): Similarly. Formatting.
822 (final_link): Correct final file extension.
823
00e49dff
NC
8242020-02-20 Nick Clifton <nickc@redhat.com>
825
826 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
827 callback.
828 * elfxx-target.h (elf_backend_symbol_section_index): Provide
829 default definition.
830 (elfNN_bed): Initialise the symbol_section_index field.
831 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
832 OS and PROC specific section indicies. Warn if converting other
833 reserved incidies to SHN_ABS.
834
fcaaac0a
SB
8352020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
836
837 PR 25537
838 * cpu-z80.c: Add machine type compatibility checking.
839
dcf06b89
L
8402020-02-19 H.J. Lu <hongjiu.lu@intel.com>
841
842 PR binutils/25355
843 * plugin.c (plugin_list_entry): Remove handle.
844 (try_load_plugin): Call dlclose before return.
845
2c7c5554
AM
8462020-02-19 Alan Modra <amodra@gmail.com>
847
848 * libbfd-in.h (_bfd_constant_p): Define.
849 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
850 file size before allocating memory.
851 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
852 * elf.c (bfd_elf_get_str_section): Likewise.
853 (_bfd_elf_slurp_version_tables): Likewise.
854 * libbfd.h: Regenerate.
855
2bb3687b
AM
8562020-02-19 Alan Modra <amodra@gmail.com>
857
858 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
859 * aoutx.h (aout_get_external_symbols): Replace calls to
860 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
861 (slurp_reloc_table): Likewise.
862 * archive.c (do_slurp_bsd_armap): Likewise.
863 (do_slurp_coff_armap): Likewise.
864 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
865 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
866 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
867 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
868 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
869 (_bfd_coff_get_external_symbols): Likewise.
870 * ecoff.c (ecoff_slurp_symbolic_header),
871 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
872 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
873 (ecoff_indirect_link_order): Likewise.
874 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
875 (_bfd_elf_slurp_version_tables): Likewise.
876 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
877 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
878 * elf32-rx.c (elf32_rx_relax_section): Likewise.
879 * elf64-alpha.c (READ): Likewise.
880 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
881 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
882 * elfcode.h (elf_slurp_symbol_table),
883 (elf_slurp_reloc_table_from_section): Likewise.
884 * elflink.c (elf_link_add_object_symbols),
885 (elf_link_check_versioned_symbol): Likewise.
886 * elfxx-mips.c (READ): Likewise.
887 * i386lynx.c (slurp_reloc_table): Likewise.
888 * lynx-core.c (lynx_core_file_p): Likewise.
889 * mach-o.c (bfd_mach_o_canonicalize_relocs),
890 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
891 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
892 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
893 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
894 (bfd_pef_parse_symbols): Likewise.
895 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
896 * som.c (setup_sections, som_slurp_string_table),
897 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
898 (som_bfd_fill_in_ar_symbols): Likewise.
899 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
900 (evax_bfd_print_image): Likewise.
901 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
902 * wasm-module.c (wasm_scan): Likewise.
903 * xcofflink.c (xcoff_link_add_symbols): Likewise.
904 * xsym.c (bfd_sym_read_name_table),
905 (bfd_sym_print_type_information_table_entry): Likewise.
906 * libbfd.h: Regenerate.
907
806470a2
AM
9082020-02-19 Alan Modra <amodra@gmail.com>
909
910 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
911 reading external relocs.
912 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
913 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
914 after bfd_bread.
915 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
916 bfd_release.
917 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
918 (m32c_elf_relax_section): Likewise.
919 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
920 (rl78_elf_relax_section): Likewise.
921 * elf32-rx.c (rx_offset_for_reloc): Likewise.
922 (elf32_rx_relax_section): Likewise.
923 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
924 parameter types and use..
925 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
926 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
927 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
928 being read from file, just the extra.
929 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
930 after reading external syms. Free on failure.
931
1f4361a7
AM
9322020-02-19 Alan Modra <amodra@gmail.com>
933
934 * coffcode.h (buy_and_read, coff_slurp_line_table),
935 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
936 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
937 corresponding bfd_alloc call. Adjust variables to suit.
938 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
939 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
940 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
941 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
942 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
943 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
944 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
945 * elf32-rx.c (elf32_rx_relax_section): Likewise.
946 * elf64-alpha.c (READ): Likewise.
947 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
948 (elf_slurp_symbol_table, elf_slurp_reloc_table),
949 (bfd_from_remote_memory): Likewise.
950 * elfcore.h (core_find_build_id): Likewise.
951 * elfxx-mips.c (READ): Likewise.
952 * mach-o.c (bfd_mach_o_mangle_sections),
953 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
954 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
955 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
956 * som.c (setup_sections, som_prep_for_fixups)
957 (som_build_and_write_symbol_table, som_slurp_symbol_table),
958 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
959 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
960 (som_bfd_ar_write_symbol_stuff): Likewise.
961 * vms-alpha.c (vector_grow1): Likewise.
962 * vms-lib.c (vms_add_index): Likewise.
963 * wasm-module.c (wasm_scan_name_function_section): Likewise.
964 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
965 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
966 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
967 (bfd_alloc2, bfd_zalloc2): Delete.
968 (_bfd_mul_overflow): Define.
969 * libbfd.h: Regenerate.
970
446f7ed5
AM
9712020-02-19 Alan Modra <amodra@gmail.com>
972
973 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
974 bfd_zalloc2.
975 (assign_section_numbers): Likewise.
976 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
977 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
978 bfd_malloc2, size_t amt, and unsigned tls_count.
979 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
980 * elflink.c (elf_create_symbuf): Use bfd_malloc.
981 (elf_output_implib): Use bfd_alloc.
982
b03202e3
AM
9832020-02-19 Alan Modra <amodra@gmail.com>
984
985 * bfd.c (struct bfd): Move format and direction to other
986 bitfields. Add "size".
987 * bfdio.c (bfd_get_size): Cache size when not writing file.
988 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
989 returning zero, ie. unknown.
990 (bfd_get_alt_debug_link_info): Likewise.
991 * bfd-in2.h: Regenerate.
992
7c5fa58e
AM
9932020-02-19 Alan Modra <amodra@gmail.com>
994
995 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
996 bfd_get_file_size twice.
997 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
998 zero, ie. unknown, return.
999 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1000 * elfcode.h (elf_swap_shdr_in): Likewise.
1001 (elf_object_p): Don't call bfd_get_file_size twice and correct
1002 file size check.
1003
96d3b80f
AM
10042020-02-19 Alan Modra <amodra@gmail.com>
1005
1006 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1007 FALSE if memory alloc fails. Adjust calls.
1008 * som.c (som_prep_for_fixups): Likewise.
1009 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1010 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1011 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1012 * som.c (som_build_and_write_symbol_table): Return via error_return
1013 on seek failure.
1014 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1015 (VEC_APPEND_EL): Delete.
1016 (vector_grow1): Return pointer to element. Catch overflow.
1017 Return NULL on memory allocation failure.
1018 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1019 (alpha_vms_add_fixup_ca): Likewise.
1020 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1021 before using.
1022 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1023
986f0783
AM
10242020-02-19 Alan Modra <amodra@gmail.com>
1025
1026 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1027 * aout-target.h (object_p): Likewise.
1028 * aout-tic30.c (tic30_aout_object_p): Likewise.
1029 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1030 (emit_stringtab, write_syms, link_hash_table_create),
1031 (aout_link_write_other_symbol): Likewise.
1032 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1033 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1034 (_bfd_compute_and_write_armap): Likewise.
1035 * archures.c (bfd_arch_list): Likewise.
1036 * bfd.c (bfd_record_phdr): Likewise.
1037 * binary.c (binary_canonicalize_symtab): Likewise.
1038 * cisco-core.c (cisco_core_file_validate): Likewise.
1039 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1040 (find_arm_glue, record_arm_to_thumb_glue),
1041 (record_thumb_to_arm_glue): Likewise.
1042 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1043 (ppc_allocate_toc_section): Likewise.
1044 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1045 * coff-sh.c (sh_relax_section): Likewise.
1046 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1047 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1048 (coff_set_alignment_hook, coff_mkobject),
1049 (coff_compute_section_file_positions): Likewise.
1050 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1051 (coff_find_nearest_line_with_names),
1052 ( bfd_coff_set_symbol_class): Likewise.
1053 * cofflink.c (_bfd_coff_link_hash_table_create),
1054 (_bfd_coff_link_input_bfd): Likewise.
1055 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1056 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1057 (build_line_info_table, sort_line_sequences),
1058 (line_info_add_include_dir, line_info_add_file_name),
1059 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1060 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1061 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1062 (_bfd_ecoff_find_nearest_line),
1063 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1064 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1065 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1066 * elf-m10300.c (mn10300_elf_relax_section),
1067 (elf32_mn10300_link_hash_table_create): Likewise.
1068 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1069 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1070 * elf32-arm.c (elf32_arm_link_hash_table_create),
1071 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1072 (elf32_arm_new_section_hook): Likewise.
1073 * elf32-avr.c (elf_avr_new_section_hook),
1074 (elf32_avr_link_hash_table_create, get_local_syms),
1075 (elf32_avr_setup_section_lists): Likewise.
1076 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1077 (bfin_link_hash_table_create): Likewise.
1078 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1079 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1080 * elf32-csky.c (csky_elf_link_hash_table_create),
1081 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1082 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1083 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1084 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1085 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1086 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1087 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1088 (m32r_elf_check_relocs): Likewise.
1089 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1090 (elf32_m68hc11_setup_section_lists),
1091 (elf32_m68hc11_size_stubs): Likewise.
1092 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1093 * elf32-metag.c (elf_metag_link_hash_table_create),
1094 (elf_metag_setup_section_lists): Likewise.
1095 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1096 (microblaze_elf_check_relocs): Likewise.
1097 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1098 (nds32_elf_check_relocs): Likewise.
1099 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1100 (get_local_syms, nios2_elf32_check_relocs),
1101 (nios2_elf32_link_hash_table_create): Likewise.
1102 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1103 (or1k_elf_check_relocs): Likewise.
1104 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1105 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1106 * elf32-s390.c (elf_s390_link_hash_table_create),
1107 (elf_s390_check_relocs): Likewise.
1108 * elf32-score.c (score_elf_create_got_section),
1109 (s3_elf32_score_new_section_hook),
1110 (elf32_score_link_hash_table_create): Likewise.
1111 * elf32-score7.c (score_elf_create_got_section),
1112 (s7_elf32_score_new_section_hook): Likewise.
1113 * elf32-sh.c (sh_elf_link_hash_table_create),
1114 (sh_elf_check_relocs): Likewise.
1115 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1116 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1117 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1118 (tilepro_elf_check_relocs): Likewise.
1119 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1120 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1121 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1122 (elf_xtensa_new_section_hook): Likewise.
1123 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1124 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1125 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1126 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1127 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1128 * elf64-ppc.c (ppc64_elf_new_section_hook),
1129 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1130 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1131 * elf64-s390.c (elf_s390_link_hash_table_create),
1132 (elf_s390_check_relocs): Likewise.
1133 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1134 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1135 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1136 (elf_link_add_archive_symbols, compute_bucket_count),
1137 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1138 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1139 (bfd_elf_final_link): Likewise.
1140 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1141 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1142 (elfNN_aarch64_new_section_hook): Likewise.
1143 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1144 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1145 (riscv_elf_check_relocs): Likewise.
1146 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1147 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1148 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1149 (_bfd_mips_elf_link_hash_table_create): Likewise.
1150 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1151 (_bfd_sparc_elf_check_relocs),
1152 (_bfd_sparc_elf_new_section_hook): Likewise.
1153 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1154 (tilegx_elf_check_relocs): Likewise.
1155 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1156 * format.c (bfd_check_format_matches): Likewise.
1157 * hash.c (_bfd_stringtab_init): Likewise.
1158 * ihex.c (ihex_scan): Likewise.
1159 * irix-core.c (irix_core_core_file_p): Likewise.
1160 * linker.c (bfd_wrapped_link_hash_lookup),
1161 (_bfd_generic_link_hash_table_create),
1162 (_bfd_generic_reloc_link_order): Likewise.
1163 * lynx-core.c (lynx_core_file_p): Likewise.
1164 * netbsd-core.c (netbsd_core_file_p): Likewise.
1165 * osf-core.c (osf_core_core_file_p): Likewise.
1166 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1167 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1168 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1169 * peicode.h (pe_mkobject): Likewise.
1170 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1171 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1172 * sco5-core.c (read_uarea): Likewise.
1173 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1174 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1175 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1176 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1177 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1178 * srec.c (srec_scan): Likewise.
1179 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1180 * targets.c (bfd_target_list): Likewise.
1181 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1182 * trad-core.c (trad_unix_core_file_p): Likewise.
1183 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1184 (vms_new_section_hook): Likewise.
1185 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1186 * xcofflink.c (xcoff_get_section_contents),
1187 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1188 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1189 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1190
2d0e1217
AM
11912020-02-19 Alan Modra <amodra@gmail.com>
1192
1193 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1194
99845b3b
L
11952020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1196
1197 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1198 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1199 a build_list_p argument. Don't search plugin_list. Short circuit
1200 when building the plugin list.
1201 (has_plugin): Renamed to has_plugin_list.
1202 (bfd_plugin_set_plugin): Don't set has_plugin.
1203 (bfd_plugin_specified_p): Check plugin_list instead.
1204 (build_plugin_list): New function.
1205 (load_plugin): Call build_plugin_list and use plugin_list.
1206
22fe7df8
L
12072020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1208
1209 PR binutils/25355
1210 * plugin.c (try_claim): Always clean up for LTO wrapper.
1211 (try_load_plugin): Treat each object as independent. Create a
1212 copy for plugin name.
1213
c675ec1e
NC
12142020-02-11 Nick Clifton <nickc@redhat.com>
1215
1216 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1217 for addresses in print statements.
1218 (msp430_elf_relax_delete_bytes): Likewise.
1219 (msp430_elf_relax_add_words): Likewise.
1220 (msp430_elf_relax_section): Likewise.
1221
1d07a805
L
12222020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1223
1224 * plugin.c (add_symbols): Clear plugin_data memory.
1225
0aa99dcd
L
12262020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1227
1228 PR binutils/25355
1229 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1230 (EXECUTABLE_SUFFIX): Likewise.
1231 * config.in: Regenerated.
1232 * configure: Likewise.
1233 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1234 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1235 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1236 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1237 (get_lto_wrapper): New.
1238 (setup_lto_wrapper_env): Likewise.
1239 (current_plugin): Likewise.
1240 (register_all_symbols_read): Likewise.
1241 (register_cleanup): Likewise.
1242 (get_symbols): Likewise.
1243 (add_input_file): Likewise.
1244 (bfd_plugin_close_and_cleanup): Likewise.
1245 (claim_file): Removed.
1246 (register_claim_file): Set current_plugin->claim_file.
1247 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1248 lto_syms in current_plugin.
1249 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1250 all_symbols_read handler. Copy real symbols to plugin_data.
1251 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1252 (try_load_plugin): Don't reuse the previous plugin for LTO
1253 wrapper. Set up GCC LTO wrapper if possible. Don't set
1254 plugin_list_iter->claim_file.
1255 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1256 possible.
1257 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1258 real_syms.
1259
ac4280da
JL
12602020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1261
1262 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1263 check if previous instruction matches a conditional jump inserted
1264 earlier. Invert conditional jump and delete branch in this case.
1265
8d6cb116
JL
12662020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1267
1268 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1269 msp430_elf_relax_add_words. Support insertion of either one or two
1270 words.
1271 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1272 needs to be grown. Handle insertion of branch instruction to replace
1273 jump.
1274
d60f5448
JL
12752020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1276
1277 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1278 debugging relocations.
1279 (msp430_elf_relax_delete_bytes): Likewise.
1280 (msp430_elf_relax_add_two_words): Likewise.
1281 (msp430_elf_relax_section): Likewise.
1282
e1f85e11
AM
12832020-02-10 Alan Modra <amodra@gmail.com>
1284
1285 * archures.c: Wrap overlong z80 comments.
1286 * bfd-in2.h: Regenerate.
1287
9fc0b501
SB
12882020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1289
1290 PR 25469
1291 * archures.c: Add GBZ80 and Z80N machine values.
1292 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1293 * coff-z80.c: Add support for new reloc.
1294 * coffcode.h: Add support for new machine values.
1295 * cpu-z80.c: Add support for new machine names.
1296 * elf32-z80.c: Add support for new reloc.
1297 * bfd-in2.h: Regenerate.
1298 * libbfd.h: Regenerate.
1299
9984857c
NC
13002020-02-07 Nick Clifton <nickc@redhat.com>
1301
1302 PR 23932
1303 * elf.c (rewrite_elf_program_header): Do not complain if no
1304 sections are mapped to a segment.
1305
5242a0a0
L
13062020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1307
1308 PR ld/25490
1309 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1310 for garbage collection on __patchable_function_entries section
1311 without linked-to section.
1312
b7d07216
L
13132020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1314
1315 PR gas/25381
1316 * bfd-in2.h: Regenerated.
1317 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1318 on section if gc_mark of any of its linked-to sections is set
1319 and don't set gc_mark again.
1320 * section.c (asection): Add linked_to_symbol_name to map_head
1321 union.
1322
b93a662b
MR
13232020-02-06 Maciej W. Rozycki <macro@wdc.com>
1324
1325 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1326 reporting an unrecognized instruction with R_V850_LONGJUMP.
1327
6df4c9c2
AM
13282020-02-05 Alan Modra <amodra@gmail.com>
1329
1330 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1331
24872cb3
AM
13322020-02-04 Alan Modra <amodra@gmail.com>
1333
1334 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1335 R_PPC_VLE_ADDR20, goto copy_reloc.
1336
ef4627fa
L
13372020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1338
1339 * bfd-in2.h: Regenerated.
1340 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1341
a8c4d40b
L
13422020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1343
1344 PR gas/25380
1345 * bfd-in2.h: Regenerated.
1346 * ecoff.c (bfd_debug_section): Add section_id.
1347 * section.c (bfd_section): Add section_id.
1348 (SEC_ASSEMBLER_SECTION_ID): New.
1349 (BFD_FAKE_SECTION): Add section_id.
1350
5a9212a1
NC
13512020-02-01 Nick Clifton <nickc@redhat.com>
1352
1353 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1354 obsolete list.
1355
e7cbe0c4
SL
13562020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1357
1358 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1359 encodings are relative to the GOT on nios2, too.
1360
72ebe8c5
AM
13612020-01-31 Alan Modra <amodra@gmail.com>
1362
1363 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1364 file. Use $< and $@ in rules.
1365 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1366 (elf32-ia64.c, elf64-ia64.c): Likewise.
1367 (elf32-riscv.c, elf64-riscv.c): Likewise.
1368 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1369 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1370 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1371 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1372 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1373 * Makefile.in: Regenerate.
1374
327301a4
AM
13752020-01-31 Alan Modra <amodra@gmail.com>
1376
1377 PR 4110
1378 * elf.c (setup_group): Don't clear entire section contents,
1379 just the padding after group flags. Release alloc'd memory
1380 after a seek or read failure.
1381
b5d36aaa
JT
13822020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1383
1384 * peXXigen.c (pe_is_repro): New function.
1385 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1386 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1387
1957ab10
JT
13882020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1389
1390 * peXXigen.c (debug_type_names): Add names for new debug data type
1391 values.
1392
87b2920f
JT
13932020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1394
1395 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1396 inner loop. Fix a memory leak.
1397
72913831
AM
13982020-01-30 Alan Modra <amodra@gmail.com>
1399
1400 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1401 or obj_coff_keep_strings here.
1402 (coff_get_normalized_symtab): Free external syms directly.
1403 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1404 on error exit path.
1405
c35d018b
JW
14062020-01-27 Jim Wilson <jimw@sifive.com>
1407
1408 * cpu-riscv.c (riscv_scan): New.
1409 (N): Change bfd_default_scan to riscv_scan.
1410
086b06f3
AS
14112020-01-27 Andreas Schwab <schwab@suse.de>
1412
1413 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1414 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1415 * Makefile.in: Regenerate.
1416 * cpu-plugin.c: Remove.
1417 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1418 (bfd_plugin_arch): Remove declaration.
1419 * bfd-in2.h: Regenerate.
1420 * po/SRC-POTFILES.in: Regenerate.
1421
3024a17a
AM
14222020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1423 Alan Modra <amodra@gmail.com>
1424
1425 PR ld/25458
1426 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1427
b5f998b2
JW
14282020-01-24 Jim Wilson <jimw@sifive.com>
1429
1430 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1431 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1432 avoid over long line.
1433
caa31cfa
NC
14342020-01-24 Nick Clifton <nickc@redhat.com>
1435
1436 PR 25447
1437 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1438 syms and keep strings flags as these may have been set in order to
1439 prevent a bogus call to free.
1440
24e648d4
NC
14412020-01-23 Nick Clifton <nickc@redhat.com>
1442
1443 * po/fr.po: Updated French translation.
1444
67641dd3
AM
14452020-01-23 Alan Modra <amodra@gmail.com>
1446
1447 PR 25444
1448 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1449 by zero when p_align is zero.
1450
403d1bd9
JW
14512020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1452
1453 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1454 (riscv_prefix_cmp): Likewise.
1455 (riscv_non_std_ext_p): Deleted.
1456 (riscv_std_sv_ext_p): Likewise.
1457 (riscv_non_std_sv_ext_p): Likewise.
1458 (riscv_merge_non_std_and_sv_ext): Rename to...
1459 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1460 (riscv_merge_arch_attr_info): Replace 3 calls to
1461 riscv_merge_non_std_and_sv_ext with single call to
1462 riscv_merge_multi_letter_ext.
1463 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1464 encounter a 'z' prefix.
1465 (riscv_get_prefix_class): New function, return prefix class based
1466 on first few characters of input string.
1467 (riscv_parse_config): New structure to factor out minor differences
1468 in extension class parsing behaviour.
1469 (riscv_parse_sv_or_non_std_ext): Rename to...
1470 (riscv_parse_prefixed_ext): and parameterise with
1471 riscv_parse_config.
1472 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1473 (riscv_multi_letter_ext_valid_p): New.
1474 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1475 (riscv_parse_subset): Delegate all non-single-letter parsing work
1476 to riscv_parse_prefixed_ext.
1477 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1478 (riscv_get_prefix_class): Declare.
1479
a804e476
AM
14802020-01-22 Alan Modra <amodra@gmail.com>
1481
1482 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1483 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1484 __tls_get_addr_desc.
1485 (ppc64_elf_size_stubs): Add section for linker generated
1486 __tls_get_addr_desc wrapper function. Loop at least once if
1487 generating this function.
1488 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1489 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1490
9e7028aa
AM
14912020-01-22 Alan Modra <amodra@gmail.com>
1492
1493 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1494 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1495 tga_desc_fd.
1496 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1497 (STDU_R1_0R1, ADDI_R1_R1): Define.
1498 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1499 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1500 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1501 no_tls_get_addr_regsave.
1502 (branch_reloc_hash_match): Add hash3 and hash4.
1503 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1504 (ppc64_elf_size_dynamic_sections): Likewise.
1505 (ppc64_elf_relocate_section): Likewise.
1506 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1507 __tls_get_addr stub.
1508 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1509 eh_frame.
1510 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1511 eh_frame for regsave __tls_get_addr.
1512
abc489c6
AM
15132020-01-22 Alan Modra <amodra@gmail.com>
1514
1515 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1516 which __tls_get_addr calls will be eliminated.
1517
26916852
NC
15182020-01-20 Nick Clifton <nickc@redhat.com>
1519
1520 * po/pt.po: Updates Portuguese translation.
1521 * po/ru.po: Updated Russian translation.
1522 * po/uk.po: Updated Ukranian translation.
1523
14470f07
L
15242020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1525
1526 PR ld/25416
1527 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1528 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1529 X32 mode.
1530 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1531 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1532 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1533 "rex leal x@tlsdesc(%rip), %reg" to
1534 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1535 "call *(%eax)" to "nopl (%rax)".
1536
b9ca1af6
AM
15372020-01-20 Alan Modra <amodra@gmail.com>
1538
1539 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1540 (MTLR_R11): Don't define.
1541 (LD_R0_0R3, CMPDI_R0_0): Define.
1542 (build_tls_get_addr_stub): Don't use r11 in stub.
1543
ed7007c1
AM
15442020-01-20 Alan Modra <amodra@gmail.com>
1545
1546 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1547 (defined_sym_val, is_tls_get_addr): Likewise.
1548
1b1bb2c6
NC
15492020-01-18 Nick Clifton <nickc@redhat.com>
1550
1551 * version.m4 (BFD_VERSION): Set to 2.34.50.
1552 * configure: Regenerate.
1553 * po/bfd.pot: Regenerate.
1554
ae774686
NC
15552020-01-18 Nick Clifton <nickc@redhat.com>
1556
1557 Binutils 2.34 branch created.
1558
07f1f3aa
CB
15592020-01-17 Christian Biesinger <cbiesinger@google.com>
1560
1561 * coff-arm.c: Fix spelling error (seperate).
1562 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1563 error (seperate).
1564 * sysdep.h (strnlen): Fix spelling error (seperate).
1565
0d1cc75d
LB
15662020-01-15 Lars Brinkhoff <lars@nocrew.org>
1567
1568 PR 20694
1569 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1570
e1c6cf61
AM
15712020-01-15 Alan Modra <amodra@gmail.com>
1572
1573 PR 25384
1574 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1575 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1576 of function symbols unless dot symbols are present. Do warn
1577 whenever one is created, regardles of whether a PLT entry is
1578 also emitted for the function symbol.
1579
ef4e5ba5
AM
15802020-01-14 Alan Modra <amodra@gmail.com>
1581
1582 * som.c (som_bfd_count_ar_symbols): Error when file position
1583 of symbols on chains is not strictly increasing.
1584
8ab484c2
AM
15852020-01-14 Alan Modra <amodra@gmail.com>
1586
1587 * vms.h (VMS_DEBUG): Define as 0.
1588 * vms-alpha.c (image_write): Move debug output after bounds check.
1589 Tidy bounds check.
1590 (_bfd_vms_slurp_eihd): Warning fix.
1591 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1592
b50ef514
AM
15932020-01-13 Alan Modra <amodra@gmail.com>
1594
1595 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1596 for "ignored" records.
1597
0c0adcc5
AM
15982020-01-13 Alan Modra <amodra@gmail.com>
1599
1600 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1601 Delete asect name check. Move asect NULL check to wasm_object_p.
1602 Correct bounds check of sizes against end. Replace uses of
1603 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1604 just one bfd_release.
1605 (wasm_scan): Don't use malloc/strdup for section names,
1606 bfd_alloc instead. Simplify code prefixing section name.
1607 Formatting. Don't attempt to free memory here..
1608 (wasm_object_p): ..do so here.
1609
7f026732
SN
16102020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1611
1612 PR ld/22269
1613 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1614 UNDEFWEAK_NO_DYNAMIC_RELOC.
1615 (allocate_dynrelocs_for_symbol): Likewise.
1616
8cd0e5e9
TC
16172020-01-10 Tamar Christina <tamar.christina@arm.com>
1618
1619 PR 25210
1620 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1621
71780f45
AM
16222020-01-10 Alan Modra <amodra@gmail.com>
1623
1624 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1625
b899eb3b
NC
16262020-01-09 Nick Clifton <nickc@redhat.com>
1627
1628 PR 25221
1629 * bfd.c (bfd_convert_section_contents): Check for a compress
1630 header size that is larger than the actual section size.
1631
4c6ee646
AM
16322020-01-08 Alan Modra <amodra@gmail.com>
1633
1634 PR 25351
1635 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1636 after removing sections.
1637
85f78364
JW
16382020-01-06 Jim Wilson <jimw@sifive.com>
1639
1640 PR 25205
1641 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1642 check for !bfd_link_pic (info).
1643 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1644 <R_RISCV_JAL>: Add comment.
1645 (_bfd_riscv_relax_section): For plt.offset check, add check for
1646 bfd_link_pic (info). Add comment.
1647
49078ece
AM
16482020-01-06 Alan Modra <amodra@gmail.com>
1649
1650 * format.c (bfd_check_format_matches): Ignore bfd_error on target
1651 match failures. Don't init to bfd_error_wrong_format before
1652 calling _bfd_check_format.
1653
ab356be7
AM
16542020-01-06 Alan Modra <amodra@gmail.com>
1655
1656 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
1657 status rather than exiting on stack overflow or underflow.
1658 (_bfd_vms_slurp_etir): Adjust to suit.
1659
85d86817
AM
16602020-01-06 Alan Modra <amodra@gmail.com>
1661
1662 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
1663
3e6aa775
AM
16642020-01-06 Alan Modra <amodra@gmail.com>
1665
1666 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
1667 command. Check name offset is within command.
1668 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
1669 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
1670 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
1671 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
1672 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
1673 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
1674 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
1675 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
1676 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
1677 (bfd_mach_o_read_segment): Similarly.
1678 (bfd_mach_o_read_thread): Properly bound check thread struct.
1679 Don't repeat checks on second loop.
1680 (bfd_mach_o_read_command): Fail on invalid command length.
1681
ea933f17
AM
16822020-01-04 Alan Modra <amodra@gmail.com>
1683
1684 * format.c (bfd_check_format_matches): Add preserve_match.
1685 Save initial bfd state in "preserve", matched bfd state in
1686 "preserve_match". Save just the first match. Release
1687 bfd_alloc memory. Restore and finish preserved state as
1688 appropriate on all function exit paths.
1689
f24bdec4
AM
16902020-01-04 Alan Modra <amodra@gmail.com>
1691
1692 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
1693
991fb595
AM
16942020-01-04 Alan Modra <amodra@gmail.com>
1695
1696 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
1697 match too.
1698
f2a3559d
NC
16992020-01-03 Nick Clifton <nickc@redhat.com>
1700
1701 PR 25307
1702 (bfd_pef_parse_function_stubs): Correct the test that ensures that
1703 there is enough data remaining in the code buffer before
1704 attempting to read a function stub.
1705
7a0fb7be
NC
17062020-01-03 Nick Clifton <nickc@redhat.com>
1707
1708 PR 25308
1709 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
1710 return value from bfd_malloc.
1711 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1712 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
1713 (elf32_arm_filter_cmse_symbols): Likewise.
1714 (elf32_arm_write_section): Likewise.
1715 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1716 (bfd_mach_o_follow_dsym): Likewise.
1717 * pef.c (bfd_pef_print_loader_section): Likewise.
1718 (bfd_pef_scan_start_address): Likewise.
1719 (bfd_pef_parse_function_stubs): Likewise.
1720 (bfd_pef_parse_symbols): Likewise.
1721
b26a3d58
ST
17222020-01-03 Sergei Trofimovich <siarheit@google.com>
1723
1724 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
1725 on binary inputs ld/PR25316.
1726 (is_ia64_elf): new helper to filter on ia64 objects.
1727
4bb7a87e
JB
17282020-01-03 Jan Beulich <jbeulich@suse.com>
1729
1730 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
1731 in parameter names.
1732 (bfd_mach_o_scan): Insert underscore in two variable names.
1733
6655dba2
SB
17342020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
1735
1736 * Makefile.am: Add z80-elf target support.
1737 * configure.ac: Likewise.
1738 * targets.c: Likewise.
1739 * Makefile.in: Regenerate.
1740 * configure: Regenerate.
1741 * config.bfd: Add z80-elf target support and new arches: ez80 and
1742 z180.
1743 * elf32-z80.c: New file.
1744 * archures.c: Add new z80 architectures: eZ80 and Z180.
1745 * coffcode.h: Likewise.
1746 * cpu-z80.c: Likewise.
1747 * coff-z80.c: Add new relocations for Z80 target and local label
1748 check.
1749 * reloc.c: Add new relocs.
1750 * bfd-in2.h: Regenerate.
1751 * libbfd.h: Regenerate.
1752
0db131fb
TC
17532020-01-02 Tamar Christina <tamar.christina@arm.com>
1754
1755 PR 25210
1756 PR 24753
1757 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
1758
b14ce8bf
AM
17592020-01-01 Alan Modra <amodra@gmail.com>
1760
1761 Update year range in copyright notice of all files.
1762
0b114740 1763For older changes see ChangeLog-2019
3499769a 1764\f
0b114740 1765Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
1766
1767Copying and distribution of this file, with or without modification,
1768are permitted in any medium without royalty provided the copyright
1769notice and this notice are preserved.
1770
1771Local Variables:
1772mode: change-log
1773left-margin: 8
1774fill-column: 74
1775version-control: never
1776End: