The "b" flag for COFF sections only unsets the LOAD attribute. It should also clear...
[deliverable/binutils-gdb.git] / bfd / ChangeLog
... / ...
CommitLineData
12020-03-25 Shahab Vahedi <shahab@synopsys.com>
2
3 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
4 correct field name in the output string.
5
62020-03-25 Alan Modra <amodra@gmail.com>
7
8 PR 25662
9 * elf.c (assign_file_positions_for_load_sections): Adjust offset
10 for SHT_NOBITS section if first in segment.
11
122020-03-24 H.J. Lu <hongjiu.lu@intel.com>
13
14 PR binutils/25708
15 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
16 (_bfd_elf_get_symbol_version_string): This.
17 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
18 (_bfd_elf_get_symbol_version_string): This.
19 (bfd_elf_print_symbol): Pass TRUE to
20 _bfd_elf_get_symbol_version_string.
21 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
22 bfd_boolean argument.
23 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
24 * targets.c (_bfd_get_symbol_version_string): Likewise.
25 (bfd_get_symbol_version_string): Likewise.
26 * bfd-in2.h: Regenerated.
27
282020-03-24 Nick Clifton <nickc@redhat.com>
29 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
30
31 PR 25713
32 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
33 Win32 systems.
34
352020-03-24 Nick Clifton <nickc@redhat.com>
36
37 PR 25681
38 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
39 segment to use for PT_GNU_RELRO, ignore empty sections in a
40 segment's current list.
41
422020-03-24 H.J. Lu <hongjiu.lu@intel.com>
43
44 PR binutils/25717
45 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
46
472020-03-24 H.J. Lu <hongjiu.lu@intel.com>
48
49 PR binutils/25708
50 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
51 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
52 on the previous _bfd_elf_get_symbol_version_string.
53 (_bfd_elf_get_symbol_version_string): Use it.
54
552020-03-24 Alan Modra <amodra@gmail.com>
56
57 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
58 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
59 struct areltdata.
60
612020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
62
63 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
64
652020-03-23 Alan Modra <amodra@gmail.com>
66
67 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
68 symbol count. Allocate an extra byte to ensure name strings
69 are terminated. Sanity check name offsets. Release memory on
70 error return.
71
722020-03-23 Alan Modra <amodra@gmail.com>
73
74 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
75 field hasn't been read. Remove unnecessary casts.
76
772020-03-22 Alan Modra <amodra@gmail.com>
78
79 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
80 enough to read number of symbols.
81
822020-03-20 H.J. Lu <hongjiu.lu@intel.com>
83
84 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
85 (EXECUTABLE_SUFFIX): Likewise.
86 * config.in: Regenerated.
87 * configure: Likewise.
88 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
89 _bfd_generic_close_and_cleanup.
90 (plugin_list_entry): Remove resolution_file, resolution_option,
91 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
92 lto_wrapper, gcc_env and initialized,
93 (need_lto_wrapper_p): Removed.
94 (get_lto_wrapper): Likewise.
95 (setup_lto_wrapper_env): Likewise.
96 (register_all_symbols_read): Likewise.
97 (egister_cleanup): Likewise.
98 (get_symbols): Likewise.
99 (add_input_file): Likewise.
100 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
101 (add_symbols): Updated.
102 (try_claim): Likewise.
103 (try_load_plugin): Likewise.
104 (bfd_plugin_canonicalize_symtab): Likewise.
105 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
106 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
107
1082020-03-19 H.J. Lu <hongjiu.lu@intel.com>
109
110 PR binutils/25640
111 * plugin.c (plugin_list_entry): Add has_symbol_type.
112 (add_symbols_v2): New function.
113 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
114 provides symbol type.
115 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
116 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
117 available.
118
1192020-03-20 Alan Modra <amodra@gmail.com>
120
121 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
122 enough to read number of symbols.
123
1242020-03-20 Alan Modra <amodra@gmail.com>
125
126 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
127 backend functions for NULL before calling.
128 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
129 (bfd_section_from_shdr, assign_section_numbers): Likewise.
130 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
131 * elfnn-ia64.c (ignore_errors): New function.
132 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
133
1342020-03-19 Nick Clifton <nickc@redhat.com>
135
136 PR 25676
137 * dwarf2.c (struct varinfo): Add unit_offset field to record the
138 location of the varinfo in the unit's debug info data. Change the
139 type of the stack field to a boolean.
140 (lookup_var_by_offset): New function. Returns the varinfo
141 structure for the variable described at the given offset in the
142 unit's debug info.
143 (scan_unit_for_symbols): Add support for variables which have the
144 DW_AT_specification attribute.
145
1462020-03-19 Nick Clifton <nickc@redhat.com>
147
148 PR 25699
149 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
150 error return.
151
1522020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
153
154 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
155
1562020-03-18 Nick Clifton <nickc@redhat.com>
157
158 PR 25673
159 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
160 memory access when processing a corrupt secondary reloc section.
161
1622020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
163
164 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
165 instead of calling abort.
166 * elf32-csky.c (csky_build_one_stub): Likewise.
167 * elf32-hppa.c (hppa_build_one_stub): Likewise.
168 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
169 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
170 * elf32-metag.c (metag_build_one_stub): Likewise.
171 * elf32-nios2.c (nios2_build_one_stub): Likewise.
172 * elf64-ppc.c (ppc_build_one_stub): Likewise.
173 (ppc_size_one_stub): Likewise.
174 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
175
1762020-03-17 Nick Clifton <nickc@redhat.com>
177
178 PR 25688
179 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
180 with error messages.
181
1822020-03-17 Nick Clifton <nickc@redhat.com>
183
184 PR 25687
185 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
186 free. Add free on another failure path.
187
1882020-03-16 Alan Modra <amodra@gmail.com>
189
190 PR 25675
191 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
192 we have a non-zero section count. Do lma comparison in octets.
193
1942020-03-16 Alan Modra <amodra@gmail.com>
195
196 * vms-alpha.c (dst_restore_location): Validate index into
197 dst_ptr_offsets array before accessing. Return status.
198 (dst_retrieve_location): Similarly, making "loc" parameter a
199 pointer to return value.
200 (_bfd_vms_slurp_etir): Update calls to above functions.
201
2022020-03-14 Kamil Rytarowski <n54@gmx.com>
203
204 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
205 targets.
206 * configure: Regenerated.
207
2082020-03-14 Alan Modra <amodra@gmail.com>
209
210 * section.c (BFD_FAKE_SECTIONS): Formatting.
211 * bfd-in2.h: Regenerate.
212
2132020-03-13 Kamil Rytarowski <n54@gmx.com>
214
215 * elf.c (elfcore_grok_netbsd_note): Add support for
216 NT_NETBSDCORE_LWPSTATUS notes.
217
2182020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
219
220 * bfd-in2.h: Regenerate.
221 * section.c (asection): Add already_assigned field.
222 (BFD_FAKE_SECTION): Add default initializer for it.
223 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
224 * elf32-arm.c (arm_build_one_stub): Add support for
225 non_contiguous_regions.
226 * elf32-csky.c (csky_build_one_stub): Likewise.
227 * elf32-hppa.c (hppa_build_one_stub): Likewise.
228 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
229 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
230 * elf32-metag.c (metag_build_one_stub): Likewise.
231 * elf32-nios2.c (nios2_build_one_stub): Likewise.
232 * elf64-ppc.c (ppc_build_one_stub): Likewise.
233 (ppc_size_one_stub): Likewise.
234 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
235 * elflink.c (elf_link_input_bfd): Likewise.
236
2372020-03-13 H.J. Lu <hongjiu.lu@intel.com>
238
239 PR ld/24920
240 * elf-linker-x86.h (elf_linker_x86_params): Add
241 static_before_all_inputs and has_dynamic_linker.
242 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
243 dynamic input objects if -static is passed at command-line
244 before all input files without --dynamic-linker unless
245 --no-dynamic-linker is used.
246
2472020-03-13 Kamil Rytarowski <n54@gmx.com>
248
249 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
250
2512020-03-13 Christian Eggers <ceggers@gmx.de>
252
253 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
254 "p_paddr" from "at".
255 * elfcode.h (bfd_from_remote_memory): Add units to several
256 parameters. New local "opb". Fix usage of p_align. Fix
257 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
258 call of target_read_memory.
259 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
260 calculation of "offset" and "output_offset".
261 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
262 from "offset" and fix calculation of "end" from "vma+size". Fix
263 comparison between "sh_addr" and "vma"/"output_offset".
264 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
265 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
266 member.
267 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
268 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
269 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
270 assignment of p_paddr from phdr_lma. Fix comparison between
271 "lma+size" and "next->lma".
272 (elf_sort_segments): Fix assignment from p_paddr to lma.
273 (assign_file_positions_for_load_sections): Add unit (bytes) to
274 local "align". Fix calculation of local "off_adjust". Fix
275 calculation of local "filehdr_vaddr".
276 (assign_file_positions_for_non_load_sections): New local "opb".
277 Fix calculation of "end" from "p_size". Fix comparison between
278 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
279 from "end" and "p_vaddr".
280 (rewrite_elf_program_header): Fix comparison between p_vaddr and
281 vma. Fix assignment to p_paddr from lma. Fix comparison between
282 p_paddr and lma. Fix assignment to p_paddr from lma.
283 * merge.c (sec_merge_emit): New local "opb". Convert
284 "alignment_power" to octets.
285 (_bfd_add_merge_section): New locals "alignment_power" and
286 "opb". Fix comparison between "alignment_power" and
287 "sizeof(align)".
288 (_bfd_merge_sections): New local "opb". Divide size by opb
289 before checking align mask.
290
2912020-03-13 Christian Eggers <ceggers@gmx.de>
292
293 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
294 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
295 section LMA/VMA.
296 (_bfd_elf_make_section_from_phdr): Similarly.
297 (elf_fake_sections): Fix calculation of
298 Elf_Internal_shdr::sh_addr from section VMA.
299 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
300 and bytes.
301 (assign_file_positions_for_load_sections): Fix calculations of
302 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
303 comparison between program header address and section LMA.
304 (assign_file_positions_for_non_load_sections): Likewise.
305 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
306 (IS_CONTAINED_BY_VMA): Add parameter opb.
307 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
308 INCLUDE_SECTION_IN_SEGMENT): Likewise.
309 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
310 Fix calculations of p_addr_valid and p_vaddr_offset.
311 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
312 with octets per byte when comparing against p_vaddr.
313
3142020-03-11 Alan Modra <amodra@gmail.com>
315
316 * som.c (setup_sections): Sanity check subspace.name.
317
3182020-03-11 Alan Modra <amodra@gmail.com>
319
320 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
321
3222020-03-10 Alan Modra <amodra@gmail.com>
323
324 PR 25648
325 * ihex.c (ihex_write_object_contents): Don't assume ordering of
326 addresses here.
327
3282020-03-09 Alan Modra <amodra@gmail.com>
329
330 * wasm-module.c (wasm_scan): Sanity check file name length
331 before allocating memory. Move common section setup code. Do
332 without bfd_tell to calculate section size.
333
3342020-03-06 Nick Clifton <nickc@redhat.com>
335
336 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
337 with error messages and failure return values.
338
3392020-03-05 Max Filippov <jcmvbkbc@gmail.com>
340
341 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
342 relocation sections for any removed reference to a dynamic symbol.
343
3442020-03-05 Nick Clifton <nickc@redhat.com>
345
346 * elf-bfd.h (struct elf_backend_data): Add new fields:
347 init_secondary_reloc_section, slurp_secondary_reloc_section,
348 write_secondary_reloc_section.
349 (_bfd_elf_init_secondary_reloc_section): Prototype.
350 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
351 (_bfd_elf_write_secondary_reloc_section): Prototype.
352 * elf.c ( bfd_section_from_shdr): Invoke the new
353 init_secondary_reloc_section backend function, if defined, when a
354 second reloc section is encountered.
355 (swap_out_syms): Invoke the new symbol_section_index function, if
356 defined, when computing the section index of an OS/PROC specific
357 symbol.
358 (_bfd_elf_init_secondary_reloc_section): New function.
359 (_bfd_elf_slurp_secondary_reloc_section): New function.
360 (_bfd_elf_write_secondary_reloc_section): New function.
361 (_bfd_elf_copy_special_section_fields): New function.
362 * elfcode.h (elf_write_relocs): Invoke the new
363 write_secondary_relocs function, if defined, in order to emit
364 secondary relocs.
365 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
366 function, if defined, in order to read in secondary relocs.
367 * elfxx-target.h (elf_backend_copy_special_section_fields):
368 Provide a non-NULL default definition.
369 (elf_backend_init_secondary_reloc_section): Likewise.
370 (elf_backend_slurp_secondary_reloc_section): Likewise.
371 (elf_backend_write_secondary_reloc_section): Likewise.
372 (struct elf_backend_data elfNN_bed): Add initialisers for the new
373 fields.
374 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
375 * configure: Regenerate.
376
3772020-03-05 Alan Modra <amodra@gmail.com>
378
379 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
380 against file size before allocating memory. Use bfd_alloc rather
381 than bfd_zalloc for carsym/strings memory.
382
3832020-03-04 Alan Modra <amodra@gmail.com>
384
385 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
386 sh_addr mod sh_addalign is zero.
387
3882020-03-04 Alan Modra <amodra@gmail.com>
389
390 * format.c (bfd_check_format_matches): Call cleanup on error exit.
391
3922020-03-03 Alan Modra <amodra@gmail.com>
393
394 * format.c (struct bfd_preserve): Add cleanup field.
395 (bfd_preserve_save): Add cleanup param and save.
396 (bfd_preserve_restore): Return cleanup.
397 (bfd_preserve_finish): Call the cleanup for the discarded match.
398 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
399 and clear when preserving a match. Restore cleanup too when
400 restoring that match.
401
4022020-03-02 Alan Modra <amodra@gmail.com>
403
404 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
405 * hpux-core.c (hpux_core_core_file_p): Update prototype.
406 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
407 (core_sco5_vec): Correct initialisers.
408
4092020-03-02 Alan Modra <amodra@gmail.com>
410
411 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
412 * aix5ppc-core.c (xcoff64_core_p): Likewise.
413 * cisco-core.c (cisco_core_file_validate): Likewise.
414 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
415 * hpux-core.c (hpux_core_core_file_p): Likewise.
416 * irix-core.c (irix_core_core_file_p): Likewise.
417 * lynx-core.c (lynx_core_file_p): Likewise.
418 * netbsd-core.c (netbsd_core_file_p): Likewise.
419 * osf-core.c (osf_core_core_file_p): Likewise.
420 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
421 * sco5-core.c (sco5_core_file_p): Likewise.
422
4232020-03-02 H.J. Lu <hongjiu.lu@intel.com>
424
425 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
426
4272020-03-02 Alan Modra <amodra@gmail.com>
428
429 * targets.c (bfd_cleanup): New typedef.
430 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
431 * libbfd-in.h (_bfd_no_cleanup): Define.
432 * format.c (bfd_reinit): Add cleanup parameter, call it.
433 (bfd_check_format_matches): Set cleanup from _bfd_check_format
434 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
435 * aout-target.h (callback, object_p): Return bfd_cleanup.
436 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
437 * archive.c (bfd_generic_archive_p): Likewise.
438 * binary.c (binary_object_p): Likewise.
439 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
440 * coff-ia64.c (ia64coff_object_p): Likewise.
441 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
442 * coff-sh.c (coff_small_object_p): Likewise.
443 * coff-stgo32.c (go32_check_format): Likewise.
444 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
445 (xcoff64_core_p): Likewise.
446 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
447 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
448 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
449 * elfcode.h (elf_object_p): Likewise.
450 * elfcore.h (elf_core_file_p): Likewise.
451 * i386msdos.c (msdos_object_p): Likewise.
452 * ihex.c (ihex_object_p): Likewise.
453 * libaout.h (some_aout_object_p): Likewise.
454 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
455 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
456 * libbfd.c (_bfd_dummy_target): Likewise.
457 * libcoff-in.h (coff_object_p): Likewise.
458 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
459 (bfd_mach_o_arm64_core_p): Likewise.
460 * mach-o-arm.c (bfd_mach_o_arm_object_p),
461 (bfd_mach_o_arm_core_p): Likewise.
462 * mach-o-i386.c (bfd_mach_o_i386_object_p),
463 (bfd_mach_o_i386_core_p): Likewise.
464 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
465 (bfd_mach_o_x86_64_core_p): Likewise.
466 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
467 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
468 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
469 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
470 * mmo.c (mmo_object_p): Likewise.
471 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
472 * peicode.h (coff_real_object_p, pe_ILF_object_p),
473 (pe_bfd_object_p): Likewise.
474 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
475 * ppcboot.c (ppcboot_object_p): Likewise.
476 * rs6000-core.c (rs6000coff_core_p): Likewise.
477 * som.c (som_object_setup, som_object_p): Likewise.
478 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
479 * tekhex.c (tekhex_object_p): Likewise.
480 * vms-alpha.c (alpha_vms_object_p): Likewise.
481 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
482 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
483 * wasm-module.c (wasm_object_p): Likewise.
484 * xsym.c (bfd_sym_object_p): Likewise.
485 * xsym.h (bfd_sym_object_p): Likewise.
486 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
487 return type.
488 * pdp11.c (some_aout_object_p): Likewise.
489 * plugin.c (register_ld_plugin_object_p): Update object_p
490 parameter type.
491 * plugin.h (register_ld_plugin_object_p): Likewise.
492 * bfd-in2.h: Regenerate.
493 * libbfd.h: Regenerate.
494 * libcoff.h: Regenerate.
495
4962020-03-02 Alan Modra <amodra@gmail.com>
497
498 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
499 applicable section flags.
500 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
501 (mips_ecoff_bele_vec): Likewise.
502 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
503 and .sbss sections.
504 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
505 (_bfd_ecoff_styp_to_sec_flags): Likewise.
506
5072020-03-02 Alan Modra <amodra@gmail.com>
508
509 * elf32-m32r.c (m32r_elf_section_flags): New function.
510 (elf_backend_section_flags): Define.
511 * elf32-nds32.c (nds32_elf_section_flags): New function.
512 (elf_backend_section_flags): Define.
513 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
514 .sbss and .sdata sections.
515 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
516 for SHF_V850_GPREL sections.
517 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
518 FIXME.
519 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
520 for SHF_PARISC_SHORT sections.
521 * elf64-ppc.c (ppc64_elf_section_flags): New function.
522 (elf_backend_section_flags): Define.
523 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
524 for SHF_MIPS_GPREL sections. Delete FIXME.
525
5262020-03-02 Alan Modra <amodra@gmail.com>
527
528 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
529 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
530 calling elf_backend_section_flags with adjusted params. Use
531 newsect->flags past that point.
532 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
533 special sections.
534 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
535 to have their type overridden, and all sh_flags but processor and
536 os specific.
537 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
538 * elf32-mep.c (mep_elf_section_flags): Likewise.
539 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
540 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
541 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
542 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
543 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
544 stub BFD and non-aarch64 input files when scanning for stubs.
545
5462020-03-02 Alan Modra <amodra@gmail.com>
547
548 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
549 limit to decompressed element size.
550
5512020-03-02 Alan Modra <amodra@gmail.com>
552
553 * vms-lib.c (vms_traverse_index): Add recur_count param and
554 update calls. Fail on excessive recursion.
555
5562020-03-02 Alan Modra <amodra@gmail.com>
557
558 * vms-alpha.c (vms_get_remaining_object_record): Use
559 bfd_realloc_or_free rather than bfd_realloc.
560 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
561 (dst_define_location, parse_module): Likewise, and check realloc
562 return status before using memory. Return status from function
563 adjusting all callers.
564
5652020-02-28 Alan Modra <amodra@gmail.com>
566
567 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
568
5692020-02-28 Alan Modra <amodra@gmail.com>
570
571 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
572 Remove duplicate undersize check.
573
5742020-02-27 Alan Modra <amodra@gmail.com>
575
576 PR 24511
577 * mmo.c (mmo_scan): Set SEC_DATA for .data.
578
5792020-02-27 Alan Modra <amodra@gmail.com>
580
581 PR 24511
582 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
583 (coff_section_type): Adjust comment.
584 (decode_section_type): Likewise. Call coff_section_type before
585 decode_section_type.
586 (bfd_decode_symclass): Use 'c' for common sections other than
587 the standard one.
588
5892020-02-27 Alan Modra <amodra@gmail.com>
590
591 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
592 malloc'd block.
593
5942020-02-27 Alan Modra <amodra@gmail.com>
595
596 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
597 if file is an archive element.
598 * bfd-in2.h: Regenerate.
599
6002020-02-26 Alan Modra <amodra@gmail.com>
601
602 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
603 bfd_set_error on failing test. Don't bother changing bfd_error on
604 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
605 Check sym name is within string buffer. Use size_t for some vars.
606 (do_slurp_coff_armap): Use size_t for some variables, fix size of
607 int_buf. Don't change bfd_error on file read error. Use
608 _bfd_mul_overflow when calculating carsym buffer size. Reorder
609 calculations to catch overflows before they occur. malloc and
610 free raw armap rather than using bfd_alloc. Read raw armap before
611 allocating carsym+strings buffer.
612 (_bfd_slurp_extended_name_table): Localize variables. Check
613 name size against file size.
614
6152020-02-26 Alan Modra <amodra@gmail.com>
616
617 * vms-lib.c (vms_lib_read_index): Release correct buffer.
618
6192020-02-26 Alan Modra <amodra@gmail.com>
620
621 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
622 malloc. Check for NULL return from bfd_malloc.
623 (rx_table_find, rx_table_map): Likewise.
624 (rx_set_section_contents): Check bfd_alloc return.
625 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
626
6272020-02-26 Alan Modra <amodra@gmail.com>
628
629 * aoutx.h: Indent labels correctly. Format error strings.
630 * archive.c: Likewise.
631 * archive64.c: Likewise.
632 * coff-arm.c: Likewise.
633 * coff-rs6000.c: Likewise.
634 * coff-stgo32.c: Likewise.
635 * cpu-arm.c: Likewise.
636 * dwarf2.c: Likewise.
637 * elf-ifunc.c: Likewise.
638 * elf-properties.c: Likewise.
639 * elf-s390-common.c: Likewise.
640 * elf-strtab.c: Likewise.
641 * elf.c: Likewise.
642 * elf32-arm.c: Likewise.
643 * elf32-bfin.c: Likewise.
644 * elf32-cr16.c: Likewise.
645 * elf32-csky.c: Likewise.
646 * elf32-i386.c: Likewise.
647 * elf32-m68k.c: Likewise.
648 * elf32-msp430.c: Likewise.
649 * elf32-nds32.c: Likewise.
650 * elf32-nios2.c: Likewise.
651 * elf32-pru.c: Likewise.
652 * elf32-xtensa.c: Likewise.
653 * elf64-ia64-vms.c: Likewise.
654 * elf64-x86-64.c: Likewise.
655 * elfcode.h: Likewise.
656 * elfcore.h: Likewise.
657 * elflink.c: Likewise.
658 * elfnn-aarch64.c: Likewise.
659 * elfnn-ia64.c: Likewise.
660 * elfnn-riscv.c: Likewise.
661 * elfxx-mips.c: Likewise.
662 * elfxx-sparc.c: Likewise.
663 * elfxx-x86.c: Likewise.
664 * i386lynx.c: Likewise.
665 * merge.c: Likewise.
666 * pdp11.c: Likewise.
667 * plugin.c: Likewise.
668 * reloc.c: Likewise.
669
6702020-02-26 Alan Modra <amodra@gmail.com>
671
672 PR 25593
673 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
674 "dyn_loaded".
675 (bfd_elf_add_dt_needed_tag): Declare.
676 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
677 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
678 from elf_add_dt_needed_tag. Remove soname and doit param.
679 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
680 to see whether as-needed lib is already loaded, use dyn_loaded
681 list instead. When saving and restoring around as-needed lib
682 handle possibility that dynstr has not been initialised. Don't
683 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
684 Mark libs loaded via DT_NEEDED entries of other libs with
685 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
686 the output.
687 (elf_link_check_versioned_symbol): Remove now unneccesary
688 DYNAMIC check when traversing dyn_loaded list.
689
6902020-02-26 Alan Modra <amodra@gmail.com>
691
692 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
693
6942020-02-25 H.J. Lu <hongjiu.lu@intel.com>
695
696 PR binutils/25584
697 * plugin.c (need_lto_wrapper_p): New.
698 (bfd_plugin_set_program_name): Add an int argument to set
699 need_lto_wrapper_p.
700 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
701 set.
702 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
703
7042020-02-24 Alan Modra <amodra@gmail.com>
705
706 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
707
7082020-02-24 Alan Modra <amodra@gmail.com>
709
710 * vms-lib.c (struct carsym_mem): Add limit.
711 (vms_add_index): Heed limit.
712 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
713 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
714 Always return actual number read.
715 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
716 assertion with error exit.
717
7182020-02-22 Alan Modra <amodra@gmail.com>
719
720 PR 25585
721 * elf.c (assign_file_positions_for_load_sections): Continue linking
722 on "PHDR segment not covered by LOAD segment" errors.
723
7242020-02-21 Alan Modra <amodra@gmail.com>
725
726 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
727 overflow check.
728 (bfd_mach_o_canonicalize_reloc): Likewise.
729 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
730 counts and offsets against file size.
731 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
732 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
733 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
734 against file size. Delete symbol table error message.
735 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
736 against file size.
737 (bfd_mach_o_read_symtab): Likewise.
738 (bfd_mach_o_read_command): Pass file size.
739 (bfd_mach_o_scan): Sanity check command count against file size.
740
7412020-02-21 Alan Modra <amodra@gmail.com>
742
743 PR 25569
744 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
745 "text", "data" and "bss" section pointer vars. Don't update
746 section size, just exec header sizes.
747 (adjust_sizes_and_vmas): Don't update text section size. Set
748 initial exec header a_text. Print exec headers sizes.
749 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
750 (adjust_sizes_and_vmas): Similarly. Formatting.
751 (final_link): Correct final file extension.
752
7532020-02-20 Nick Clifton <nickc@redhat.com>
754
755 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
756 callback.
757 * elfxx-target.h (elf_backend_symbol_section_index): Provide
758 default definition.
759 (elfNN_bed): Initialise the symbol_section_index field.
760 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
761 OS and PROC specific section indicies. Warn if converting other
762 reserved incidies to SHN_ABS.
763
7642020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
765
766 PR 25537
767 * cpu-z80.c: Add machine type compatibility checking.
768
7692020-02-19 H.J. Lu <hongjiu.lu@intel.com>
770
771 PR binutils/25355
772 * plugin.c (plugin_list_entry): Remove handle.
773 (try_load_plugin): Call dlclose before return.
774
7752020-02-19 Alan Modra <amodra@gmail.com>
776
777 * libbfd-in.h (_bfd_constant_p): Define.
778 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
779 file size before allocating memory.
780 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
781 * elf.c (bfd_elf_get_str_section): Likewise.
782 (_bfd_elf_slurp_version_tables): Likewise.
783 * libbfd.h: Regenerate.
784
7852020-02-19 Alan Modra <amodra@gmail.com>
786
787 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
788 * aoutx.h (aout_get_external_symbols): Replace calls to
789 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
790 (slurp_reloc_table): Likewise.
791 * archive.c (do_slurp_bsd_armap): Likewise.
792 (do_slurp_coff_armap): Likewise.
793 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
794 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
795 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
796 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
797 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
798 (_bfd_coff_get_external_symbols): Likewise.
799 * ecoff.c (ecoff_slurp_symbolic_header),
800 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
801 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
802 (ecoff_indirect_link_order): Likewise.
803 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
804 (_bfd_elf_slurp_version_tables): Likewise.
805 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
806 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
807 * elf32-rx.c (elf32_rx_relax_section): Likewise.
808 * elf64-alpha.c (READ): Likewise.
809 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
810 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
811 * elfcode.h (elf_slurp_symbol_table),
812 (elf_slurp_reloc_table_from_section): Likewise.
813 * elflink.c (elf_link_add_object_symbols),
814 (elf_link_check_versioned_symbol): Likewise.
815 * elfxx-mips.c (READ): Likewise.
816 * i386lynx.c (slurp_reloc_table): Likewise.
817 * lynx-core.c (lynx_core_file_p): Likewise.
818 * mach-o.c (bfd_mach_o_canonicalize_relocs),
819 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
820 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
821 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
822 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
823 (bfd_pef_parse_symbols): Likewise.
824 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
825 * som.c (setup_sections, som_slurp_string_table),
826 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
827 (som_bfd_fill_in_ar_symbols): Likewise.
828 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
829 (evax_bfd_print_image): Likewise.
830 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
831 * wasm-module.c (wasm_scan): Likewise.
832 * xcofflink.c (xcoff_link_add_symbols): Likewise.
833 * xsym.c (bfd_sym_read_name_table),
834 (bfd_sym_print_type_information_table_entry): Likewise.
835 * libbfd.h: Regenerate.
836
8372020-02-19 Alan Modra <amodra@gmail.com>
838
839 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
840 reading external relocs.
841 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
842 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
843 after bfd_bread.
844 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
845 bfd_release.
846 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
847 (m32c_elf_relax_section): Likewise.
848 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
849 (rl78_elf_relax_section): Likewise.
850 * elf32-rx.c (rx_offset_for_reloc): Likewise.
851 (elf32_rx_relax_section): Likewise.
852 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
853 parameter types and use..
854 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
855 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
856 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
857 being read from file, just the extra.
858 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
859 after reading external syms. Free on failure.
860
8612020-02-19 Alan Modra <amodra@gmail.com>
862
863 * coffcode.h (buy_and_read, coff_slurp_line_table),
864 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
865 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
866 corresponding bfd_alloc call. Adjust variables to suit.
867 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
868 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
869 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
870 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
871 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
872 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
873 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
874 * elf32-rx.c (elf32_rx_relax_section): Likewise.
875 * elf64-alpha.c (READ): Likewise.
876 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
877 (elf_slurp_symbol_table, elf_slurp_reloc_table),
878 (bfd_from_remote_memory): Likewise.
879 * elfcore.h (core_find_build_id): Likewise.
880 * elfxx-mips.c (READ): Likewise.
881 * mach-o.c (bfd_mach_o_mangle_sections),
882 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
883 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
884 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
885 * som.c (setup_sections, som_prep_for_fixups)
886 (som_build_and_write_symbol_table, som_slurp_symbol_table),
887 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
888 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
889 (som_bfd_ar_write_symbol_stuff): Likewise.
890 * vms-alpha.c (vector_grow1): Likewise.
891 * vms-lib.c (vms_add_index): Likewise.
892 * wasm-module.c (wasm_scan_name_function_section): Likewise.
893 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
894 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
895 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
896 (bfd_alloc2, bfd_zalloc2): Delete.
897 (_bfd_mul_overflow): Define.
898 * libbfd.h: Regenerate.
899
9002020-02-19 Alan Modra <amodra@gmail.com>
901
902 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
903 bfd_zalloc2.
904 (assign_section_numbers): Likewise.
905 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
906 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
907 bfd_malloc2, size_t amt, and unsigned tls_count.
908 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
909 * elflink.c (elf_create_symbuf): Use bfd_malloc.
910 (elf_output_implib): Use bfd_alloc.
911
9122020-02-19 Alan Modra <amodra@gmail.com>
913
914 * bfd.c (struct bfd): Move format and direction to other
915 bitfields. Add "size".
916 * bfdio.c (bfd_get_size): Cache size when not writing file.
917 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
918 returning zero, ie. unknown.
919 (bfd_get_alt_debug_link_info): Likewise.
920 * bfd-in2.h: Regenerate.
921
9222020-02-19 Alan Modra <amodra@gmail.com>
923
924 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
925 bfd_get_file_size twice.
926 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
927 zero, ie. unknown, return.
928 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
929 * elfcode.h (elf_swap_shdr_in): Likewise.
930 (elf_object_p): Don't call bfd_get_file_size twice and correct
931 file size check.
932
9332020-02-19 Alan Modra <amodra@gmail.com>
934
935 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
936 FALSE if memory alloc fails. Adjust calls.
937 * som.c (som_prep_for_fixups): Likewise.
938 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
939 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
940 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
941 * som.c (som_build_and_write_symbol_table): Return via error_return
942 on seek failure.
943 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
944 (VEC_APPEND_EL): Delete.
945 (vector_grow1): Return pointer to element. Catch overflow.
946 Return NULL on memory allocation failure.
947 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
948 (alpha_vms_add_fixup_ca): Likewise.
949 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
950 before using.
951 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
952
9532020-02-19 Alan Modra <amodra@gmail.com>
954
955 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
956 * aout-target.h (object_p): Likewise.
957 * aout-tic30.c (tic30_aout_object_p): Likewise.
958 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
959 (emit_stringtab, write_syms, link_hash_table_create),
960 (aout_link_write_other_symbol): Likewise.
961 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
962 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
963 (_bfd_compute_and_write_armap): Likewise.
964 * archures.c (bfd_arch_list): Likewise.
965 * bfd.c (bfd_record_phdr): Likewise.
966 * binary.c (binary_canonicalize_symtab): Likewise.
967 * cisco-core.c (cisco_core_file_validate): Likewise.
968 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
969 (find_arm_glue, record_arm_to_thumb_glue),
970 (record_thumb_to_arm_glue): Likewise.
971 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
972 (ppc_allocate_toc_section): Likewise.
973 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
974 * coff-sh.c (sh_relax_section): Likewise.
975 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
976 * coffcode.h (handle_COMDAT, coff_new_section_hook),
977 (coff_set_alignment_hook, coff_mkobject),
978 (coff_compute_section_file_positions): Likewise.
979 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
980 (coff_find_nearest_line_with_names),
981 ( bfd_coff_set_symbol_class): Likewise.
982 * cofflink.c (_bfd_coff_link_hash_table_create),
983 (_bfd_coff_link_input_bfd): Likewise.
984 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
985 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
986 (build_line_info_table, sort_line_sequences),
987 (line_info_add_include_dir, line_info_add_file_name),
988 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
989 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
990 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
991 (_bfd_ecoff_find_nearest_line),
992 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
993 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
994 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
995 * elf-m10300.c (mn10300_elf_relax_section),
996 (elf32_mn10300_link_hash_table_create): Likewise.
997 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
998 * elf.c (make_mapping, copy_elf_program_header): Likewise.
999 * elf32-arm.c (elf32_arm_link_hash_table_create),
1000 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1001 (elf32_arm_new_section_hook): Likewise.
1002 * elf32-avr.c (elf_avr_new_section_hook),
1003 (elf32_avr_link_hash_table_create, get_local_syms),
1004 (elf32_avr_setup_section_lists): Likewise.
1005 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1006 (bfin_link_hash_table_create): Likewise.
1007 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1008 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1009 * elf32-csky.c (csky_elf_link_hash_table_create),
1010 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1011 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1012 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1013 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1014 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1015 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1016 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1017 (m32r_elf_check_relocs): Likewise.
1018 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1019 (elf32_m68hc11_setup_section_lists),
1020 (elf32_m68hc11_size_stubs): Likewise.
1021 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1022 * elf32-metag.c (elf_metag_link_hash_table_create),
1023 (elf_metag_setup_section_lists): Likewise.
1024 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1025 (microblaze_elf_check_relocs): Likewise.
1026 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1027 (nds32_elf_check_relocs): Likewise.
1028 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1029 (get_local_syms, nios2_elf32_check_relocs),
1030 (nios2_elf32_link_hash_table_create): Likewise.
1031 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1032 (or1k_elf_check_relocs): Likewise.
1033 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1034 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1035 * elf32-s390.c (elf_s390_link_hash_table_create),
1036 (elf_s390_check_relocs): Likewise.
1037 * elf32-score.c (score_elf_create_got_section),
1038 (s3_elf32_score_new_section_hook),
1039 (elf32_score_link_hash_table_create): Likewise.
1040 * elf32-score7.c (score_elf_create_got_section),
1041 (s7_elf32_score_new_section_hook): Likewise.
1042 * elf32-sh.c (sh_elf_link_hash_table_create),
1043 (sh_elf_check_relocs): Likewise.
1044 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1045 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1046 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1047 (tilepro_elf_check_relocs): Likewise.
1048 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1049 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1050 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1051 (elf_xtensa_new_section_hook): Likewise.
1052 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1053 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1054 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1055 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1056 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1057 * elf64-ppc.c (ppc64_elf_new_section_hook),
1058 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1059 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1060 * elf64-s390.c (elf_s390_link_hash_table_create),
1061 (elf_s390_check_relocs): Likewise.
1062 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1063 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1064 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1065 (elf_link_add_archive_symbols, compute_bucket_count),
1066 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1067 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1068 (bfd_elf_final_link): Likewise.
1069 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1070 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1071 (elfNN_aarch64_new_section_hook): Likewise.
1072 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1073 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1074 (riscv_elf_check_relocs): Likewise.
1075 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1076 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1077 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1078 (_bfd_mips_elf_link_hash_table_create): Likewise.
1079 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1080 (_bfd_sparc_elf_check_relocs),
1081 (_bfd_sparc_elf_new_section_hook): Likewise.
1082 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1083 (tilegx_elf_check_relocs): Likewise.
1084 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1085 * format.c (bfd_check_format_matches): Likewise.
1086 * hash.c (_bfd_stringtab_init): Likewise.
1087 * ihex.c (ihex_scan): Likewise.
1088 * irix-core.c (irix_core_core_file_p): Likewise.
1089 * linker.c (bfd_wrapped_link_hash_lookup),
1090 (_bfd_generic_link_hash_table_create),
1091 (_bfd_generic_reloc_link_order): Likewise.
1092 * lynx-core.c (lynx_core_file_p): Likewise.
1093 * netbsd-core.c (netbsd_core_file_p): Likewise.
1094 * osf-core.c (osf_core_core_file_p): Likewise.
1095 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1096 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1097 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1098 * peicode.h (pe_mkobject): Likewise.
1099 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1100 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1101 * sco5-core.c (read_uarea): Likewise.
1102 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1103 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1104 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1105 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1106 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1107 * srec.c (srec_scan): Likewise.
1108 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1109 * targets.c (bfd_target_list): Likewise.
1110 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1111 * trad-core.c (trad_unix_core_file_p): Likewise.
1112 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1113 (vms_new_section_hook): Likewise.
1114 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1115 * xcofflink.c (xcoff_get_section_contents),
1116 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1117 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1118 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1119
11202020-02-19 Alan Modra <amodra@gmail.com>
1121
1122 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1123
11242020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1125
1126 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1127 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1128 a build_list_p argument. Don't search plugin_list. Short circuit
1129 when building the plugin list.
1130 (has_plugin): Renamed to has_plugin_list.
1131 (bfd_plugin_set_plugin): Don't set has_plugin.
1132 (bfd_plugin_specified_p): Check plugin_list instead.
1133 (build_plugin_list): New function.
1134 (load_plugin): Call build_plugin_list and use plugin_list.
1135
11362020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1137
1138 PR binutils/25355
1139 * plugin.c (try_claim): Always clean up for LTO wrapper.
1140 (try_load_plugin): Treat each object as independent. Create a
1141 copy for plugin name.
1142
11432020-02-11 Nick Clifton <nickc@redhat.com>
1144
1145 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1146 for addresses in print statements.
1147 (msp430_elf_relax_delete_bytes): Likewise.
1148 (msp430_elf_relax_add_words): Likewise.
1149 (msp430_elf_relax_section): Likewise.
1150
11512020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1152
1153 * plugin.c (add_symbols): Clear plugin_data memory.
1154
11552020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1156
1157 PR binutils/25355
1158 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1159 (EXECUTABLE_SUFFIX): Likewise.
1160 * config.in: Regenerated.
1161 * configure: Likewise.
1162 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1163 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1164 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1165 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1166 (get_lto_wrapper): New.
1167 (setup_lto_wrapper_env): Likewise.
1168 (current_plugin): Likewise.
1169 (register_all_symbols_read): Likewise.
1170 (register_cleanup): Likewise.
1171 (get_symbols): Likewise.
1172 (add_input_file): Likewise.
1173 (bfd_plugin_close_and_cleanup): Likewise.
1174 (claim_file): Removed.
1175 (register_claim_file): Set current_plugin->claim_file.
1176 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1177 lto_syms in current_plugin.
1178 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1179 all_symbols_read handler. Copy real symbols to plugin_data.
1180 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1181 (try_load_plugin): Don't reuse the previous plugin for LTO
1182 wrapper. Set up GCC LTO wrapper if possible. Don't set
1183 plugin_list_iter->claim_file.
1184 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1185 possible.
1186 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1187 real_syms.
1188
11892020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1190
1191 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1192 check if previous instruction matches a conditional jump inserted
1193 earlier. Invert conditional jump and delete branch in this case.
1194
11952020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1196
1197 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1198 msp430_elf_relax_add_words. Support insertion of either one or two
1199 words.
1200 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1201 needs to be grown. Handle insertion of branch instruction to replace
1202 jump.
1203
12042020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1205
1206 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1207 debugging relocations.
1208 (msp430_elf_relax_delete_bytes): Likewise.
1209 (msp430_elf_relax_add_two_words): Likewise.
1210 (msp430_elf_relax_section): Likewise.
1211
12122020-02-10 Alan Modra <amodra@gmail.com>
1213
1214 * archures.c: Wrap overlong z80 comments.
1215 * bfd-in2.h: Regenerate.
1216
12172020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1218
1219 PR 25469
1220 * archures.c: Add GBZ80 and Z80N machine values.
1221 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1222 * coff-z80.c: Add support for new reloc.
1223 * coffcode.h: Add support for new machine values.
1224 * cpu-z80.c: Add support for new machine names.
1225 * elf32-z80.c: Add support for new reloc.
1226 * bfd-in2.h: Regenerate.
1227 * libbfd.h: Regenerate.
1228
12292020-02-07 Nick Clifton <nickc@redhat.com>
1230
1231 PR 23932
1232 * elf.c (rewrite_elf_program_header): Do not complain if no
1233 sections are mapped to a segment.
1234
12352020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1236
1237 PR ld/25490
1238 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1239 for garbage collection on __patchable_function_entries section
1240 without linked-to section.
1241
12422020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1243
1244 PR gas/25381
1245 * bfd-in2.h: Regenerated.
1246 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1247 on section if gc_mark of any of its linked-to sections is set
1248 and don't set gc_mark again.
1249 * section.c (asection): Add linked_to_symbol_name to map_head
1250 union.
1251
12522020-02-06 Maciej W. Rozycki <macro@wdc.com>
1253
1254 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1255 reporting an unrecognized instruction with R_V850_LONGJUMP.
1256
12572020-02-05 Alan Modra <amodra@gmail.com>
1258
1259 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1260
12612020-02-04 Alan Modra <amodra@gmail.com>
1262
1263 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1264 R_PPC_VLE_ADDR20, goto copy_reloc.
1265
12662020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1267
1268 * bfd-in2.h: Regenerated.
1269 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1270
12712020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1272
1273 PR gas/25380
1274 * bfd-in2.h: Regenerated.
1275 * ecoff.c (bfd_debug_section): Add section_id.
1276 * section.c (bfd_section): Add section_id.
1277 (SEC_ASSEMBLER_SECTION_ID): New.
1278 (BFD_FAKE_SECTION): Add section_id.
1279
12802020-02-01 Nick Clifton <nickc@redhat.com>
1281
1282 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1283 obsolete list.
1284
12852020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1286
1287 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1288 encodings are relative to the GOT on nios2, too.
1289
12902020-01-31 Alan Modra <amodra@gmail.com>
1291
1292 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1293 file. Use $< and $@ in rules.
1294 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1295 (elf32-ia64.c, elf64-ia64.c): Likewise.
1296 (elf32-riscv.c, elf64-riscv.c): Likewise.
1297 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1298 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1299 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1300 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1301 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1302 * Makefile.in: Regenerate.
1303
13042020-01-31 Alan Modra <amodra@gmail.com>
1305
1306 PR 4110
1307 * elf.c (setup_group): Don't clear entire section contents,
1308 just the padding after group flags. Release alloc'd memory
1309 after a seek or read failure.
1310
13112020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1312
1313 * peXXigen.c (pe_is_repro): New function.
1314 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1315 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1316
13172020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1318
1319 * peXXigen.c (debug_type_names): Add names for new debug data type
1320 values.
1321
13222020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1323
1324 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1325 inner loop. Fix a memory leak.
1326
13272020-01-30 Alan Modra <amodra@gmail.com>
1328
1329 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1330 or obj_coff_keep_strings here.
1331 (coff_get_normalized_symtab): Free external syms directly.
1332 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1333 on error exit path.
1334
13352020-01-27 Jim Wilson <jimw@sifive.com>
1336
1337 * cpu-riscv.c (riscv_scan): New.
1338 (N): Change bfd_default_scan to riscv_scan.
1339
13402020-01-27 Andreas Schwab <schwab@suse.de>
1341
1342 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1343 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1344 * Makefile.in: Regenerate.
1345 * cpu-plugin.c: Remove.
1346 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1347 (bfd_plugin_arch): Remove declaration.
1348 * bfd-in2.h: Regenerate.
1349 * po/SRC-POTFILES.in: Regenerate.
1350
13512020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1352 Alan Modra <amodra@gmail.com>
1353
1354 PR ld/25458
1355 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1356
13572020-01-24 Jim Wilson <jimw@sifive.com>
1358
1359 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1360 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1361 avoid over long line.
1362
13632020-01-24 Nick Clifton <nickc@redhat.com>
1364
1365 PR 25447
1366 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1367 syms and keep strings flags as these may have been set in order to
1368 prevent a bogus call to free.
1369
13702020-01-23 Nick Clifton <nickc@redhat.com>
1371
1372 * po/fr.po: Updated French translation.
1373
13742020-01-23 Alan Modra <amodra@gmail.com>
1375
1376 PR 25444
1377 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1378 by zero when p_align is zero.
1379
13802020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1381
1382 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1383 (riscv_prefix_cmp): Likewise.
1384 (riscv_non_std_ext_p): Deleted.
1385 (riscv_std_sv_ext_p): Likewise.
1386 (riscv_non_std_sv_ext_p): Likewise.
1387 (riscv_merge_non_std_and_sv_ext): Rename to...
1388 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1389 (riscv_merge_arch_attr_info): Replace 3 calls to
1390 riscv_merge_non_std_and_sv_ext with single call to
1391 riscv_merge_multi_letter_ext.
1392 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1393 encounter a 'z' prefix.
1394 (riscv_get_prefix_class): New function, return prefix class based
1395 on first few characters of input string.
1396 (riscv_parse_config): New structure to factor out minor differences
1397 in extension class parsing behaviour.
1398 (riscv_parse_sv_or_non_std_ext): Rename to...
1399 (riscv_parse_prefixed_ext): and parameterise with
1400 riscv_parse_config.
1401 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1402 (riscv_multi_letter_ext_valid_p): New.
1403 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1404 (riscv_parse_subset): Delegate all non-single-letter parsing work
1405 to riscv_parse_prefixed_ext.
1406 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1407 (riscv_get_prefix_class): Declare.
1408
14092020-01-22 Alan Modra <amodra@gmail.com>
1410
1411 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1412 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1413 __tls_get_addr_desc.
1414 (ppc64_elf_size_stubs): Add section for linker generated
1415 __tls_get_addr_desc wrapper function. Loop at least once if
1416 generating this function.
1417 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1418 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1419
14202020-01-22 Alan Modra <amodra@gmail.com>
1421
1422 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1423 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1424 tga_desc_fd.
1425 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1426 (STDU_R1_0R1, ADDI_R1_R1): Define.
1427 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1428 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1429 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1430 no_tls_get_addr_regsave.
1431 (branch_reloc_hash_match): Add hash3 and hash4.
1432 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1433 (ppc64_elf_size_dynamic_sections): Likewise.
1434 (ppc64_elf_relocate_section): Likewise.
1435 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1436 __tls_get_addr stub.
1437 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1438 eh_frame.
1439 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1440 eh_frame for regsave __tls_get_addr.
1441
14422020-01-22 Alan Modra <amodra@gmail.com>
1443
1444 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1445 which __tls_get_addr calls will be eliminated.
1446
14472020-01-20 Nick Clifton <nickc@redhat.com>
1448
1449 * po/pt.po: Updates Portuguese translation.
1450 * po/ru.po: Updated Russian translation.
1451 * po/uk.po: Updated Ukranian translation.
1452
14532020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1454
1455 PR ld/25416
1456 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1457 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1458 X32 mode.
1459 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1460 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1461 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1462 "rex leal x@tlsdesc(%rip), %reg" to
1463 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1464 "call *(%eax)" to "nopl (%rax)".
1465
14662020-01-20 Alan Modra <amodra@gmail.com>
1467
1468 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1469 (MTLR_R11): Don't define.
1470 (LD_R0_0R3, CMPDI_R0_0): Define.
1471 (build_tls_get_addr_stub): Don't use r11 in stub.
1472
14732020-01-20 Alan Modra <amodra@gmail.com>
1474
1475 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1476 (defined_sym_val, is_tls_get_addr): Likewise.
1477
14782020-01-18 Nick Clifton <nickc@redhat.com>
1479
1480 * version.m4 (BFD_VERSION): Set to 2.34.50.
1481 * configure: Regenerate.
1482 * po/bfd.pot: Regenerate.
1483
14842020-01-18 Nick Clifton <nickc@redhat.com>
1485
1486 Binutils 2.34 branch created.
1487
14882020-01-17 Christian Biesinger <cbiesinger@google.com>
1489
1490 * coff-arm.c: Fix spelling error (seperate).
1491 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1492 error (seperate).
1493 * sysdep.h (strnlen): Fix spelling error (seperate).
1494
14952020-01-15 Lars Brinkhoff <lars@nocrew.org>
1496
1497 PR 20694
1498 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1499
15002020-01-15 Alan Modra <amodra@gmail.com>
1501
1502 PR 25384
1503 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1504 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1505 of function symbols unless dot symbols are present. Do warn
1506 whenever one is created, regardles of whether a PLT entry is
1507 also emitted for the function symbol.
1508
15092020-01-14 Alan Modra <amodra@gmail.com>
1510
1511 * som.c (som_bfd_count_ar_symbols): Error when file position
1512 of symbols on chains is not strictly increasing.
1513
15142020-01-14 Alan Modra <amodra@gmail.com>
1515
1516 * vms.h (VMS_DEBUG): Define as 0.
1517 * vms-alpha.c (image_write): Move debug output after bounds check.
1518 Tidy bounds check.
1519 (_bfd_vms_slurp_eihd): Warning fix.
1520 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1521
15222020-01-13 Alan Modra <amodra@gmail.com>
1523
1524 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1525 for "ignored" records.
1526
15272020-01-13 Alan Modra <amodra@gmail.com>
1528
1529 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1530 Delete asect name check. Move asect NULL check to wasm_object_p.
1531 Correct bounds check of sizes against end. Replace uses of
1532 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1533 just one bfd_release.
1534 (wasm_scan): Don't use malloc/strdup for section names,
1535 bfd_alloc instead. Simplify code prefixing section name.
1536 Formatting. Don't attempt to free memory here..
1537 (wasm_object_p): ..do so here.
1538
15392020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1540
1541 PR ld/22269
1542 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1543 UNDEFWEAK_NO_DYNAMIC_RELOC.
1544 (allocate_dynrelocs_for_symbol): Likewise.
1545
15462020-01-10 Tamar Christina <tamar.christina@arm.com>
1547
1548 PR 25210
1549 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1550
15512020-01-10 Alan Modra <amodra@gmail.com>
1552
1553 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1554
15552020-01-09 Nick Clifton <nickc@redhat.com>
1556
1557 PR 25221
1558 * bfd.c (bfd_convert_section_contents): Check for a compress
1559 header size that is larger than the actual section size.
1560
15612020-01-08 Alan Modra <amodra@gmail.com>
1562
1563 PR 25351
1564 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1565 after removing sections.
1566
15672020-01-06 Jim Wilson <jimw@sifive.com>
1568
1569 PR 25205
1570 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1571 check for !bfd_link_pic (info).
1572 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1573 <R_RISCV_JAL>: Add comment.
1574 (_bfd_riscv_relax_section): For plt.offset check, add check for
1575 bfd_link_pic (info). Add comment.
1576
15772020-01-06 Alan Modra <amodra@gmail.com>
1578
1579 * format.c (bfd_check_format_matches): Ignore bfd_error on target
1580 match failures. Don't init to bfd_error_wrong_format before
1581 calling _bfd_check_format.
1582
15832020-01-06 Alan Modra <amodra@gmail.com>
1584
1585 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
1586 status rather than exiting on stack overflow or underflow.
1587 (_bfd_vms_slurp_etir): Adjust to suit.
1588
15892020-01-06 Alan Modra <amodra@gmail.com>
1590
1591 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
1592
15932020-01-06 Alan Modra <amodra@gmail.com>
1594
1595 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
1596 command. Check name offset is within command.
1597 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
1598 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
1599 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
1600 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
1601 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
1602 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
1603 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
1604 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
1605 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
1606 (bfd_mach_o_read_segment): Similarly.
1607 (bfd_mach_o_read_thread): Properly bound check thread struct.
1608 Don't repeat checks on second loop.
1609 (bfd_mach_o_read_command): Fail on invalid command length.
1610
16112020-01-04 Alan Modra <amodra@gmail.com>
1612
1613 * format.c (bfd_check_format_matches): Add preserve_match.
1614 Save initial bfd state in "preserve", matched bfd state in
1615 "preserve_match". Save just the first match. Release
1616 bfd_alloc memory. Restore and finish preserved state as
1617 appropriate on all function exit paths.
1618
16192020-01-04 Alan Modra <amodra@gmail.com>
1620
1621 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
1622
16232020-01-04 Alan Modra <amodra@gmail.com>
1624
1625 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
1626 match too.
1627
16282020-01-03 Nick Clifton <nickc@redhat.com>
1629
1630 PR 25307
1631 (bfd_pef_parse_function_stubs): Correct the test that ensures that
1632 there is enough data remaining in the code buffer before
1633 attempting to read a function stub.
1634
16352020-01-03 Nick Clifton <nickc@redhat.com>
1636
1637 PR 25308
1638 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
1639 return value from bfd_malloc.
1640 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1641 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
1642 (elf32_arm_filter_cmse_symbols): Likewise.
1643 (elf32_arm_write_section): Likewise.
1644 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1645 (bfd_mach_o_follow_dsym): Likewise.
1646 * pef.c (bfd_pef_print_loader_section): Likewise.
1647 (bfd_pef_scan_start_address): Likewise.
1648 (bfd_pef_parse_function_stubs): Likewise.
1649 (bfd_pef_parse_symbols): Likewise.
1650
16512020-01-03 Sergei Trofimovich <siarheit@google.com>
1652
1653 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
1654 on binary inputs ld/PR25316.
1655 (is_ia64_elf): new helper to filter on ia64 objects.
1656
16572020-01-03 Jan Beulich <jbeulich@suse.com>
1658
1659 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
1660 in parameter names.
1661 (bfd_mach_o_scan): Insert underscore in two variable names.
1662
16632020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
1664
1665 * Makefile.am: Add z80-elf target support.
1666 * configure.ac: Likewise.
1667 * targets.c: Likewise.
1668 * Makefile.in: Regenerate.
1669 * configure: Regenerate.
1670 * config.bfd: Add z80-elf target support and new arches: ez80 and
1671 z180.
1672 * elf32-z80.c: New file.
1673 * archures.c: Add new z80 architectures: eZ80 and Z180.
1674 * coffcode.h: Likewise.
1675 * cpu-z80.c: Likewise.
1676 * coff-z80.c: Add new relocations for Z80 target and local label
1677 check.
1678 * reloc.c: Add new relocs.
1679 * bfd-in2.h: Regenerate.
1680 * libbfd.h: Regenerate.
1681
16822020-01-02 Tamar Christina <tamar.christina@arm.com>
1683
1684 PR 25210
1685 PR 24753
1686 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
1687
16882020-01-01 Alan Modra <amodra@gmail.com>
1689
1690 Update year range in copyright notice of all files.
1691
1692For older changes see ChangeLog-2019
1693\f
1694Copyright (C) 2020 Free Software Foundation, Inc.
1695
1696Copying and distribution of this file, with or without modification,
1697are permitted in any medium without royalty provided the copyright
1698notice and this notice are preserved.
1699
1700Local Variables:
1701mode: change-log
1702left-margin: 8
1703fill-column: 74
1704version-control: never
1705End:
This page took 0.027976 seconds and 4 git commands to generate.