+2019-12-30 Alan Modra <amodra@gmail.com>
+
+ * vms-alpha.c (alpha_vms_free_private): New function, extracted..
+ (vms_close_and_cleanup): ..from here.
+ (alpha_vms_object_p): Call alpha_vms_free_private on failure.
+
+2019-12-30 Alan Modra <amodra@gmail.com>
+
+ * coffgen.c (coff_real_object_p): Free malloc'd memory on failure.
+
+2019-12-30 Alan Modra <amodra@gmail.com>
+
+ * archive.c (do_slurp_bsd_armap): Use bfd_alloc rather than
+ bfd_zalloc when memory is all written after the call.
+ (do_slurp_coff_armap): Likewise. Set bfd_error on ridiculously
+ large allocations that overflow bfd_size_type. Use just one
+ bfd_release on error exit.
+ (_bfd_slurp_extended_name_table): Use bfd_alloc for extended_names,
+ clear last byte rather than the entire array. Use bfd_alloc for
+ string table. Rearrange and simplify code copying file names.
+
+2019-12-29 Alan Modra <amodra@gmail.com>
+
+ * vms-alpha.c (_bfd_vms_slurp_egsd): Make base_addr a bfd_vma.
+ Limit alignment power. Correct and simplify alignment expression.
+ (evax_bfd_print_relocation_records): Avoid signed shift left.
+
+2019-12-29 Alan Modra <amodra@gmail.com>
+
+ * vms-misc.c (_bfd_vms_save_sized_string): Add abfd param, make
+ size a size_t. Use bfd_alloc rather than bfd_malloc.
+ (_bfd_vms_save_counted_string): Similarly.
+ * vms.h (_bfd_vms_save_sized_string): Update prototype.
+ (_bfd_vms_save_counted_string): Likewise.
+ * vms-alpha.c (_bfd_vms_slurp_ehdr): Adjust
+ _bfd_vms_save_counted_string and bfd_vms_save_sized_string calls.
+ (_bfd_vms_slurp_egsd, parse_module): Likewise.
+ (_bfd_vms_slurp_eisd): Likewise. Check return status.
+ (alpha_vms_bfd_link_hash_table_free): New function.
+ (alpha_vms_bfd_link_hash_table_create): Arrange to call it.
+ (vms_close_and_cleanup): Free more memory. Don't release tdata.
+
+2019-12-29 Alan Modra <amodra@gmail.com>
+
+ * coffcode.h (coff_close_and_cleanup): Redefine to..
+ * coffgen.c (_bfd_coff_close_and_cleanup): ..this. New function.
+ * libcoff-in.h (_bfd_coff_close_and_cleanup): Declare.
+ * libcoff.h: Regenerate.
+
+2019-12-29 Hannes Domani <ssbssa@yahoo.de>
+ Alan Modra <amodra@gmail.com>
+
+ PR 15350
+ * bfd.c (bfd_update_compression_header): Write zlib header for
+ formats other than ELF too.
+
+2019-12-26 Alan Modra <amodra@gmail.com>
+
+ * som.c (setup_sections): Don't overflow space_strings_size. Use
+ bfd_malloc2 to catch overflow of size calculation.
+ (som_prep_for_fixups): Use bfd_zalloc2 to catch overflow of size
+ calculation.
+ (som_build_and_write_symbol_table): Similarly use bfd_zmalloc2.
+ (som_slurp_symbol_table): Similarly use bfd_zmalloc2, bfd_malloc2,
+ and bfd_zalloc2.
+ (bfd_som_attach_aux_hdr): Use size_t vars for string length.
+ (som_bfd_count_ar_symbols): Use bfd_malloc2 to catch overflow of
+ size calculation. Use size_t vars for length and catch overflow.
+ (som_slurp_armap): Use bfd_alloc2 to catch overflow of size
+ calculation.
+ (som_bfd_ar_write_symbol_stuff): Similarly use bfd_zmalloc2 and
+ bfd_malloc2. Perform size calculations in bfd_size_type.
+
+2019-12-26 Hannes Domani <ssbssa@yahoo.de>
+
+ * peicode.h (pe_bfd_read_buildid): Free data.
+
+2019-12-23 Alan Modra <amodra@gmail.com>
+
+ * vms-alpha.c (add_symbol): Add "max" parameter. Error on string
+ length larger than max.
+ (_bfd_vms_slurp_egsd): Ensure record is at least large enough to
+ read string length byte, error if not. Pass size to add_symbol.
+ (_bfd_vms_slurp_etir): Don't read past end of buffer when reading
+ type and length. Allow read of last byte in buffer.
+
+2019-12-23 Alan Modra <amodra@gmail.com>
+
+ * wasm-module.c (wasm_read_leb128): Don't allow oversize shifts.
+ Catch value overflow. Sign extend only on terminating byte.
+
+2019-12-20 Alan Modra <amodra@gmail.com>
+
+ * xtensa-isa.c (xtensa_insnbuf_from_chars): Avoid signed overflow.
+
+2019-12-20 Alan Modra <amodra@gmail.com>
+
+ * libhppa.h (hppa_field_adjust, bfd_hppa_insn2fmt): Delete forward
+ declaration. Move ATTRIBUTE_UNUSED to definition.
+ (sign_extend, low_sign_extend, sign_unext, low_sign_unext),
+ (re_assemble_3, re_assemble_12, re_assemble_14, re_assemble_16),
+ (re_assemble_17, re_assemble_21, re_assemble_22): Likewise. Make
+ args and return value unsigned. Use unsigned variables.
+ (hppa_rebuild_insn): Similarly.
+
+2019-12-20 Alan Modra <amodra@gmail.com>
+
+ * format.c (bfd_check_format_matches): Free matching_vector when
+ not returning matching target strings.
+
+2019-12-20 Alan Modra <amodra@gmail.com>
+
+ * coff-alpha.c (alpha_ecoff_read_ar_hdr): Free ar_hdr on error return.
+
+2019-12-18 Alan Modra <amodra@gmail.com>
+
+ * coff-rs6000.c (_bfd_xcoff_slurp_armap): Don't overflow when
+ checking symbol count against section size. Guard against strlen
+ running off end of buffer by allocating one more byte and zeroing.
+ * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
+
+2019-12-18 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Use size_t for vars.
+ * elf64-ppc.c (sym_exists_at): Use size_t for lo, hi and mid.
+
+2019-12-18 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): Avoid signed overflow.
+ * elf32-hppa.c (final_link_relocate): Likewise.
+ * elf32-ppc.c (_bfd_elf_ppc_at_tls_transform): Likewise.
+ (_bfd_elf_ppc_at_tprel_transform, is_insn_ds_form): Likewise.
+ (is_insn_dq_form, ppc_elf_relocate_section): Likewise.
+ * elf64-ppc.c (ok_lo_toc_insn, ppc64_elf_edit_toc): Likewise.
+ (ppc64_elf_relocate_section): Likewise.
+ * elfxx-mips.c (mips_elf_perform_relocation): Likewise.
+ * netbsd.h (N_SET_FLAGS): Likewise.
+
+2019-12-17 Alan Modra <amodra@gmail.com>
+
+ * coff-tic80.c: Delete file.
+ * cpu-tic80.c: Delete file.
+ * archures.c: Remove tic80 support.
+ * coffcode.h: Likewise.
+ * coffswap.h: Likewise.
+ * targets.c: Likewise.
+ * config.bfd: Likewise.
+ * configure.ac: Likewise.
+ * Makefile.am: Likewise.
+ * Makefile.in: Regenerate.
+ * bfd-in2.h: Regenerate.
+ * configure: Regenerate.
+ * po/SRC-POTFILES.in: Regenerate.
+
+2019-12-13 Alan Modra <amodra@gmail.com>
+
+ PR 25237
+ * elf.c: (assign_file_positions_for_load_sections): Attempt to
+ keep meaningless p_offset for PT_LOAD segments without file
+ contents within file size.
+
+2019-12-12 Alan Modra <amodra@gmail.com>
+
+ * libbfd.c (bfd_get): Don't cast result of bfd_get_8.
+ * bfd-in2.h: Regenerate.
+
+2019-12-11 Alan Modra <amodra@gmail.com>
+
+ * elf32-rx.c (elf32_rx_relax_section): Avoid signed overflow.
+ * libaout.h (N_SET_INFO, N_SET_FLAGS): Likewise.
+ * netbsd.h (write_object_contents): Likewise.
+ * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Likewise.
+ * libhppa.h (HPPA_R_CONSTANT): Don't signed extend with shifts.
+ (stm32l4xx_create_replacing_stub_vldm): Don't truncate high bits
+ with shifts.
+ * elf32-nds32.h (R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG): Define
+ using 1u shifted left. Ditto for other macros.
+ * mmo.c (LOP): Make unsigned.
+
+2019-12-11 Alan Modra <amodra@gmail.com>
+
+ * libbfd.c (bfd_get_8): Return a bfd_vma.
+ (bfd_get_signed_8): Return a bfd_signed_vma.
+ * bfd-in2.h: Regenerate.
+
+2019-12-11 Alan Modra <amodra@gmail.com>
+
+ * xtensa-modules.c (Field_* functions): Don't mask using shifts.
+ (Operand_soffsetx4_decode, Operand_simm4_decode),
+ (Operand_simm8_decode, Operand_simm8x256_decode),
+ (Operand_simm12b_decode, Operand_label8_decode),
+ (Operand_label12_decode, Operand_soffset_decode),
+ (Operand_xt_wbr15_label_decode, Operand_xt_wbr18_label_decode): Don't
+ sign extend using shifts.
+ (Operand_immrx4_decode, Operand_uimm16x4_decode): Avoid UB in
+ constant.
+
+2019-12-11 Alan Modra <amodra@gmail.com>
+
+ * cpu-ia64-opc.c (ext_imms_scaled): Avoid undefined left shift
+ of negative values by using unsigned vars.
+
+2019-12-07 Alan Modra <amodra@gmail.com>
+
+ PR 25236
+ * elflink.c (_bfd_elf_link_assign_sym_version): Assign versions
+ for ELF_COMMON_DEF_P symbols.
+ (elf_link_output_extsym, _bfd_elf_add_default_symbol): Adjust to
+ suit.
+
+2019-12-05 Sandra Loosemore <sandra@codesourcery.com>
+
+ Only give FDE encoding warnings if --eh-frame-hdr was specified.
+
+ * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Make
+ FDE encoding warning conditional.
+
+2019-12-05 Nick Clifton <nickc@redhat.com>
+
+ PR 25029
+ * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Ignore empty sections
+ when computing the sizes stored in the headers.
+
+2019-12-03 Alan Modra <amodra@gmail.com>
+
+ PR 25230
+ * dwarf2.c (struct dwarf2_debug_file): Add line_table and
+ abbrev_offsets.
+ (struct abbrev_offset_entry): New.
+ (hash_abbrev, eq_abbrev, del_abbrev): New functions.
+ (read_abbrevs): Check whether we have already read abbrevs at
+ given offset, and add new offset/abbrev to hash table.
+ (decode_line_info): Keep line table at offset zero in file struct.
+ Return this for a cu reusing the same dir/file list.
+ (find_abstract_instance): Find cu for DW_FORM_GNU_ref_alt.
+ (_bfd_dwarf2_slurp_debug_info): Create offset/abbrev hash tables.
+ (_bfd_dwarf2_cleanup_debug_info): Adjust deletion of lines and
+ abbrevs.
+
+2019-12-03 Alan Modra <amodra@gmail.com>
+
+ PR 25230
+ * dwarf2.c (struct dwarf2_debug_file): New struct.
+ (struct dwarf2_debug): Delete fields now in dwarf2_debug_file.
+ Add f, alt fields.
+ (struct comp_unit): Add file field.
+ (read_indirect_string, read_indirect_line_string): Adjust to suit.
+ (read_alt_indirect_string, read_alt_indirect_ref): Likewise.
+ (read_debug_ranges, find_abstract_instance, read_rangelist): Likewise.
+ (_bfd_dwarf2_stash_syms, place_sections): Likewise.
+ (stash_maybe_update_info_hash_tablse): Likewise.
+ (stash_verify_info_hash_table): Likewise.
+ (_bfd_dwarf2_slurp_debug_info): Likewise.
+ (_bfd_dwarf2_find_symbol_bias): Likewise.
+ (_bfd_dwarf2_find_nearest_line): Likewise.
+ (_bfd_dwarf2_cleanup_debug_info): Likewise.
+ (read_abbrevs): Add file param and adjust. Update calls.
+ (stash_comp_unit): Likewise.
+ (decode_line_info): Delete stash param and adjust. Update calls.
+ (comp_unit_find_nearest_line): Likewise.
+ (comp_unit_maybe_decode_line_info): Likewise.
+ (comp_unit_find_line): Likewise.
+ (parse_comp_unit): Add file and info_ptr param and adjust. Update
+ calls.
+
2019-12-03 Alan Modra <amodra@gmail.com>
* dwarf2.c (read_indirect_string): Don't duplicate offset check