plugin: Call dlclose before return in try_load_plugin
[deliverable/binutils-gdb.git] / bfd / ChangeLog
index c7335ab3c3a75eed84f1603efa5fab631c115ed9..1ac662d6c28131c8adf05f4390de6a08dbebe052 100644 (file)
@@ -1,3 +1,167 @@
+2020-02-19  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/25355
+       * plugin.c (plugin_list_entry): Remove handle.
+       (try_load_plugin): Call dlclose before return.
+
+2020-02-19  Alan Modra  <amodra@gmail.com>
+
+       * libbfd-in.h (_bfd_constant_p): Define.
+       (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
+       file size before allocating memory.
+       * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
+       * elf.c (bfd_elf_get_str_section): Likewise.
+       (_bfd_elf_slurp_version_tables): Likewise.
+       * libbfd.h: Regenerate.
+
+2020-02-19  Alan Modra  <amodra@gmail.com>
+
+       * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
+       * aoutx.h (aout_get_external_symbols): Replace calls to
+       bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
+       (slurp_reloc_table): Likewise.
+       * archive.c (do_slurp_bsd_armap): Likewise.
+       (do_slurp_coff_armap): Likewise.
+       * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
+       * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
+       * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
+       * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
+       * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
+       (_bfd_coff_get_external_symbols): Likewise.
+       * ecoff.c (ecoff_slurp_symbolic_header),
+       (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
+       (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
+       (ecoff_indirect_link_order): Likewise.
+       * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
+       (_bfd_elf_slurp_version_tables): Likewise.
+       * elf32-m32c.c (m32c_elf_relax_section): Likewise.
+       * elf32-rl78.c (rl78_elf_relax_section): Likewise.
+       * elf32-rx.c (elf32_rx_relax_section): Likewise.
+       * elf64-alpha.c (READ): Likewise.
+       * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
+       * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
+       * elfcode.h (elf_slurp_symbol_table),
+       (elf_slurp_reloc_table_from_section): Likewise.
+       * elflink.c (elf_link_add_object_symbols),
+       (elf_link_check_versioned_symbol): Likewise.
+       * elfxx-mips.c (READ): Likewise.
+       * i386lynx.c (slurp_reloc_table): Likewise.
+       * lynx-core.c (lynx_core_file_p): Likewise.
+       * mach-o.c (bfd_mach_o_canonicalize_relocs),
+       (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
+       (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
+       * pdp11.c (aout_get_external_symbols, slurp_reloc_table
+       * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
+       (bfd_pef_parse_symbols): Likewise.
+       * peicode.h (pe_ILF_object_p, pe_bfd_object_p
+       * som.c (setup_sections, som_slurp_string_table),
+       (som_slurp_reloc_table, som_bfd_count_ar_symbols),
+       (som_bfd_fill_in_ar_symbols): Likewise.
+       * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
+       (evax_bfd_print_image): Likewise.
+       * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
+       * wasm-module.c (wasm_scan): Likewise.
+       * xcofflink.c (xcoff_link_add_symbols): Likewise.
+       * xsym.c (bfd_sym_read_name_table),
+       (bfd_sym_print_type_information_table_entry): Likewise.
+       * libbfd.h: Regenerate.
+
+2020-02-19  Alan Modra  <amodra@gmail.com>
+
+       * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
+       reading external relocs.
+       * ecoff.c (ecoff_slurp_reloc_table): Likewise.
+       * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
+       after bfd_bread.
+       * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
+       bfd_release.
+       * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
+       (m32c_elf_relax_section): Likewise.
+       * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
+       (rl78_elf_relax_section): Likewise.
+       * elf32-rx.c (rx_offset_for_reloc): Likewise.
+       (elf32_rx_relax_section): Likewise.
+       * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
+       parameter types and use..
+       (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
+       (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
+       * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
+       being read from file, just the extra.
+       * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
+       after reading external syms.  Free on failure.
+
+2020-02-19  Alan Modra  <amodra@gmail.com>
+
+       * coffcode.h (buy_and_read, coff_slurp_line_table),
+       (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
+       bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
+       corresponding bfd_alloc call.  Adjust variables to suit.
+       * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
+       * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
+       (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
+       * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
+       (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
+       * elf32-m32c.c (m32c_elf_relax_section): Likewise.
+       * elf32-rl78.c (rl78_elf_relax_section): Likewise.
+       * elf32-rx.c (elf32_rx_relax_section): Likewise.
+       * elf64-alpha.c (READ): Likewise.
+       * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
+       (elf_slurp_symbol_table, elf_slurp_reloc_table),
+       (bfd_from_remote_memory): Likewise.
+       * elfcore.h (core_find_build_id): Likewise.
+       * elfxx-mips.c (READ): Likewise.
+       * mach-o.c (bfd_mach_o_mangle_sections),
+       (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
+       (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
+       (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
+       * som.c (setup_sections, som_prep_for_fixups)
+       (som_build_and_write_symbol_table, som_slurp_symbol_table),
+       (som_slurp_reloc_table, som_bfd_count_ar_symbols),
+       (som_bfd_fill_in_ar_symbols, som_slurp_armap),
+       (som_bfd_ar_write_symbol_stuff): Likewise.
+       * vms-alpha.c (vector_grow1): Likewise.
+       * vms-lib.c (vms_add_index): Likewise.
+       * wasm-module.c (wasm_scan_name_function_section): Likewise.
+       * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
+       * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
+       * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
+       (bfd_alloc2, bfd_zalloc2): Delete.
+       (_bfd_mul_overflow): Define.
+       * libbfd.h: Regenerate.
+
+2020-02-19  Alan Modra  <amodra@gmail.com>
+
+       * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
+       bfd_zalloc2.
+       (assign_section_numbers): Likewise.
+       (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
+       (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
+       bfd_malloc2, size_t amt, and unsigned tls_count.
+       (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
+       * elflink.c (elf_create_symbuf): Use bfd_malloc.
+       (elf_output_implib): Use bfd_alloc.
+
+2020-02-19  Alan Modra  <amodra@gmail.com>
+
+       * bfd.c (struct bfd): Move format and direction to other
+       bitfields.  Add "size".
+       * bfdio.c (bfd_get_size): Cache size when not writing file.
+       * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
+       returning zero, ie. unknown.
+       (bfd_get_alt_debug_link_info): Likewise.
+       * bfd-in2.h: Regenerate.
+
+2020-02-19  Alan Modra  <amodra@gmail.com>
+
+       * coffgen.c (_bfd_coff_get_external_symbols): Don't call
+       bfd_get_file_size twice.
+       (_bfd_coff_read_string_table): Allow for bfd_get_file_size
+       zero, ie. unknown, return.
+       * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
+       * elfcode.h (elf_swap_shdr_in): Likewise.
+       (elf_object_p): Don't call bfd_get_file_size twice and correct
+       file size check.
+
 2020-02-19  Alan Modra  <amodra@gmail.com>
 
        * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
This page took 0.024615 seconds and 4 git commands to generate.