1 2020-04-01 Tamar Christina <tamar.christina@arm.com>
4 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
5 address in the GOT if in thumb only mode.
7 2020-04-01 Tamar Christina <tamar.christina@arm.com>
9 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
11 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
13 * mmo.c (mmo_scan): Create .text section only when needed, not
16 2020-03-31 Alan Modra <amodra@gmail.com>
18 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
21 2020-03-31 Alan Modra <amodra@gmail.com>
23 * vms-alpha.c (image_write): Check bounds for sections without
24 contents too. Error on non-zero write to section without
26 (_bfd_vms_slurp_etir): Check return of image_write* functions.
28 2020-03-31 Alan Modra <amodra@gmail.com>
30 * tekhex.c (pass_over): Check is_eof before reading buffer.
32 2020-03-30 Nick Clifton <nickc@redhat.com>
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
42 2020-03-30 Alan Modra <amodra@gmail.com>
45 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
48 2020-03-26 Nick Clifton <nickc@redhat.com>
50 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
51 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
53 * libbfd.h: Regenerate.
55 2020-03-26 Alan Modra <amodra@gmail.com>
57 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
59 2020-03-26 Alan Modra <amodra@gmail.com>
61 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
63 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
65 2020-03-25 Nick Clifton <nickc@redhat.com>
67 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
69 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
70 * libbfd.h: Regenerate.
72 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
74 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
75 correct field name in the output string.
77 2020-03-25 Alan Modra <amodra@gmail.com>
80 * elf.c (assign_file_positions_for_load_sections): Adjust offset
81 for SHT_NOBITS section if first in segment.
83 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
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
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.
99 2020-03-24 Nick Clifton <nickc@redhat.com>
100 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
103 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
106 2020-03-24 Nick Clifton <nickc@redhat.com>
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.
113 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
116 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
118 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
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.
126 2020-03-24 Alan Modra <amodra@gmail.com>
128 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
129 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
132 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
134 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
136 2020-03-23 Alan Modra <amodra@gmail.com>
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
143 2020-03-23 Alan Modra <amodra@gmail.com>
145 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
146 field hasn't been read. Remove unnecessary casts.
148 2020-03-22 Alan Modra <amodra@gmail.com>
150 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
151 enough to read number of symbols.
153 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
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.
179 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
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
190 2020-03-20 Alan Modra <amodra@gmail.com>
192 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
193 enough to read number of symbols.
195 2020-03-20 Alan Modra <amodra@gmail.com>
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.
205 2020-03-19 Nick Clifton <nickc@redhat.com>
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
214 (scan_unit_for_symbols): Add support for variables which have the
215 DW_AT_specification attribute.
217 2020-03-19 Nick Clifton <nickc@redhat.com>
220 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
223 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
225 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
227 2020-03-18 Nick Clifton <nickc@redhat.com>
230 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
231 memory access when processing a corrupt secondary reloc section.
233 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
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.
247 2020-03-17 Nick Clifton <nickc@redhat.com>
250 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
253 2020-03-17 Nick Clifton <nickc@redhat.com>
256 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
257 free. Add free on another failure path.
259 2020-03-16 Alan Modra <amodra@gmail.com>
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.
265 2020-03-16 Alan Modra <amodra@gmail.com>
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.
273 2020-03-14 Kamil Rytarowski <n54@gmx.com>
275 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
277 * configure: Regenerated.
279 2020-03-14 Alan Modra <amodra@gmail.com>
281 * section.c (BFD_FAKE_SECTIONS): Formatting.
282 * bfd-in2.h: Regenerate.
284 2020-03-13 Kamil Rytarowski <n54@gmx.com>
286 * elf.c (elfcore_grok_netbsd_note): Add support for
287 NT_NETBSDCORE_LWPSTATUS notes.
289 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
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.
308 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
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.
318 2020-03-13 Kamil Rytarowski <n54@gmx.com>
320 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
322 2020-03-13 Christian Eggers <ceggers@gmx.de>
324 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
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
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
359 (_bfd_merge_sections): New local "opb". Divide size by opb
360 before checking align mask.
362 2020-03-13 Christian Eggers <ceggers@gmx.de>
364 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
365 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
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
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.
385 2020-03-11 Alan Modra <amodra@gmail.com>
387 * som.c (setup_sections): Sanity check subspace.name.
389 2020-03-11 Alan Modra <amodra@gmail.com>
391 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
393 2020-03-10 Alan Modra <amodra@gmail.com>
396 * ihex.c (ihex_write_object_contents): Don't assume ordering of
399 2020-03-09 Alan Modra <amodra@gmail.com>
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.
405 2020-03-06 Nick Clifton <nickc@redhat.com>
407 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
408 with error messages and failure return values.
410 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
412 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
413 relocation sections for any removed reference to a dynamic symbol.
415 2020-03-05 Nick Clifton <nickc@redhat.com>
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
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
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
445 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
446 * configure: Regenerate.
448 2020-03-05 Alan Modra <amodra@gmail.com>
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.
454 2020-03-04 Alan Modra <amodra@gmail.com>
456 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
457 sh_addr mod sh_addalign is zero.
459 2020-03-04 Alan Modra <amodra@gmail.com>
461 * format.c (bfd_check_format_matches): Call cleanup on error exit.
463 2020-03-03 Alan Modra <amodra@gmail.com>
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.
473 2020-03-02 Alan Modra <amodra@gmail.com>
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.
480 2020-03-02 Alan Modra <amodra@gmail.com>
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.
494 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
496 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
498 2020-03-02 Alan Modra <amodra@gmail.com>
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
559 * pdp11.c (some_aout_object_p): Likewise.
560 * plugin.c (register_ld_plugin_object_p): Update object_p
562 * plugin.h (register_ld_plugin_object_p): Likewise.
563 * bfd-in2.h: Regenerate.
564 * libbfd.h: Regenerate.
565 * libcoff.h: Regenerate.
567 2020-03-02 Alan Modra <amodra@gmail.com>
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
575 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
576 (_bfd_ecoff_styp_to_sec_flags): Likewise.
578 2020-03-02 Alan Modra <amodra@gmail.com>
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
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.
597 2020-03-02 Alan Modra <amodra@gmail.com>
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
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
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.
617 2020-03-02 Alan Modra <amodra@gmail.com>
619 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
620 limit to decompressed element size.
622 2020-03-02 Alan Modra <amodra@gmail.com>
624 * vms-lib.c (vms_traverse_index): Add recur_count param and
625 update calls. Fail on excessive recursion.
627 2020-03-02 Alan Modra <amodra@gmail.com>
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.
636 2020-02-28 Alan Modra <amodra@gmail.com>
638 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
640 2020-02-28 Alan Modra <amodra@gmail.com>
642 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
643 Remove duplicate undersize check.
645 2020-02-27 Alan Modra <amodra@gmail.com>
648 * mmo.c (mmo_scan): Set SEC_DATA for .data.
650 2020-02-27 Alan Modra <amodra@gmail.com>
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
657 (bfd_decode_symclass): Use 'c' for common sections other than
660 2020-02-27 Alan Modra <amodra@gmail.com>
662 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
665 2020-02-27 Alan Modra <amodra@gmail.com>
667 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
668 if file is an archive element.
669 * bfd-in2.h: Regenerate.
671 2020-02-26 Alan Modra <amodra@gmail.com>
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.
686 2020-02-26 Alan Modra <amodra@gmail.com>
688 * vms-lib.c (vms_lib_read_index): Release correct buffer.
690 2020-02-26 Alan Modra <amodra@gmail.com>
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.
698 2020-02-26 Alan Modra <amodra@gmail.com>
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.
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.
738 * plugin.c: Likewise.
741 2020-02-26 Alan Modra <amodra@gmail.com>
744 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
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
758 (elf_link_check_versioned_symbol): Remove now unneccesary
759 DYNAMIC check when traversing dyn_loaded list.
761 2020-02-26 Alan Modra <amodra@gmail.com>
763 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
765 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
768 * plugin.c (need_lto_wrapper_p): New.
769 (bfd_plugin_set_program_name): Add an int argument to set
771 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
773 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
775 2020-02-24 Alan Modra <amodra@gmail.com>
777 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
779 2020-02-24 Alan Modra <amodra@gmail.com>
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.
789 2020-02-22 Alan Modra <amodra@gmail.com>
792 * elf.c (assign_file_positions_for_load_sections): Continue linking
793 on "PHDR segment not covered by LOAD segment" errors.
795 2020-02-21 Alan Modra <amodra@gmail.com>
797 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
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
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.
812 2020-02-21 Alan Modra <amodra@gmail.com>
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.
824 2020-02-20 Nick Clifton <nickc@redhat.com>
826 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
828 * elfxx-target.h (elf_backend_symbol_section_index): Provide
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.
835 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
838 * cpu-z80.c: Add machine type compatibility checking.
840 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
843 * plugin.c (plugin_list_entry): Remove handle.
844 (try_load_plugin): Call dlclose before return.
846 2020-02-19 Alan Modra <amodra@gmail.com>
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.
856 2020-02-19 Alan Modra <amodra@gmail.com>
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.
908 2020-02-19 Alan Modra <amodra@gmail.com>
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
915 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
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.
932 2020-02-19 Alan Modra <amodra@gmail.com>
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.
971 2020-02-19 Alan Modra <amodra@gmail.com>
973 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
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.
983 2020-02-19 Alan Modra <amodra@gmail.com>
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.
993 2020-02-19 Alan Modra <amodra@gmail.com>
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
1004 2020-02-19 Alan Modra <amodra@gmail.com>
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
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
1022 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1024 2020-02-19 Alan Modra <amodra@gmail.com>
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.
1191 2020-02-19 Alan Modra <amodra@gmail.com>
1193 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1195 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
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.
1207 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
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.
1214 2020-02-11 Nick Clifton <nickc@redhat.com>
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.
1222 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1224 * plugin.c (add_symbols): Clear plugin_data memory.
1226 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
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
1257 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1260 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
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.
1266 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
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
1271 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1272 needs to be grown. Handle insertion of branch instruction to replace
1275 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
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.
1283 2020-02-10 Alan Modra <amodra@gmail.com>
1285 * archures.c: Wrap overlong z80 comments.
1286 * bfd-in2.h: Regenerate.
1288 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
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.
1300 2020-02-07 Nick Clifton <nickc@redhat.com>
1303 * elf.c (rewrite_elf_program_header): Do not complain if no
1304 sections are mapped to a segment.
1306 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
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.
1313 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
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
1323 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
1325 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1326 reporting an unrecognized instruction with R_V850_LONGJUMP.
1328 2020-02-05 Alan Modra <amodra@gmail.com>
1330 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1332 2020-02-04 Alan Modra <amodra@gmail.com>
1334 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1335 R_PPC_VLE_ADDR20, goto copy_reloc.
1337 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1339 * bfd-in2.h: Regenerated.
1340 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1342 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
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.
1351 2020-02-01 Nick Clifton <nickc@redhat.com>
1353 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1356 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
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.
1361 2020-01-31 Alan Modra <amodra@gmail.com>
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.
1375 2020-01-31 Alan Modra <amodra@gmail.com>
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.
1382 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
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.
1388 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1390 * peXXigen.c (debug_type_names): Add names for new debug data type
1393 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1395 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1396 inner loop. Fix a memory leak.
1398 2020-01-30 Alan Modra <amodra@gmail.com>
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
1406 2020-01-27 Jim Wilson <jimw@sifive.com>
1408 * cpu-riscv.c (riscv_scan): New.
1409 (N): Change bfd_default_scan to riscv_scan.
1411 2020-01-27 Andreas Schwab <schwab@suse.de>
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.
1422 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1423 Alan Modra <amodra@gmail.com>
1426 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1428 2020-01-24 Jim Wilson <jimw@sifive.com>
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.
1434 2020-01-24 Nick Clifton <nickc@redhat.com>
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.
1441 2020-01-23 Nick Clifton <nickc@redhat.com>
1443 * po/fr.po: Updated French translation.
1445 2020-01-23 Alan Modra <amodra@gmail.com>
1448 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1449 by zero when p_align is zero.
1451 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
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
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.
1480 2020-01-22 Alan Modra <amodra@gmail.com>
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.
1491 2020-01-22 Alan Modra <amodra@gmail.com>
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
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
1510 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1511 eh_frame for regsave __tls_get_addr.
1513 2020-01-22 Alan Modra <amodra@gmail.com>
1515 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1516 which __tls_get_addr calls will be eliminated.
1518 2020-01-20 Nick Clifton <nickc@redhat.com>
1520 * po/pt.po: Updates Portuguese translation.
1521 * po/ru.po: Updated Russian translation.
1522 * po/uk.po: Updated Ukranian translation.
1524 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
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
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)".
1537 2020-01-20 Alan Modra <amodra@gmail.com>
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.
1544 2020-01-20 Alan Modra <amodra@gmail.com>
1546 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1547 (defined_sym_val, is_tls_get_addr): Likewise.
1549 2020-01-18 Nick Clifton <nickc@redhat.com>
1551 * version.m4 (BFD_VERSION): Set to 2.34.50.
1552 * configure: Regenerate.
1553 * po/bfd.pot: Regenerate.
1555 2020-01-18 Nick Clifton <nickc@redhat.com>
1557 Binutils 2.34 branch created.
1559 2020-01-17 Christian Biesinger <cbiesinger@google.com>
1561 * coff-arm.c: Fix spelling error (seperate).
1562 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1564 * sysdep.h (strnlen): Fix spelling error (seperate).
1566 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
1569 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1571 2020-01-15 Alan Modra <amodra@gmail.com>
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.
1580 2020-01-14 Alan Modra <amodra@gmail.com>
1582 * som.c (som_bfd_count_ar_symbols): Error when file position
1583 of symbols on chains is not strictly increasing.
1585 2020-01-14 Alan Modra <amodra@gmail.com>
1587 * vms.h (VMS_DEBUG): Define as 0.
1588 * vms-alpha.c (image_write): Move debug output after bounds check.
1590 (_bfd_vms_slurp_eihd): Warning fix.
1591 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1593 2020-01-13 Alan Modra <amodra@gmail.com>
1595 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1596 for "ignored" records.
1598 2020-01-13 Alan Modra <amodra@gmail.com>
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.
1610 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1613 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1614 UNDEFWEAK_NO_DYNAMIC_RELOC.
1615 (allocate_dynrelocs_for_symbol): Likewise.
1617 2020-01-10 Tamar Christina <tamar.christina@arm.com>
1620 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1622 2020-01-10 Alan Modra <amodra@gmail.com>
1624 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1626 2020-01-09 Nick Clifton <nickc@redhat.com>
1629 * bfd.c (bfd_convert_section_contents): Check for a compress
1630 header size that is larger than the actual section size.
1632 2020-01-08 Alan Modra <amodra@gmail.com>
1635 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1636 after removing sections.
1638 2020-01-06 Jim Wilson <jimw@sifive.com>
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.
1648 2020-01-06 Alan Modra <amodra@gmail.com>
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.
1654 2020-01-06 Alan Modra <amodra@gmail.com>
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.
1660 2020-01-06 Alan Modra <amodra@gmail.com>
1662 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
1664 2020-01-06 Alan Modra <amodra@gmail.com>
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.
1682 2020-01-04 Alan Modra <amodra@gmail.com>
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.
1690 2020-01-04 Alan Modra <amodra@gmail.com>
1692 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
1694 2020-01-04 Alan Modra <amodra@gmail.com>
1696 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
1699 2020-01-03 Nick Clifton <nickc@redhat.com>
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.
1706 2020-01-03 Nick Clifton <nickc@redhat.com>
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.
1722 2020-01-03 Sergei Trofimovich <siarheit@google.com>
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.
1728 2020-01-03 Jan Beulich <jbeulich@suse.com>
1730 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
1732 (bfd_mach_o_scan): Insert underscore in two variable names.
1734 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
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
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
1749 * reloc.c: Add new relocs.
1750 * bfd-in2.h: Regenerate.
1751 * libbfd.h: Regenerate.
1753 2020-01-02 Tamar Christina <tamar.christina@arm.com>
1757 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
1759 2020-01-01 Alan Modra <amodra@gmail.com>
1761 Update year range in copyright notice of all files.
1763 For older changes see ChangeLog-2019
1765 Copyright (C) 2020 Free Software Foundation, Inc.
1767 Copying and distribution of this file, with or without modification,
1768 are permitted in any medium without royalty provided the copyright
1769 notice and this notice are preserved.
1775 version-control: never