1 2020-05-21 Alan Modra <amodra@gmail.com>
3 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
4 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
5 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
6 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
7 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
8 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
9 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
10 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
11 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
12 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
13 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
14 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
15 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
16 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
17 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
18 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
19 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
20 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
21 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
22 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
24 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
26 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
27 get_default_version. It is used to find the default version for
28 the specific extension.
29 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
30 default_major_version and default_minor_version. Add new bfd_boolean
31 parameter *use_default_version. Set it to TRUE if we need to call
32 the callback rps->get_default_version to find the default version.
33 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
34 the default version in riscv_parsing_subset_version, and then call
35 riscv_add_subset to add the subset into subset list.
36 (riscv_parse_prefixed_ext): Likewise.
37 (riscv_std_z_ext_strtab): Support Zicsr extensions.
38 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
39 strings rather than characters.
40 riscv_merge_arch_attr_info): The callback function get_default_version
41 is only needed for assembler, so set it to NULL int the linker.
42 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
43 * elfxx-riscv.h: Updated.
45 2020-05-20 Alan Modra <amodra@gmail.com>
48 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
50 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
51 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
52 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
53 (bfd_create): Likewise.
54 (_bfd_delete_bfd): Don't free filename.
55 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
56 return pointer to the copy or NULL on alloc fail.
57 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
58 result of bfd_set_filename.
59 * bfd-in2.h: Regenerate.
61 2020-05-20 Alan Modra <amodra@gmail.com>
64 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
65 section size against file size.
66 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
68 2020-05-19 Gunther Nikl <gnikl@justmail.de>
71 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
72 and memset when allocating memory for the sections_being_created
75 2020-05-19 Stafford Horne <shorne@gmail.com>
77 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
79 (or1k_elf_relocate_section): Access srelgot via
80 htab->root.srelgot. Add assertions for srelgot->contents.
81 Introduce local variable for srelgot to not reuse global
83 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
84 (or1k_set_got_and_rela_sizes): New function.
85 (or1k_initial_exec_offset): New function.
86 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
87 (or1k_elf_relocate_section): Allow for TLS to handle multiple
89 (or1k_elf_check_relocs): Use OR to set TLS access.
90 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
92 (or1k_elf_size_dynamic_sections): Use
93 or1k_set_got_and_rela_sizes to set sizes.
94 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
95 (TCB_SIZE): New macro.
96 (tpoff): Use TCB_SIZE and alignment to calculate offset.
97 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
98 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
99 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
100 (tpoff): Add dynamic boolean argument.
101 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
103 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
105 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
106 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
107 cases with BFD_RELOC_AARCH64_JUMP26.
108 (elfNN_aarch64_check_relocs): Likewise.
110 2020-05-19 Alan Modra <amodra@gmail.com>
112 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
113 bfd_get_filename rather than accessing bfd->filename directly.
114 * aout-target.h (MY (object_p)): Likewise.
115 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
116 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
117 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
118 (_bfd_archive_bsd44_construct_extended_name_table),
119 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
120 (_bfd_bsd_write_armap): Likewise.
121 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
122 * cache.c (bfd_open_file): Likewise.
123 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
124 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
125 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
126 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
127 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
128 * elf32-nds32.c (nds32_elf_output_symbol_hook),
129 (patch_tls_desc_to_ie): Likewise.
130 * elf32-spu.c (sort_bfds, print_one_overlay_section),
131 (spu_elf_auto_overlay): Likewise.
132 * elf64-hppa.c (elf_hppa_final_link): Likewise.
133 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
134 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
135 * elflink.c (bfd_elf_size_dynamic_sections),
136 (elf_link_input_bfd): Likewise.
137 * linker.c (_bfd_generic_link_output_symbols): Likewise.
138 * mach-o.c (bfd_mach_o_follow_dsym),
139 (bfd_mach_o_close_and_cleanup): Likewise.
140 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
141 (find_separate_debug_file, get_build_id_name): Likewise.
142 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
143 * plugin.c (bfd_plugin_open_input): Likewise.
144 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
145 * som.c (som_write_armap): Likewise.
146 * srec.c (srec_write_record, srec_write_symbols): Likewise.
147 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
148 (_bfd_vms_lib_write_archive_contents): Likewise.
149 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
151 2020-05-19 Alan Modra <amodra@gmail.com>
154 * bfdio.c (_bfd_real_fopen): Typo fix.
156 2020-05-18 Nick Clifton <nickc@redhat.com>
159 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
160 for the sections_being_created array.
162 2020-05-18 Alan Modra <amodra@gmail.com>
164 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
165 they can be freed without also freeing internal_relocs.
167 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
170 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
171 separators into DOS style when creating a WIN32 fullpath.
173 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
175 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
176 to initialize RISC-V tdata.
178 2020-05-12 Gunther Nikl <gnikl@justmail.de>
180 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
183 2020-05-11 Alan Modra <amodra@gmail.com>
185 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
187 2020-05-11 Alan Modra <amodra@gmail.com>
189 * elf64-ppc.c: Rename powerxx to power10 throughout.
191 2020-05-11 Alan Modra <amodra@gmail.com>
194 * coffgen.c (coff_get_normalized_symtab): Check that buffer
195 contains required number of auxents before processing any auxent.
196 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
197 file name from auxents for PE.
199 2020-05-04 Gunther Nikl <gnikl@justmail.de>
201 * aout-cris.c (DEFAULT_ARCH): Delete define.
202 (MY_set_arch_mach): Likewise.
203 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
205 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
206 of r_type before the shift.
208 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
211 * elfnn-aarch64.c (group_sections): Copy implementation from
214 2020-05-01 Alan Modra <amodra@gmail.com>
217 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
218 accessing root.u.def of symbols. Also check root.u.def.section
219 is non-NULL. Reverse tests so as to make the logic positive.
221 2020-05-01 Alan Modra <amodra@gmail.com>
224 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
225 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
227 2020-05-01 Alan Modra <amodra@gmail.com>
230 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
231 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
232 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
233 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
234 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
235 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
236 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
237 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
238 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
239 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
241 2020-05-01 Alan Modra <amodra@gmail.com>
244 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
245 from shared libraries.
247 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
249 * elf32-xtensa.c (relax_section): Don't negate diff_value for
250 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
251 equals 0. Report overflow when the result has negative sign but
252 all significant bits are zero.
254 2020-04-29 Gunther Nikl <gnikl@justmail.de>
256 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
257 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
259 2020-04-28 Alan Modra <amodra@gmail.com>
261 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
262 Emit warning message.
264 2020-04-27 Tamar Christina <tamar.christina@arm.com>
266 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
267 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
268 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
269 to x86_64_pe_big_vec as it not a big-endian format.
270 (vec i386_pe_big_vec): New.
271 * configure.ac: Likewise.
272 * targets.c: Likewise.
273 * configure: Regenerate.
274 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
275 COFF_WITH_PE_BIGOBJ): New.
276 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
278 (x86_64_pe_be_vec): Moved.
280 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
282 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
283 * elf.c (elfcore_grok_arc_v2): New function.
284 (elfcore_grok_note): Call the new function to handle the corresponding
286 (elfcore_write_arc_v2): New function.
287 (elfcore_write_register_note): Call the new function to handle the
288 corresponding pseudo-sections.
290 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
293 * bfd-in2.h: Regenerated.
294 * elf32-xtensa.c (elf_howto_table): New entries for
295 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
296 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
297 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
298 R_XTENSA_NDIFF{8,16,32}.
299 * libbfd.h (bfd_reloc_code_real_names): Add names for
300 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
301 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
302 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
303 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
305 2020-04-21 Tamar Christina <tamar.christina@arm.com>
308 * compress.c (bfd_get_full_section_contents): Exclude sections with no
311 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
314 * elf-bfd.h (elf_backend_data): Add
315 elf_backend_strip_zero_sized_dynamic_sections.
316 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
317 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
319 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
321 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
323 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
325 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
327 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
329 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
331 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
333 2020-04-21 Nick Clifton <nickc@redhat.com>
335 * po/sr.po: Updated Serbian translation.
337 2020-04-21 Alan Modra <amodra@gmail.com>
339 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
342 2020-04-20 Stephen Casner <casner@acm.org>
344 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
345 causing globals from linker script to be treated as debug symbols.
346 (translate_symbol_table): Don't sign-extend symbol values from 16
347 to 64 bits in nm output.
349 2020-04-20 Alan Modra <amodra@gmail.com>
351 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
353 2020-04-18 Alan Modra <amodra@gmail.com>
355 * section.c (bfd_is_const_section): Correct test for special
357 * bfd-in2.h: Regenerate.
359 2020-04-17 Alan Modra <amodra@gmail.com>
362 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
365 2020-04-16 Nick Clifton <nickc@redhat.com>
368 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
369 abort with a more helpful error message.
371 2020-04-16 Alan Modra <amodra@gmail.com>
374 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
377 2020-04-15 Fangrui Song <maskray@google.com>
380 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
381 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
382 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
383 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
384 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
385 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
386 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
387 * elf32-sh.c (sh_elf_relocate_section): Likewise.
388 * elf32-spu.c (spu_elf_relocate_section): Likewise.
389 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
390 * elflink.c (elf_link_output_extsym): Likewise.
391 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
393 2020-04-15 Alan Modra <amodra@gmail.com>
396 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
397 pointer into strings that may be freed for section name, always
398 allocate a new string.
400 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
401 Jan W. Jagersma <jwjagersma@gmail.com>
403 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
404 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
405 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
406 (_bfd_go32_mkobject): New functions.
407 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
408 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
409 (go32exe_mkobject): Call _bfd_go32_mkobject.
410 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
411 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
413 (coff_write_relocs): Enable extended reloc counter code if
414 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
415 (coff_write_object_contents): Likewise. Pad section headers
416 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
417 instead of coff_swap_scnhdr_out.
418 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
419 enable extended reloc counter.
420 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
421 Declare with ATTRIBUTE_UNUSED.
422 * libcoff-in.h: (struct coff_tdata): New field go32.
424 * libcoff.h: Regenerate.
426 2020-04-14 Fangrui Song <maskray@google.com>
429 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
432 2020-04-14 Stephen Casner <casner@acm.org>
435 * pdp11.c: Add implementation of --imagic option.
436 (adjust_o_magic): Fix objcopy --extract-symbol test.
437 * libaout.h (enum aout_magic): Add i_magic.
439 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
440 Nick Clifton <nickc@redhat.com>
442 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
444 <default>: Error rather than abort.
446 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
449 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
450 relocation section from section group.
452 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
454 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
455 bfd->origin to file offset.
456 * bfdwin.c (bfd_get_file_window): Likewise.
457 * bfd.c: Clarify the use of the bfd->origin field.
458 * bfd-in2.h: Regenerate.
459 * coff-i386.c: Don't include go32exe.h. Allow overriding
460 coff_write_object_contents via COFF_WRITE_CONTENTS.
461 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
462 (go32exe_write_object_contents): New functions.
463 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
464 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
465 (create_go32_stub): Remove check for 2k size limit. Read stub
466 from go32exe_temp_stub if present.
467 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
468 copy variable-length stub.
469 (go32_check_format): Read stub to go32exe_temp_stub, set
470 origin, return go32exe_cleanup.
471 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
472 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
473 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
474 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
475 Remove functions and their associated #defines.
476 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
477 * libcoff-in.h: (struct coff_tdata): New field stub_size.
478 Rename field go32stub to stub.
479 * libcoff.h: Regenerate.
480 * coff-stgo32.c (go32_check_format): Rename to...
481 (go32exe_check_format): ...this.
482 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
483 (go32exe_copy_private_bfd_data): ...this.
484 (stub_bytes): Rename to...
485 (go32exe_default_stub): ...this.
486 (create_go32_stub): Rename to...
487 (go32exe_create_stub): ...this.
488 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
491 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
495 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
496 relocation to R_386_32 for relocation against non-preemptible
498 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
499 allocate dynamic relocation for non-preemptible absolute symbol.
500 (elf_i386_relocate_section): Pass sec to
501 GENERATE_DYNAMIC_RELOCATION_P.
502 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
503 (elf_x86_64_convert_load_reloc): Covert load relocation to
504 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
505 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
506 for non-preemptible absolute symbol if they overflow.
507 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
508 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
509 symbol. Don't allocate dynamic relocation for non-preemptible
511 (elf_x86_64_relocate_section): Don't generate relative relocation
512 for GOTPCREL relocations aganst local absolute symbol. Pass sec
513 to GENERATE_DYNAMIC_RELOCATION_P.
514 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
515 against non-preemptible absolute symbol.
516 (_bfd_elf_x86_valid_reloc_p): New function.
517 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
519 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
520 argument. Don't generate dynamic relocation against
521 non-preemptible absolute symbol.
523 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
524 against non-preemptible absolute symbol.
526 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
527 (_bfd_elf_x86_valid_reloc_p): New.
529 2020-04-01 Tamar Christina <tamar.christina@arm.com>
532 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
533 address in the GOT if in thumb only mode.
535 2020-04-01 Tamar Christina <tamar.christina@arm.com>
537 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
539 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
541 * mmo.c (mmo_scan): Create .text section only when needed, not
544 2020-03-31 Alan Modra <amodra@gmail.com>
546 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
549 2020-03-31 Alan Modra <amodra@gmail.com>
551 * vms-alpha.c (image_write): Check bounds for sections without
552 contents too. Error on non-zero write to section without
554 (_bfd_vms_slurp_etir): Check return of image_write* functions.
556 2020-03-31 Alan Modra <amodra@gmail.com>
558 * tekhex.c (pass_over): Check is_eof before reading buffer.
560 2020-03-30 Nick Clifton <nickc@redhat.com>
563 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
564 field to timestamp and make it an integer.
565 * libcoff.h: Regenerate.
566 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
567 field in the pe_data structure rather than the insert_timestamp
570 2020-03-30 Alan Modra <amodra@gmail.com>
573 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
576 2020-03-26 Nick Clifton <nickc@redhat.com>
578 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
579 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
581 * libbfd.h: Regenerate.
583 2020-03-26 Alan Modra <amodra@gmail.com>
585 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
587 2020-03-26 Alan Modra <amodra@gmail.com>
589 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
591 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
593 2020-03-25 Nick Clifton <nickc@redhat.com>
595 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
597 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
598 * libbfd.h: Regenerate.
600 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
602 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
603 correct field name in the output string.
605 2020-03-25 Alan Modra <amodra@gmail.com>
608 * elf.c (assign_file_positions_for_load_sections): Adjust offset
609 for SHT_NOBITS section if first in segment.
611 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
614 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
615 (_bfd_elf_get_symbol_version_string): This.
616 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
617 (_bfd_elf_get_symbol_version_string): This.
618 (bfd_elf_print_symbol): Pass TRUE to
619 _bfd_elf_get_symbol_version_string.
620 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
621 bfd_boolean argument.
622 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
623 * targets.c (_bfd_get_symbol_version_string): Likewise.
624 (bfd_get_symbol_version_string): Likewise.
625 * bfd-in2.h: Regenerated.
627 2020-03-24 Nick Clifton <nickc@redhat.com>
628 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
631 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
634 2020-03-24 Nick Clifton <nickc@redhat.com>
637 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
638 segment to use for PT_GNU_RELRO, ignore empty sections in a
639 segment's current list.
641 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
644 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
646 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
649 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
650 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
651 on the previous _bfd_elf_get_symbol_version_string.
652 (_bfd_elf_get_symbol_version_string): Use it.
654 2020-03-24 Alan Modra <amodra@gmail.com>
656 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
657 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
660 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
662 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
664 2020-03-23 Alan Modra <amodra@gmail.com>
666 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
667 symbol count. Allocate an extra byte to ensure name strings
668 are terminated. Sanity check name offsets. Release memory on
671 2020-03-23 Alan Modra <amodra@gmail.com>
673 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
674 field hasn't been read. Remove unnecessary casts.
676 2020-03-22 Alan Modra <amodra@gmail.com>
678 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
679 enough to read number of symbols.
681 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
683 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
684 (EXECUTABLE_SUFFIX): Likewise.
685 * config.in: Regenerated.
686 * configure: Likewise.
687 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
688 _bfd_generic_close_and_cleanup.
689 (plugin_list_entry): Remove resolution_file, resolution_option,
690 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
691 lto_wrapper, gcc_env and initialized,
692 (need_lto_wrapper_p): Removed.
693 (get_lto_wrapper): Likewise.
694 (setup_lto_wrapper_env): Likewise.
695 (register_all_symbols_read): Likewise.
696 (egister_cleanup): Likewise.
697 (get_symbols): Likewise.
698 (add_input_file): Likewise.
699 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
700 (add_symbols): Updated.
701 (try_claim): Likewise.
702 (try_load_plugin): Likewise.
703 (bfd_plugin_canonicalize_symtab): Likewise.
704 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
705 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
707 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
710 * plugin.c (plugin_list_entry): Add has_symbol_type.
711 (add_symbols_v2): New function.
712 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
713 provides symbol type.
714 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
715 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
718 2020-03-20 Alan Modra <amodra@gmail.com>
720 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
721 enough to read number of symbols.
723 2020-03-20 Alan Modra <amodra@gmail.com>
725 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
726 backend functions for NULL before calling.
727 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
728 (bfd_section_from_shdr, assign_section_numbers): Likewise.
729 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
730 * elfnn-ia64.c (ignore_errors): New function.
731 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
733 2020-03-19 Nick Clifton <nickc@redhat.com>
736 * dwarf2.c (struct varinfo): Add unit_offset field to record the
737 location of the varinfo in the unit's debug info data. Change the
738 type of the stack field to a boolean.
739 (lookup_var_by_offset): New function. Returns the varinfo
740 structure for the variable described at the given offset in the
742 (scan_unit_for_symbols): Add support for variables which have the
743 DW_AT_specification attribute.
745 2020-03-19 Nick Clifton <nickc@redhat.com>
748 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
751 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
753 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
755 2020-03-18 Nick Clifton <nickc@redhat.com>
758 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
759 memory access when processing a corrupt secondary reloc section.
761 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
763 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
764 instead of calling abort.
765 * elf32-csky.c (csky_build_one_stub): Likewise.
766 * elf32-hppa.c (hppa_build_one_stub): Likewise.
767 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
768 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
769 * elf32-metag.c (metag_build_one_stub): Likewise.
770 * elf32-nios2.c (nios2_build_one_stub): Likewise.
771 * elf64-ppc.c (ppc_build_one_stub): Likewise.
772 (ppc_size_one_stub): Likewise.
773 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
775 2020-03-17 Nick Clifton <nickc@redhat.com>
778 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
781 2020-03-17 Nick Clifton <nickc@redhat.com>
784 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
785 free. Add free on another failure path.
787 2020-03-16 Alan Modra <amodra@gmail.com>
790 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
791 we have a non-zero section count. Do lma comparison in octets.
793 2020-03-16 Alan Modra <amodra@gmail.com>
795 * vms-alpha.c (dst_restore_location): Validate index into
796 dst_ptr_offsets array before accessing. Return status.
797 (dst_retrieve_location): Similarly, making "loc" parameter a
798 pointer to return value.
799 (_bfd_vms_slurp_etir): Update calls to above functions.
801 2020-03-14 Kamil Rytarowski <n54@gmx.com>
803 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
805 * configure: Regenerated.
807 2020-03-14 Alan Modra <amodra@gmail.com>
809 * section.c (BFD_FAKE_SECTIONS): Formatting.
810 * bfd-in2.h: Regenerate.
812 2020-03-13 Kamil Rytarowski <n54@gmx.com>
814 * elf.c (elfcore_grok_netbsd_note): Add support for
815 NT_NETBSDCORE_LWPSTATUS notes.
817 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
819 * bfd-in2.h: Regenerate.
820 * section.c (asection): Add already_assigned field.
821 (BFD_FAKE_SECTION): Add default initializer for it.
822 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
823 * elf32-arm.c (arm_build_one_stub): Add support for
824 non_contiguous_regions.
825 * elf32-csky.c (csky_build_one_stub): Likewise.
826 * elf32-hppa.c (hppa_build_one_stub): Likewise.
827 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
828 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
829 * elf32-metag.c (metag_build_one_stub): Likewise.
830 * elf32-nios2.c (nios2_build_one_stub): Likewise.
831 * elf64-ppc.c (ppc_build_one_stub): Likewise.
832 (ppc_size_one_stub): Likewise.
833 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
834 * elflink.c (elf_link_input_bfd): Likewise.
836 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
839 * elf-linker-x86.h (elf_linker_x86_params): Add
840 static_before_all_inputs and has_dynamic_linker.
841 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
842 dynamic input objects if -static is passed at command-line
843 before all input files without --dynamic-linker unless
844 --no-dynamic-linker is used.
846 2020-03-13 Kamil Rytarowski <n54@gmx.com>
848 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
850 2020-03-13 Christian Eggers <ceggers@gmx.de>
852 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
854 * elfcode.h (bfd_from_remote_memory): Add units to several
855 parameters. New local "opb". Fix usage of p_align. Fix
856 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
857 call of target_read_memory.
858 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
859 calculation of "offset" and "output_offset".
860 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
861 from "offset" and fix calculation of "end" from "vma+size". Fix
862 comparison between "sh_addr" and "vma"/"output_offset".
863 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
864 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
866 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
867 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
868 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
869 assignment of p_paddr from phdr_lma. Fix comparison between
870 "lma+size" and "next->lma".
871 (elf_sort_segments): Fix assignment from p_paddr to lma.
872 (assign_file_positions_for_load_sections): Add unit (bytes) to
873 local "align". Fix calculation of local "off_adjust". Fix
874 calculation of local "filehdr_vaddr".
875 (assign_file_positions_for_non_load_sections): New local "opb".
876 Fix calculation of "end" from "p_size". Fix comparison between
877 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
878 from "end" and "p_vaddr".
879 (rewrite_elf_program_header): Fix comparison between p_vaddr and
880 vma. Fix assignment to p_paddr from lma. Fix comparison between
881 p_paddr and lma. Fix assignment to p_paddr from lma.
882 * merge.c (sec_merge_emit): New local "opb". Convert
883 "alignment_power" to octets.
884 (_bfd_add_merge_section): New locals "alignment_power" and
885 "opb". Fix comparison between "alignment_power" and
887 (_bfd_merge_sections): New local "opb". Divide size by opb
888 before checking align mask.
890 2020-03-13 Christian Eggers <ceggers@gmx.de>
892 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
893 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
895 (_bfd_elf_make_section_from_phdr): Similarly.
896 (elf_fake_sections): Fix calculation of
897 Elf_Internal_shdr::sh_addr from section VMA.
898 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
900 (assign_file_positions_for_load_sections): Fix calculations of
901 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
902 comparison between program header address and section LMA.
903 (assign_file_positions_for_non_load_sections): Likewise.
904 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
905 (IS_CONTAINED_BY_VMA): Add parameter opb.
906 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
907 INCLUDE_SECTION_IN_SEGMENT): Likewise.
908 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
909 Fix calculations of p_addr_valid and p_vaddr_offset.
910 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
911 with octets per byte when comparing against p_vaddr.
913 2020-03-11 Alan Modra <amodra@gmail.com>
915 * som.c (setup_sections): Sanity check subspace.name.
917 2020-03-11 Alan Modra <amodra@gmail.com>
919 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
921 2020-03-10 Alan Modra <amodra@gmail.com>
924 * ihex.c (ihex_write_object_contents): Don't assume ordering of
927 2020-03-09 Alan Modra <amodra@gmail.com>
929 * wasm-module.c (wasm_scan): Sanity check file name length
930 before allocating memory. Move common section setup code. Do
931 without bfd_tell to calculate section size.
933 2020-03-06 Nick Clifton <nickc@redhat.com>
935 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
936 with error messages and failure return values.
938 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
940 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
941 relocation sections for any removed reference to a dynamic symbol.
943 2020-03-05 Nick Clifton <nickc@redhat.com>
945 * elf-bfd.h (struct elf_backend_data): Add new fields:
946 init_secondary_reloc_section, slurp_secondary_reloc_section,
947 write_secondary_reloc_section.
948 (_bfd_elf_init_secondary_reloc_section): Prototype.
949 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
950 (_bfd_elf_write_secondary_reloc_section): Prototype.
951 * elf.c ( bfd_section_from_shdr): Invoke the new
952 init_secondary_reloc_section backend function, if defined, when a
953 second reloc section is encountered.
954 (swap_out_syms): Invoke the new symbol_section_index function, if
955 defined, when computing the section index of an OS/PROC specific
957 (_bfd_elf_init_secondary_reloc_section): New function.
958 (_bfd_elf_slurp_secondary_reloc_section): New function.
959 (_bfd_elf_write_secondary_reloc_section): New function.
960 (_bfd_elf_copy_special_section_fields): New function.
961 * elfcode.h (elf_write_relocs): Invoke the new
962 write_secondary_relocs function, if defined, in order to emit
964 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
965 function, if defined, in order to read in secondary relocs.
966 * elfxx-target.h (elf_backend_copy_special_section_fields):
967 Provide a non-NULL default definition.
968 (elf_backend_init_secondary_reloc_section): Likewise.
969 (elf_backend_slurp_secondary_reloc_section): Likewise.
970 (elf_backend_write_secondary_reloc_section): Likewise.
971 (struct elf_backend_data elfNN_bed): Add initialisers for the new
973 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
974 * configure: Regenerate.
976 2020-03-05 Alan Modra <amodra@gmail.com>
978 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
979 against file size before allocating memory. Use bfd_alloc rather
980 than bfd_zalloc for carsym/strings memory.
982 2020-03-04 Alan Modra <amodra@gmail.com>
984 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
985 sh_addr mod sh_addalign is zero.
987 2020-03-04 Alan Modra <amodra@gmail.com>
989 * format.c (bfd_check_format_matches): Call cleanup on error exit.
991 2020-03-03 Alan Modra <amodra@gmail.com>
993 * format.c (struct bfd_preserve): Add cleanup field.
994 (bfd_preserve_save): Add cleanup param and save.
995 (bfd_preserve_restore): Return cleanup.
996 (bfd_preserve_finish): Call the cleanup for the discarded match.
997 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
998 and clear when preserving a match. Restore cleanup too when
999 restoring that match.
1001 2020-03-02 Alan Modra <amodra@gmail.com>
1003 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1004 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1005 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1006 (core_sco5_vec): Correct initialisers.
1008 2020-03-02 Alan Modra <amodra@gmail.com>
1010 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1011 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1012 * cisco-core.c (cisco_core_file_validate): Likewise.
1013 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1014 * hpux-core.c (hpux_core_core_file_p): Likewise.
1015 * irix-core.c (irix_core_core_file_p): Likewise.
1016 * lynx-core.c (lynx_core_file_p): Likewise.
1017 * netbsd-core.c (netbsd_core_file_p): Likewise.
1018 * osf-core.c (osf_core_core_file_p): Likewise.
1019 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1020 * sco5-core.c (sco5_core_file_p): Likewise.
1022 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1024 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1026 2020-03-02 Alan Modra <amodra@gmail.com>
1028 * targets.c (bfd_cleanup): New typedef.
1029 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1030 * libbfd-in.h (_bfd_no_cleanup): Define.
1031 * format.c (bfd_reinit): Add cleanup parameter, call it.
1032 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1033 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1034 * aout-target.h (callback, object_p): Return bfd_cleanup.
1035 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1036 * archive.c (bfd_generic_archive_p): Likewise.
1037 * binary.c (binary_object_p): Likewise.
1038 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1039 * coff-ia64.c (ia64coff_object_p): Likewise.
1040 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1041 * coff-sh.c (coff_small_object_p): Likewise.
1042 * coff-stgo32.c (go32_check_format): Likewise.
1043 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1044 (xcoff64_core_p): Likewise.
1045 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1046 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1047 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1048 * elfcode.h (elf_object_p): Likewise.
1049 * elfcore.h (elf_core_file_p): Likewise.
1050 * i386msdos.c (msdos_object_p): Likewise.
1051 * ihex.c (ihex_object_p): Likewise.
1052 * libaout.h (some_aout_object_p): Likewise.
1053 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1054 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1055 * libbfd.c (_bfd_dummy_target): Likewise.
1056 * libcoff-in.h (coff_object_p): Likewise.
1057 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1058 (bfd_mach_o_arm64_core_p): Likewise.
1059 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1060 (bfd_mach_o_arm_core_p): Likewise.
1061 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1062 (bfd_mach_o_i386_core_p): Likewise.
1063 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1064 (bfd_mach_o_x86_64_core_p): Likewise.
1065 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1066 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1067 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1068 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1069 * mmo.c (mmo_object_p): Likewise.
1070 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1071 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1072 (pe_bfd_object_p): Likewise.
1073 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1074 * ppcboot.c (ppcboot_object_p): Likewise.
1075 * rs6000-core.c (rs6000coff_core_p): Likewise.
1076 * som.c (som_object_setup, som_object_p): Likewise.
1077 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1078 * tekhex.c (tekhex_object_p): Likewise.
1079 * vms-alpha.c (alpha_vms_object_p): Likewise.
1080 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1081 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1082 * wasm-module.c (wasm_object_p): Likewise.
1083 * xsym.c (bfd_sym_object_p): Likewise.
1084 * xsym.h (bfd_sym_object_p): Likewise.
1085 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1087 * pdp11.c (some_aout_object_p): Likewise.
1088 * plugin.c (register_ld_plugin_object_p): Update object_p
1090 * plugin.h (register_ld_plugin_object_p): Likewise.
1091 * bfd-in2.h: Regenerate.
1092 * libbfd.h: Regenerate.
1093 * libcoff.h: Regenerate.
1095 2020-03-02 Alan Modra <amodra@gmail.com>
1097 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1098 applicable section flags.
1099 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1100 (mips_ecoff_bele_vec): Likewise.
1101 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1103 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1104 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1106 2020-03-02 Alan Modra <amodra@gmail.com>
1108 * elf32-m32r.c (m32r_elf_section_flags): New function.
1109 (elf_backend_section_flags): Define.
1110 * elf32-nds32.c (nds32_elf_section_flags): New function.
1111 (elf_backend_section_flags): Define.
1112 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1113 .sbss and .sdata sections.
1114 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1115 for SHF_V850_GPREL sections.
1116 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1118 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1119 for SHF_PARISC_SHORT sections.
1120 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1121 (elf_backend_section_flags): Define.
1122 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1123 for SHF_MIPS_GPREL sections. Delete FIXME.
1125 2020-03-02 Alan Modra <amodra@gmail.com>
1127 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1128 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1129 calling elf_backend_section_flags with adjusted params. Use
1130 newsect->flags past that point.
1131 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1133 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1134 to have their type overridden, and all sh_flags but processor and
1136 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1137 * elf32-mep.c (mep_elf_section_flags): Likewise.
1138 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1139 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1140 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1141 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1142 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1143 stub BFD and non-aarch64 input files when scanning for stubs.
1145 2020-03-02 Alan Modra <amodra@gmail.com>
1147 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1148 limit to decompressed element size.
1150 2020-03-02 Alan Modra <amodra@gmail.com>
1152 * vms-lib.c (vms_traverse_index): Add recur_count param and
1153 update calls. Fail on excessive recursion.
1155 2020-03-02 Alan Modra <amodra@gmail.com>
1157 * vms-alpha.c (vms_get_remaining_object_record): Use
1158 bfd_realloc_or_free rather than bfd_realloc.
1159 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1160 (dst_define_location, parse_module): Likewise, and check realloc
1161 return status before using memory. Return status from function
1162 adjusting all callers.
1164 2020-02-28 Alan Modra <amodra@gmail.com>
1166 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1168 2020-02-28 Alan Modra <amodra@gmail.com>
1170 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1171 Remove duplicate undersize check.
1173 2020-02-27 Alan Modra <amodra@gmail.com>
1176 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1178 2020-02-27 Alan Modra <amodra@gmail.com>
1181 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1182 (coff_section_type): Adjust comment.
1183 (decode_section_type): Likewise. Call coff_section_type before
1184 decode_section_type.
1185 (bfd_decode_symclass): Use 'c' for common sections other than
1188 2020-02-27 Alan Modra <amodra@gmail.com>
1190 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1193 2020-02-27 Alan Modra <amodra@gmail.com>
1195 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1196 if file is an archive element.
1197 * bfd-in2.h: Regenerate.
1199 2020-02-26 Alan Modra <amodra@gmail.com>
1201 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1202 bfd_set_error on failing test. Don't bother changing bfd_error on
1203 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1204 Check sym name is within string buffer. Use size_t for some vars.
1205 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1206 int_buf. Don't change bfd_error on file read error. Use
1207 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1208 calculations to catch overflows before they occur. malloc and
1209 free raw armap rather than using bfd_alloc. Read raw armap before
1210 allocating carsym+strings buffer.
1211 (_bfd_slurp_extended_name_table): Localize variables. Check
1212 name size against file size.
1214 2020-02-26 Alan Modra <amodra@gmail.com>
1216 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1218 2020-02-26 Alan Modra <amodra@gmail.com>
1220 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1221 malloc. Check for NULL return from bfd_malloc.
1222 (rx_table_find, rx_table_map): Likewise.
1223 (rx_set_section_contents): Check bfd_alloc return.
1224 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1226 2020-02-26 Alan Modra <amodra@gmail.com>
1228 * aoutx.h: Indent labels correctly. Format error strings.
1229 * archive.c: Likewise.
1230 * archive64.c: Likewise.
1231 * coff-arm.c: Likewise.
1232 * coff-rs6000.c: Likewise.
1233 * coff-stgo32.c: Likewise.
1234 * cpu-arm.c: Likewise.
1235 * dwarf2.c: Likewise.
1236 * elf-ifunc.c: Likewise.
1237 * elf-properties.c: Likewise.
1238 * elf-s390-common.c: Likewise.
1239 * elf-strtab.c: Likewise.
1241 * elf32-arm.c: Likewise.
1242 * elf32-bfin.c: Likewise.
1243 * elf32-cr16.c: Likewise.
1244 * elf32-csky.c: Likewise.
1245 * elf32-i386.c: Likewise.
1246 * elf32-m68k.c: Likewise.
1247 * elf32-msp430.c: Likewise.
1248 * elf32-nds32.c: Likewise.
1249 * elf32-nios2.c: Likewise.
1250 * elf32-pru.c: Likewise.
1251 * elf32-xtensa.c: Likewise.
1252 * elf64-ia64-vms.c: Likewise.
1253 * elf64-x86-64.c: Likewise.
1254 * elfcode.h: Likewise.
1255 * elfcore.h: Likewise.
1256 * elflink.c: Likewise.
1257 * elfnn-aarch64.c: Likewise.
1258 * elfnn-ia64.c: Likewise.
1259 * elfnn-riscv.c: Likewise.
1260 * elfxx-mips.c: Likewise.
1261 * elfxx-sparc.c: Likewise.
1262 * elfxx-x86.c: Likewise.
1263 * i386lynx.c: Likewise.
1264 * merge.c: Likewise.
1265 * pdp11.c: Likewise.
1266 * plugin.c: Likewise.
1267 * reloc.c: Likewise.
1269 2020-02-26 Alan Modra <amodra@gmail.com>
1272 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1274 (bfd_elf_add_dt_needed_tag): Declare.
1275 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1276 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1277 from elf_add_dt_needed_tag. Remove soname and doit param.
1278 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1279 to see whether as-needed lib is already loaded, use dyn_loaded
1280 list instead. When saving and restoring around as-needed lib
1281 handle possibility that dynstr has not been initialised. Don't
1282 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1283 Mark libs loaded via DT_NEEDED entries of other libs with
1284 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1286 (elf_link_check_versioned_symbol): Remove now unneccesary
1287 DYNAMIC check when traversing dyn_loaded list.
1289 2020-02-26 Alan Modra <amodra@gmail.com>
1291 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1293 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1296 * plugin.c (need_lto_wrapper_p): New.
1297 (bfd_plugin_set_program_name): Add an int argument to set
1299 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1301 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1303 2020-02-24 Alan Modra <amodra@gmail.com>
1305 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1307 2020-02-24 Alan Modra <amodra@gmail.com>
1309 * vms-lib.c (struct carsym_mem): Add limit.
1310 (vms_add_index): Heed limit.
1311 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1312 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1313 Always return actual number read.
1314 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1315 assertion with error exit.
1317 2020-02-22 Alan Modra <amodra@gmail.com>
1320 * elf.c (assign_file_positions_for_load_sections): Continue linking
1321 on "PHDR segment not covered by LOAD segment" errors.
1323 2020-02-21 Alan Modra <amodra@gmail.com>
1325 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1327 (bfd_mach_o_canonicalize_reloc): Likewise.
1328 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1329 counts and offsets against file size.
1330 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1331 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1332 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1333 against file size. Delete symbol table error message.
1334 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1336 (bfd_mach_o_read_symtab): Likewise.
1337 (bfd_mach_o_read_command): Pass file size.
1338 (bfd_mach_o_scan): Sanity check command count against file size.
1340 2020-02-21 Alan Modra <amodra@gmail.com>
1343 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1344 "text", "data" and "bss" section pointer vars. Don't update
1345 section size, just exec header sizes.
1346 (adjust_sizes_and_vmas): Don't update text section size. Set
1347 initial exec header a_text. Print exec headers sizes.
1348 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1349 (adjust_sizes_and_vmas): Similarly. Formatting.
1350 (final_link): Correct final file extension.
1352 2020-02-20 Nick Clifton <nickc@redhat.com>
1354 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1356 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1358 (elfNN_bed): Initialise the symbol_section_index field.
1359 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1360 OS and PROC specific section indicies. Warn if converting other
1361 reserved incidies to SHN_ABS.
1363 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1366 * cpu-z80.c: Add machine type compatibility checking.
1368 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1371 * plugin.c (plugin_list_entry): Remove handle.
1372 (try_load_plugin): Call dlclose before return.
1374 2020-02-19 Alan Modra <amodra@gmail.com>
1376 * libbfd-in.h (_bfd_constant_p): Define.
1377 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1378 file size before allocating memory.
1379 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1380 * elf.c (bfd_elf_get_str_section): Likewise.
1381 (_bfd_elf_slurp_version_tables): Likewise.
1382 * libbfd.h: Regenerate.
1384 2020-02-19 Alan Modra <amodra@gmail.com>
1386 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1387 * aoutx.h (aout_get_external_symbols): Replace calls to
1388 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1389 (slurp_reloc_table): Likewise.
1390 * archive.c (do_slurp_bsd_armap): Likewise.
1391 (do_slurp_coff_armap): Likewise.
1392 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1393 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1394 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1395 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1396 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1397 (_bfd_coff_get_external_symbols): Likewise.
1398 * ecoff.c (ecoff_slurp_symbolic_header),
1399 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1400 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1401 (ecoff_indirect_link_order): Likewise.
1402 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1403 (_bfd_elf_slurp_version_tables): Likewise.
1404 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1405 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1406 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1407 * elf64-alpha.c (READ): Likewise.
1408 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1409 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1410 * elfcode.h (elf_slurp_symbol_table),
1411 (elf_slurp_reloc_table_from_section): Likewise.
1412 * elflink.c (elf_link_add_object_symbols),
1413 (elf_link_check_versioned_symbol): Likewise.
1414 * elfxx-mips.c (READ): Likewise.
1415 * i386lynx.c (slurp_reloc_table): Likewise.
1416 * lynx-core.c (lynx_core_file_p): Likewise.
1417 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1418 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1419 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1420 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1421 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1422 (bfd_pef_parse_symbols): Likewise.
1423 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1424 * som.c (setup_sections, som_slurp_string_table),
1425 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1426 (som_bfd_fill_in_ar_symbols): Likewise.
1427 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1428 (evax_bfd_print_image): Likewise.
1429 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1430 * wasm-module.c (wasm_scan): Likewise.
1431 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1432 * xsym.c (bfd_sym_read_name_table),
1433 (bfd_sym_print_type_information_table_entry): Likewise.
1434 * libbfd.h: Regenerate.
1436 2020-02-19 Alan Modra <amodra@gmail.com>
1438 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1439 reading external relocs.
1440 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1441 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1443 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1445 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1446 (m32c_elf_relax_section): Likewise.
1447 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1448 (rl78_elf_relax_section): Likewise.
1449 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1450 (elf32_rx_relax_section): Likewise.
1451 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1452 parameter types and use..
1453 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1454 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1455 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1456 being read from file, just the extra.
1457 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1458 after reading external syms. Free on failure.
1460 2020-02-19 Alan Modra <amodra@gmail.com>
1462 * coffcode.h (buy_and_read, coff_slurp_line_table),
1463 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1464 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1465 corresponding bfd_alloc call. Adjust variables to suit.
1466 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1467 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1468 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1469 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1470 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1471 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1472 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1473 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1474 * elf64-alpha.c (READ): Likewise.
1475 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1476 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1477 (bfd_from_remote_memory): Likewise.
1478 * elfcore.h (core_find_build_id): Likewise.
1479 * elfxx-mips.c (READ): Likewise.
1480 * mach-o.c (bfd_mach_o_mangle_sections),
1481 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1482 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1483 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1484 * som.c (setup_sections, som_prep_for_fixups)
1485 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1486 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1487 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1488 (som_bfd_ar_write_symbol_stuff): Likewise.
1489 * vms-alpha.c (vector_grow1): Likewise.
1490 * vms-lib.c (vms_add_index): Likewise.
1491 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1492 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1493 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1494 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1495 (bfd_alloc2, bfd_zalloc2): Delete.
1496 (_bfd_mul_overflow): Define.
1497 * libbfd.h: Regenerate.
1499 2020-02-19 Alan Modra <amodra@gmail.com>
1501 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1503 (assign_section_numbers): Likewise.
1504 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1505 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1506 bfd_malloc2, size_t amt, and unsigned tls_count.
1507 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1508 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1509 (elf_output_implib): Use bfd_alloc.
1511 2020-02-19 Alan Modra <amodra@gmail.com>
1513 * bfd.c (struct bfd): Move format and direction to other
1514 bitfields. Add "size".
1515 * bfdio.c (bfd_get_size): Cache size when not writing file.
1516 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1517 returning zero, ie. unknown.
1518 (bfd_get_alt_debug_link_info): Likewise.
1519 * bfd-in2.h: Regenerate.
1521 2020-02-19 Alan Modra <amodra@gmail.com>
1523 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1524 bfd_get_file_size twice.
1525 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1526 zero, ie. unknown, return.
1527 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1528 * elfcode.h (elf_swap_shdr_in): Likewise.
1529 (elf_object_p): Don't call bfd_get_file_size twice and correct
1532 2020-02-19 Alan Modra <amodra@gmail.com>
1534 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1535 FALSE if memory alloc fails. Adjust calls.
1536 * som.c (som_prep_for_fixups): Likewise.
1537 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1538 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1539 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1540 * som.c (som_build_and_write_symbol_table): Return via error_return
1542 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1543 (VEC_APPEND_EL): Delete.
1544 (vector_grow1): Return pointer to element. Catch overflow.
1545 Return NULL on memory allocation failure.
1546 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1547 (alpha_vms_add_fixup_ca): Likewise.
1548 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1550 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1552 2020-02-19 Alan Modra <amodra@gmail.com>
1554 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1555 * aout-target.h (object_p): Likewise.
1556 * aout-tic30.c (tic30_aout_object_p): Likewise.
1557 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1558 (emit_stringtab, write_syms, link_hash_table_create),
1559 (aout_link_write_other_symbol): Likewise.
1560 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1561 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1562 (_bfd_compute_and_write_armap): Likewise.
1563 * archures.c (bfd_arch_list): Likewise.
1564 * bfd.c (bfd_record_phdr): Likewise.
1565 * binary.c (binary_canonicalize_symtab): Likewise.
1566 * cisco-core.c (cisco_core_file_validate): Likewise.
1567 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1568 (find_arm_glue, record_arm_to_thumb_glue),
1569 (record_thumb_to_arm_glue): Likewise.
1570 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1571 (ppc_allocate_toc_section): Likewise.
1572 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1573 * coff-sh.c (sh_relax_section): Likewise.
1574 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1575 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1576 (coff_set_alignment_hook, coff_mkobject),
1577 (coff_compute_section_file_positions): Likewise.
1578 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1579 (coff_find_nearest_line_with_names),
1580 ( bfd_coff_set_symbol_class): Likewise.
1581 * cofflink.c (_bfd_coff_link_hash_table_create),
1582 (_bfd_coff_link_input_bfd): Likewise.
1583 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1584 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1585 (build_line_info_table, sort_line_sequences),
1586 (line_info_add_include_dir, line_info_add_file_name),
1587 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1588 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1589 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1590 (_bfd_ecoff_find_nearest_line),
1591 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1592 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1593 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1594 * elf-m10300.c (mn10300_elf_relax_section),
1595 (elf32_mn10300_link_hash_table_create): Likewise.
1596 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1597 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1598 * elf32-arm.c (elf32_arm_link_hash_table_create),
1599 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1600 (elf32_arm_new_section_hook): Likewise.
1601 * elf32-avr.c (elf_avr_new_section_hook),
1602 (elf32_avr_link_hash_table_create, get_local_syms),
1603 (elf32_avr_setup_section_lists): Likewise.
1604 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1605 (bfin_link_hash_table_create): Likewise.
1606 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1607 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1608 * elf32-csky.c (csky_elf_link_hash_table_create),
1609 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1610 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1611 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1612 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1613 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1614 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1615 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1616 (m32r_elf_check_relocs): Likewise.
1617 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1618 (elf32_m68hc11_setup_section_lists),
1619 (elf32_m68hc11_size_stubs): Likewise.
1620 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1621 * elf32-metag.c (elf_metag_link_hash_table_create),
1622 (elf_metag_setup_section_lists): Likewise.
1623 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1624 (microblaze_elf_check_relocs): Likewise.
1625 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1626 (nds32_elf_check_relocs): Likewise.
1627 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1628 (get_local_syms, nios2_elf32_check_relocs),
1629 (nios2_elf32_link_hash_table_create): Likewise.
1630 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1631 (or1k_elf_check_relocs): Likewise.
1632 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1633 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1634 * elf32-s390.c (elf_s390_link_hash_table_create),
1635 (elf_s390_check_relocs): Likewise.
1636 * elf32-score.c (score_elf_create_got_section),
1637 (s3_elf32_score_new_section_hook),
1638 (elf32_score_link_hash_table_create): Likewise.
1639 * elf32-score7.c (score_elf_create_got_section),
1640 (s7_elf32_score_new_section_hook): Likewise.
1641 * elf32-sh.c (sh_elf_link_hash_table_create),
1642 (sh_elf_check_relocs): Likewise.
1643 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1644 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1645 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1646 (tilepro_elf_check_relocs): Likewise.
1647 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1648 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1649 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1650 (elf_xtensa_new_section_hook): Likewise.
1651 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1652 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1653 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1654 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1655 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1656 * elf64-ppc.c (ppc64_elf_new_section_hook),
1657 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1658 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1659 * elf64-s390.c (elf_s390_link_hash_table_create),
1660 (elf_s390_check_relocs): Likewise.
1661 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1662 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1663 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1664 (elf_link_add_archive_symbols, compute_bucket_count),
1665 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1666 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1667 (bfd_elf_final_link): Likewise.
1668 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1669 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1670 (elfNN_aarch64_new_section_hook): Likewise.
1671 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1672 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1673 (riscv_elf_check_relocs): Likewise.
1674 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1675 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1676 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1677 (_bfd_mips_elf_link_hash_table_create): Likewise.
1678 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1679 (_bfd_sparc_elf_check_relocs),
1680 (_bfd_sparc_elf_new_section_hook): Likewise.
1681 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1682 (tilegx_elf_check_relocs): Likewise.
1683 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1684 * format.c (bfd_check_format_matches): Likewise.
1685 * hash.c (_bfd_stringtab_init): Likewise.
1686 * ihex.c (ihex_scan): Likewise.
1687 * irix-core.c (irix_core_core_file_p): Likewise.
1688 * linker.c (bfd_wrapped_link_hash_lookup),
1689 (_bfd_generic_link_hash_table_create),
1690 (_bfd_generic_reloc_link_order): Likewise.
1691 * lynx-core.c (lynx_core_file_p): Likewise.
1692 * netbsd-core.c (netbsd_core_file_p): Likewise.
1693 * osf-core.c (osf_core_core_file_p): Likewise.
1694 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1695 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1696 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1697 * peicode.h (pe_mkobject): Likewise.
1698 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1699 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1700 * sco5-core.c (read_uarea): Likewise.
1701 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1702 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1703 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1704 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1705 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1706 * srec.c (srec_scan): Likewise.
1707 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1708 * targets.c (bfd_target_list): Likewise.
1709 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1710 * trad-core.c (trad_unix_core_file_p): Likewise.
1711 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1712 (vms_new_section_hook): Likewise.
1713 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1714 * xcofflink.c (xcoff_get_section_contents),
1715 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1716 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1717 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1719 2020-02-19 Alan Modra <amodra@gmail.com>
1721 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1723 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1725 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1726 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1727 a build_list_p argument. Don't search plugin_list. Short circuit
1728 when building the plugin list.
1729 (has_plugin): Renamed to has_plugin_list.
1730 (bfd_plugin_set_plugin): Don't set has_plugin.
1731 (bfd_plugin_specified_p): Check plugin_list instead.
1732 (build_plugin_list): New function.
1733 (load_plugin): Call build_plugin_list and use plugin_list.
1735 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1738 * plugin.c (try_claim): Always clean up for LTO wrapper.
1739 (try_load_plugin): Treat each object as independent. Create a
1740 copy for plugin name.
1742 2020-02-11 Nick Clifton <nickc@redhat.com>
1744 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1745 for addresses in print statements.
1746 (msp430_elf_relax_delete_bytes): Likewise.
1747 (msp430_elf_relax_add_words): Likewise.
1748 (msp430_elf_relax_section): Likewise.
1750 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1752 * plugin.c (add_symbols): Clear plugin_data memory.
1754 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1757 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1758 (EXECUTABLE_SUFFIX): Likewise.
1759 * config.in: Regenerated.
1760 * configure: Likewise.
1761 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1762 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1763 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1764 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1765 (get_lto_wrapper): New.
1766 (setup_lto_wrapper_env): Likewise.
1767 (current_plugin): Likewise.
1768 (register_all_symbols_read): Likewise.
1769 (register_cleanup): Likewise.
1770 (get_symbols): Likewise.
1771 (add_input_file): Likewise.
1772 (bfd_plugin_close_and_cleanup): Likewise.
1773 (claim_file): Removed.
1774 (register_claim_file): Set current_plugin->claim_file.
1775 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1776 lto_syms in current_plugin.
1777 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1778 all_symbols_read handler. Copy real symbols to plugin_data.
1779 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1780 (try_load_plugin): Don't reuse the previous plugin for LTO
1781 wrapper. Set up GCC LTO wrapper if possible. Don't set
1782 plugin_list_iter->claim_file.
1783 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1785 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1788 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1790 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1791 check if previous instruction matches a conditional jump inserted
1792 earlier. Invert conditional jump and delete branch in this case.
1794 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1796 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1797 msp430_elf_relax_add_words. Support insertion of either one or two
1799 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1800 needs to be grown. Handle insertion of branch instruction to replace
1803 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1805 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1806 debugging relocations.
1807 (msp430_elf_relax_delete_bytes): Likewise.
1808 (msp430_elf_relax_add_two_words): Likewise.
1809 (msp430_elf_relax_section): Likewise.
1811 2020-02-10 Alan Modra <amodra@gmail.com>
1813 * archures.c: Wrap overlong z80 comments.
1814 * bfd-in2.h: Regenerate.
1816 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1819 * archures.c: Add GBZ80 and Z80N machine values.
1820 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1821 * coff-z80.c: Add support for new reloc.
1822 * coffcode.h: Add support for new machine values.
1823 * cpu-z80.c: Add support for new machine names.
1824 * elf32-z80.c: Add support for new reloc.
1825 * bfd-in2.h: Regenerate.
1826 * libbfd.h: Regenerate.
1828 2020-02-07 Nick Clifton <nickc@redhat.com>
1831 * elf.c (rewrite_elf_program_header): Do not complain if no
1832 sections are mapped to a segment.
1834 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1837 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1838 for garbage collection on __patchable_function_entries section
1839 without linked-to section.
1841 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1844 * bfd-in2.h: Regenerated.
1845 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1846 on section if gc_mark of any of its linked-to sections is set
1847 and don't set gc_mark again.
1848 * section.c (asection): Add linked_to_symbol_name to map_head
1851 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
1853 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1854 reporting an unrecognized instruction with R_V850_LONGJUMP.
1856 2020-02-05 Alan Modra <amodra@gmail.com>
1858 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1860 2020-02-04 Alan Modra <amodra@gmail.com>
1862 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1863 R_PPC_VLE_ADDR20, goto copy_reloc.
1865 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1867 * bfd-in2.h: Regenerated.
1868 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1870 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1873 * bfd-in2.h: Regenerated.
1874 * ecoff.c (bfd_debug_section): Add section_id.
1875 * section.c (bfd_section): Add section_id.
1876 (SEC_ASSEMBLER_SECTION_ID): New.
1877 (BFD_FAKE_SECTION): Add section_id.
1879 2020-02-01 Nick Clifton <nickc@redhat.com>
1881 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1884 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1886 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1887 encodings are relative to the GOT on nios2, too.
1889 2020-01-31 Alan Modra <amodra@gmail.com>
1891 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1892 file. Use $< and $@ in rules.
1893 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1894 (elf32-ia64.c, elf64-ia64.c): Likewise.
1895 (elf32-riscv.c, elf64-riscv.c): Likewise.
1896 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1897 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1898 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1899 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1900 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1901 * Makefile.in: Regenerate.
1903 2020-01-31 Alan Modra <amodra@gmail.com>
1906 * elf.c (setup_group): Don't clear entire section contents,
1907 just the padding after group flags. Release alloc'd memory
1908 after a seek or read failure.
1910 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1912 * peXXigen.c (pe_is_repro): New function.
1913 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1914 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1916 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1918 * peXXigen.c (debug_type_names): Add names for new debug data type
1921 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1923 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1924 inner loop. Fix a memory leak.
1926 2020-01-30 Alan Modra <amodra@gmail.com>
1928 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1929 or obj_coff_keep_strings here.
1930 (coff_get_normalized_symtab): Free external syms directly.
1931 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1934 2020-01-27 Jim Wilson <jimw@sifive.com>
1936 * cpu-riscv.c (riscv_scan): New.
1937 (N): Change bfd_default_scan to riscv_scan.
1939 2020-01-27 Andreas Schwab <schwab@suse.de>
1941 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1942 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1943 * Makefile.in: Regenerate.
1944 * cpu-plugin.c: Remove.
1945 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1946 (bfd_plugin_arch): Remove declaration.
1947 * bfd-in2.h: Regenerate.
1948 * po/SRC-POTFILES.in: Regenerate.
1950 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1951 Alan Modra <amodra@gmail.com>
1954 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1956 2020-01-24 Jim Wilson <jimw@sifive.com>
1958 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1959 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1960 avoid over long line.
1962 2020-01-24 Nick Clifton <nickc@redhat.com>
1965 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1966 syms and keep strings flags as these may have been set in order to
1967 prevent a bogus call to free.
1969 2020-01-23 Nick Clifton <nickc@redhat.com>
1971 * po/fr.po: Updated French translation.
1973 2020-01-23 Alan Modra <amodra@gmail.com>
1976 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1977 by zero when p_align is zero.
1979 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1981 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1982 (riscv_prefix_cmp): Likewise.
1983 (riscv_non_std_ext_p): Deleted.
1984 (riscv_std_sv_ext_p): Likewise.
1985 (riscv_non_std_sv_ext_p): Likewise.
1986 (riscv_merge_non_std_and_sv_ext): Rename to...
1987 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1988 (riscv_merge_arch_attr_info): Replace 3 calls to
1989 riscv_merge_non_std_and_sv_ext with single call to
1990 riscv_merge_multi_letter_ext.
1991 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1992 encounter a 'z' prefix.
1993 (riscv_get_prefix_class): New function, return prefix class based
1994 on first few characters of input string.
1995 (riscv_parse_config): New structure to factor out minor differences
1996 in extension class parsing behaviour.
1997 (riscv_parse_sv_or_non_std_ext): Rename to...
1998 (riscv_parse_prefixed_ext): and parameterise with
2000 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2001 (riscv_multi_letter_ext_valid_p): New.
2002 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2003 (riscv_parse_subset): Delegate all non-single-letter parsing work
2004 to riscv_parse_prefixed_ext.
2005 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2006 (riscv_get_prefix_class): Declare.
2008 2020-01-22 Alan Modra <amodra@gmail.com>
2010 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2011 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2012 __tls_get_addr_desc.
2013 (ppc64_elf_size_stubs): Add section for linker generated
2014 __tls_get_addr_desc wrapper function. Loop at least once if
2015 generating this function.
2016 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2017 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2019 2020-01-22 Alan Modra <amodra@gmail.com>
2021 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2022 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2024 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2025 (STDU_R1_0R1, ADDI_R1_R1): Define.
2026 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2027 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2028 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2029 no_tls_get_addr_regsave.
2030 (branch_reloc_hash_match): Add hash3 and hash4.
2031 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2032 (ppc64_elf_size_dynamic_sections): Likewise.
2033 (ppc64_elf_relocate_section): Likewise.
2034 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2035 __tls_get_addr stub.
2036 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2038 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2039 eh_frame for regsave __tls_get_addr.
2041 2020-01-22 Alan Modra <amodra@gmail.com>
2043 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2044 which __tls_get_addr calls will be eliminated.
2046 2020-01-20 Nick Clifton <nickc@redhat.com>
2048 * po/pt.po: Updates Portuguese translation.
2049 * po/ru.po: Updated Russian translation.
2050 * po/uk.po: Updated Ukranian translation.
2052 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2055 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2056 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2058 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2059 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2060 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2061 "rex leal x@tlsdesc(%rip), %reg" to
2062 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2063 "call *(%eax)" to "nopl (%rax)".
2065 2020-01-20 Alan Modra <amodra@gmail.com>
2067 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2068 (MTLR_R11): Don't define.
2069 (LD_R0_0R3, CMPDI_R0_0): Define.
2070 (build_tls_get_addr_stub): Don't use r11 in stub.
2072 2020-01-20 Alan Modra <amodra@gmail.com>
2074 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2075 (defined_sym_val, is_tls_get_addr): Likewise.
2077 2020-01-18 Nick Clifton <nickc@redhat.com>
2079 * version.m4 (BFD_VERSION): Set to 2.34.50.
2080 * configure: Regenerate.
2081 * po/bfd.pot: Regenerate.
2083 2020-01-18 Nick Clifton <nickc@redhat.com>
2085 Binutils 2.34 branch created.
2087 2020-01-17 Christian Biesinger <cbiesinger@google.com>
2089 * coff-arm.c: Fix spelling error (seperate).
2090 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2092 * sysdep.h (strnlen): Fix spelling error (seperate).
2094 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
2097 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2099 2020-01-15 Alan Modra <amodra@gmail.com>
2102 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2103 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2104 of function symbols unless dot symbols are present. Do warn
2105 whenever one is created, regardles of whether a PLT entry is
2106 also emitted for the function symbol.
2108 2020-01-14 Alan Modra <amodra@gmail.com>
2110 * som.c (som_bfd_count_ar_symbols): Error when file position
2111 of symbols on chains is not strictly increasing.
2113 2020-01-14 Alan Modra <amodra@gmail.com>
2115 * vms.h (VMS_DEBUG): Define as 0.
2116 * vms-alpha.c (image_write): Move debug output after bounds check.
2118 (_bfd_vms_slurp_eihd): Warning fix.
2119 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2121 2020-01-13 Alan Modra <amodra@gmail.com>
2123 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2124 for "ignored" records.
2126 2020-01-13 Alan Modra <amodra@gmail.com>
2128 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2129 Delete asect name check. Move asect NULL check to wasm_object_p.
2130 Correct bounds check of sizes against end. Replace uses of
2131 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2132 just one bfd_release.
2133 (wasm_scan): Don't use malloc/strdup for section names,
2134 bfd_alloc instead. Simplify code prefixing section name.
2135 Formatting. Don't attempt to free memory here..
2136 (wasm_object_p): ..do so here.
2138 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2141 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2142 UNDEFWEAK_NO_DYNAMIC_RELOC.
2143 (allocate_dynrelocs_for_symbol): Likewise.
2145 2020-01-10 Tamar Christina <tamar.christina@arm.com>
2148 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2150 2020-01-10 Alan Modra <amodra@gmail.com>
2152 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2154 2020-01-09 Nick Clifton <nickc@redhat.com>
2157 * bfd.c (bfd_convert_section_contents): Check for a compress
2158 header size that is larger than the actual section size.
2160 2020-01-08 Alan Modra <amodra@gmail.com>
2163 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2164 after removing sections.
2166 2020-01-06 Jim Wilson <jimw@sifive.com>
2169 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2170 check for !bfd_link_pic (info).
2171 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2172 <R_RISCV_JAL>: Add comment.
2173 (_bfd_riscv_relax_section): For plt.offset check, add check for
2174 bfd_link_pic (info). Add comment.
2176 2020-01-06 Alan Modra <amodra@gmail.com>
2178 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2179 match failures. Don't init to bfd_error_wrong_format before
2180 calling _bfd_check_format.
2182 2020-01-06 Alan Modra <amodra@gmail.com>
2184 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2185 status rather than exiting on stack overflow or underflow.
2186 (_bfd_vms_slurp_etir): Adjust to suit.
2188 2020-01-06 Alan Modra <amodra@gmail.com>
2190 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2192 2020-01-06 Alan Modra <amodra@gmail.com>
2194 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2195 command. Check name offset is within command.
2196 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2197 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2198 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2199 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2200 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2201 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2202 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2203 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2204 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2205 (bfd_mach_o_read_segment): Similarly.
2206 (bfd_mach_o_read_thread): Properly bound check thread struct.
2207 Don't repeat checks on second loop.
2208 (bfd_mach_o_read_command): Fail on invalid command length.
2210 2020-01-04 Alan Modra <amodra@gmail.com>
2212 * format.c (bfd_check_format_matches): Add preserve_match.
2213 Save initial bfd state in "preserve", matched bfd state in
2214 "preserve_match". Save just the first match. Release
2215 bfd_alloc memory. Restore and finish preserved state as
2216 appropriate on all function exit paths.
2218 2020-01-04 Alan Modra <amodra@gmail.com>
2220 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2222 2020-01-04 Alan Modra <amodra@gmail.com>
2224 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2227 2020-01-03 Nick Clifton <nickc@redhat.com>
2230 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2231 there is enough data remaining in the code buffer before
2232 attempting to read a function stub.
2234 2020-01-03 Nick Clifton <nickc@redhat.com>
2237 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2238 return value from bfd_malloc.
2239 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2240 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2241 (elf32_arm_filter_cmse_symbols): Likewise.
2242 (elf32_arm_write_section): Likewise.
2243 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2244 (bfd_mach_o_follow_dsym): Likewise.
2245 * pef.c (bfd_pef_print_loader_section): Likewise.
2246 (bfd_pef_scan_start_address): Likewise.
2247 (bfd_pef_parse_function_stubs): Likewise.
2248 (bfd_pef_parse_symbols): Likewise.
2250 2020-01-03 Sergei Trofimovich <siarheit@google.com>
2252 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2253 on binary inputs ld/PR25316.
2254 (is_ia64_elf): new helper to filter on ia64 objects.
2256 2020-01-03 Jan Beulich <jbeulich@suse.com>
2258 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2260 (bfd_mach_o_scan): Insert underscore in two variable names.
2262 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2264 * Makefile.am: Add z80-elf target support.
2265 * configure.ac: Likewise.
2266 * targets.c: Likewise.
2267 * Makefile.in: Regenerate.
2268 * configure: Regenerate.
2269 * config.bfd: Add z80-elf target support and new arches: ez80 and
2271 * elf32-z80.c: New file.
2272 * archures.c: Add new z80 architectures: eZ80 and Z180.
2273 * coffcode.h: Likewise.
2274 * cpu-z80.c: Likewise.
2275 * coff-z80.c: Add new relocations for Z80 target and local label
2277 * reloc.c: Add new relocs.
2278 * bfd-in2.h: Regenerate.
2279 * libbfd.h: Regenerate.
2281 2020-01-02 Tamar Christina <tamar.christina@arm.com>
2285 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2287 2020-01-01 Alan Modra <amodra@gmail.com>
2289 Update year range in copyright notice of all files.
2291 For older changes see ChangeLog-2019
2293 Copyright (C) 2020 Free Software Foundation, Inc.
2295 Copying and distribution of this file, with or without modification,
2296 are permitted in any medium without royalty provided the copyright
2297 notice and this notice are preserved.
2303 version-control: never