bfd_cleanup for object_p
[deliverable/binutils-gdb.git] / bfd / ChangeLog
index f2ddd86a3c9cb7032e1468983b850a2f8a8cbfc4..a917631b3884ea5bfccc777373809d65fb519320 100644 (file)
@@ -1,3 +1,361 @@
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * targets.c (bfd_cleanup): New typedef.
+       (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
+       * libbfd-in.h (_bfd_no_cleanup): Define.
+       * format.c (bfd_reinit): Add cleanup parameter, call it.
+       (bfd_check_format_matches): Set cleanup from _bfd_check_format
+       call and pass to bfd_reinit.  Delete temp, use abfd->xvec instead.
+       * aout-target.h (callback, object_p): Return bfd_cleanup.
+       * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
+       * archive.c (bfd_generic_archive_p): Likewise.
+       * binary.c (binary_object_p): Likewise.
+       * coff-alpha.c (alpha_ecoff_object_p): Likewise.
+       * coff-ia64.c (ia64coff_object_p): Likewise.
+       * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
+       * coff-sh.c (coff_small_object_p): Likewise.
+       * coff-stgo32.c (go32_check_format): Likewise.
+       * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
+       (xcoff64_core_p): Likewise.
+       * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
+       * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
+       (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
+       * elfcode.h (elf_object_p): Likewise.
+       * elfcore.h (elf_core_file_p): Likewise.
+       * i386msdos.c (msdos_object_p): Likewise.
+       * ihex.c (ihex_object_p): Likewise.
+       * libaout.h (some_aout_object_p): Likewise.
+       * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
+       (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
+       * libbfd.c (_bfd_dummy_target): Likewise.
+       * libcoff-in.h (coff_object_p): Likewise.
+       * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
+       (bfd_mach_o_arm64_core_p): Likewise.
+       * mach-o-arm.c (bfd_mach_o_arm_object_p),
+       (bfd_mach_o_arm_core_p): Likewise.
+       * mach-o-i386.c (bfd_mach_o_i386_object_p),
+       (bfd_mach_o_i386_core_p): Likewise.
+       * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
+       (bfd_mach_o_x86_64_core_p): Likewise.
+       * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
+       (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
+       * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
+       (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
+       * mmo.c (mmo_object_p): Likewise.
+       * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
+       * peicode.h (coff_real_object_p, pe_ILF_object_p),
+       (pe_bfd_object_p): Likewise.
+       * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
+       * ppcboot.c (ppcboot_object_p): Likewise.
+       * rs6000-core.c (rs6000coff_core_p): Likewise.
+       * som.c (som_object_setup, som_object_p): Likewise.
+       * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
+       * tekhex.c (tekhex_object_p): Likewise.
+       * vms-alpha.c (alpha_vms_object_p): Likewise.
+       * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
+       (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
+       * wasm-module.c (wasm_object_p): Likewise.
+       * xsym.c (bfd_sym_object_p): Likewise.
+       * xsym.h (bfd_sym_object_p): Likewise.
+       * aoutx.h (some_aout_object_p): Likewise, and callback parameter
+       return type.
+       * pdp11.c (some_aout_object_p): Likewise.
+       * plugin.c (register_ld_plugin_object_p): Update object_p
+       parameter type.
+       * plugin.h (register_ld_plugin_object_p): Likewise.
+       * bfd-in2.h: Regenerate.
+       * libbfd.h: Regenerate.
+       * libcoff.h: Regenerate.
+
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
+       applicable section flags.
+       * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
+       (mips_ecoff_bele_vec): Likewise.
+       * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
+       and .sbss sections.
+       * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
+       (_bfd_ecoff_styp_to_sec_flags): Likewise.
+
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * elf32-m32r.c (m32r_elf_section_flags): New function.
+       (elf_backend_section_flags): Define.
+       * elf32-nds32.c (nds32_elf_section_flags): New function.
+       (elf_backend_section_flags): Define.
+       * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
+       .sbss and .sdata sections.
+       * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
+       for SHF_V850_GPREL sections.
+       * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
+       FIXME.
+       * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
+       for SHF_PARISC_SHORT sections.
+       * elf64-ppc.c (ppc64_elf_section_flags): New function.
+       (elf_backend_section_flags): Define.
+       * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
+       for SHF_MIPS_GPREL sections.  Delete FIXME.
+
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
+       * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
+       calling elf_backend_section_flags with adjusted params.  Use
+       newsect->flags past that point.
+       (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
+       special sections.
+       (_bfd_elf_init_private_section_data): Allow normal sh_type sections
+       to have their type overridden, and all sh_flags but processor and
+       os specific.
+       * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
+       * elf32-mep.c (mep_elf_section_flags): Likewise.
+       * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
+       * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
+       * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
+       * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
+       * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
+       stub BFD and non-aarch64 input files when scanning for stubs.
+
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
+       limit to decompressed element size.
+
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * vms-lib.c (vms_traverse_index): Add recur_count param and
+       update calls.  Fail on excessive recursion.
+
+2020-03-02  Alan Modra  <amodra@gmail.com>
+
+       * vms-alpha.c (vms_get_remaining_object_record): Use
+       bfd_realloc_or_free rather than bfd_realloc.
+       (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
+       (dst_define_location, parse_module): Likewise, and check realloc
+       return status before using memory.  Return status from function
+       adjusting all callers.
+
+2020-02-28  Alan Modra  <amodra@gmail.com>
+
+       * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
+
+2020-02-28  Alan Modra  <amodra@gmail.com>
+
+       * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
+       Remove duplicate undersize check.
+
+2020-02-27  Alan Modra  <amodra@gmail.com>
+
+       PR 24511
+       * mmo.c (mmo_scan): Set SEC_DATA for .data.
+
+2020-02-27  Alan Modra  <amodra@gmail.com>
+
+       PR 24511
+       * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
+       (coff_section_type): Adjust comment.
+       (decode_section_type): Likewise.  Call coff_section_type before
+       decode_section_type.
+       (bfd_decode_symclass): Use 'c' for common sections other than
+       the standard one.
+
+2020-02-27  Alan Modra  <amodra@gmail.com>
+
+       * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
+       malloc'd block.
+
+2020-02-27  Alan Modra  <amodra@gmail.com>
+
+       * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
+       if file is an archive element.
+       * bfd-in2.h: Regenerate.
+
+2020-02-26  Alan Modra  <amodra@gmail.com>
+
+       * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
+       bfd_set_error on failing test.  Don't bother changing bfd_error on
+       file read error.  Check symdef_count is multiple of BSD_SYMDEF_SIZE.
+       Check sym name is within string buffer.  Use size_t for some vars.
+       (do_slurp_coff_armap): Use size_t for some variables, fix size of
+       int_buf.  Don't change bfd_error on file read error.  Use
+       _bfd_mul_overflow when calculating carsym buffer size.  Reorder
+       calculations to catch overflows before they occur.  malloc and
+       free raw armap rather than using bfd_alloc.  Read raw armap before
+       allocating carsym+strings buffer.
+       (_bfd_slurp_extended_name_table): Localize variables.  Check
+       name size against file size.
+
+2020-02-26  Alan Modra  <amodra@gmail.com>
+
+       * vms-lib.c (vms_lib_read_index): Release correct buffer.
+
+2020-02-26  Alan Modra  <amodra@gmail.com>
+
+       * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
+       malloc.  Check for NULL return from bfd_malloc.
+       (rx_table_find, rx_table_map): Likewise.
+       (rx_set_section_contents): Check bfd_alloc return.
+       (rx_dump_symtab): Don't alloc internal_syms or external_syms.
+
+2020-02-26  Alan Modra  <amodra@gmail.com>
+
+       * aoutx.h: Indent labels correctly.  Format error strings.
+       * archive.c: Likewise.
+       * archive64.c: Likewise.
+       * coff-arm.c: Likewise.
+       * coff-rs6000.c: Likewise.
+       * coff-stgo32.c: Likewise.
+       * cpu-arm.c: Likewise.
+       * dwarf2.c: Likewise.
+       * elf-ifunc.c: Likewise.
+       * elf-properties.c: Likewise.
+       * elf-s390-common.c: Likewise.
+       * elf-strtab.c: Likewise.
+       * elf.c: Likewise.
+       * elf32-arm.c: Likewise.
+       * elf32-bfin.c: Likewise.
+       * elf32-cr16.c: Likewise.
+       * elf32-csky.c: Likewise.
+       * elf32-i386.c: Likewise.
+       * elf32-m68k.c: Likewise.
+       * elf32-msp430.c: Likewise.
+       * elf32-nds32.c: Likewise.
+       * elf32-nios2.c: Likewise.
+       * elf32-pru.c: Likewise.
+       * elf32-xtensa.c: Likewise.
+       * elf64-ia64-vms.c: Likewise.
+       * elf64-x86-64.c: Likewise.
+       * elfcode.h: Likewise.
+       * elfcore.h: Likewise.
+       * elflink.c: Likewise.
+       * elfnn-aarch64.c: Likewise.
+       * elfnn-ia64.c: Likewise.
+       * elfnn-riscv.c: Likewise.
+       * elfxx-mips.c: Likewise.
+       * elfxx-sparc.c: Likewise.
+       * elfxx-x86.c: Likewise.
+       * i386lynx.c: Likewise.
+       * merge.c: Likewise.
+       * pdp11.c: Likewise.
+       * plugin.c: Likewise.
+       * reloc.c: Likewise.
+
+2020-02-26  Alan Modra  <amodra@gmail.com>
+
+       PR 25593
+       * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
+       "dyn_loaded".
+       (bfd_elf_add_dt_needed_tag): Declare.
+       * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
+       * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
+       from elf_add_dt_needed_tag.  Remove soname and doit param.
+       (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
+       to see whether as-needed lib is already loaded, use dyn_loaded
+       list instead.  When saving and restoring around as-needed lib
+       handle possibility that dynstr has not been initialised.  Don't
+       add DT_NEEDED tags here.  Limit dyn_loaded list to dynamic libs.
+       Mark libs loaded via DT_NEEDED entries of other libs with
+       DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
+       the output.
+       (elf_link_check_versioned_symbol): Remove now unneccesary
+       DYNAMIC check when traversing dyn_loaded list.
+
+2020-02-26  Alan Modra  <amodra@gmail.com>
+
+       * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
+
+2020-02-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/25584
+       * plugin.c (need_lto_wrapper_p): New.
+       (bfd_plugin_set_program_name): Add an int argument to set
+       need_lto_wrapper_p.
+       (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
+       set.
+       * plugin.h (bfd_plugin_set_program_name): Add an int argument.
+
+2020-02-24  Alan Modra  <amodra@gmail.com>
+
+       * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
+
+2020-02-24  Alan Modra  <amodra@gmail.com>
+
+       * vms-lib.c (struct carsym_mem): Add limit.
+       (vms_add_index): Heed limit.
+       (vms_traverse_index): Catch buffer overflows.  Remove outdated fixme.
+       (vms_lib_read_index): Set up limit.  Catch 32-bit overflow.
+       Always return actual number read.
+       (_bfd_vms_lib_archive_p): Catch buffer overflows.  Replace
+       assertion with error exit.
+
+2020-02-22  Alan Modra  <amodra@gmail.com>
+
+       PR 25585
+       * elf.c (assign_file_positions_for_load_sections): Continue linking
+       on "PHDR segment not covered by LOAD segment" errors.
+
+2020-02-21  Alan Modra  <amodra@gmail.com>
+
+       * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
+       overflow check.
+       (bfd_mach_o_canonicalize_reloc): Likewise.
+       (bfd_mach_o_canonicalize_dynamic_reloc): Likewise.  Sanity check
+       counts and offsets against file size.
+       (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
+       (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
+       (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
+       against file size.  Delete symbol table error message.
+       (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
+       against file size.
+       (bfd_mach_o_read_symtab): Likewise.
+       (bfd_mach_o_read_command): Pass file size.
+       (bfd_mach_o_scan): Sanity check command count against file size.
+
+2020-02-21  Alan Modra  <amodra@gmail.com>
+
+       PR 25569
+       * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
+       "text", "data" and "bss" section pointer vars.  Don't update
+       section size, just exec header sizes.
+       (adjust_sizes_and_vmas): Don't update text section size.  Set
+       initial exec header a_text.  Print exec headers sizes.
+       * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
+       (adjust_sizes_and_vmas): Similarly.  Formatting.
+       (final_link): Correct final file extension.
+
+2020-02-20  Nick Clifton  <nickc@redhat.com>
+
+       * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
+       callback.
+       * elfxx-target.h (elf_backend_symbol_section_index): Provide
+       default definition.
+       (elfNN_bed): Initialise the symbol_section_index field.
+       * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
+       OS and PROC specific section indicies.  Warn if converting other
+       reserved incidies to SHN_ABS.
+
+2020-02-19  Sergey Belyashov  <sergey.belyashov@gmail.com>
+
+       PR 25537
+       * cpu-z80.c: Add machine type compatibility checking.
+
+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.
This page took 0.026584 seconds and 4 git commands to generate.