elflink.c constify
[binutils-gdb.git] / bfd / ChangeLog
index b0cd8b8ec51e5cff2b4ea6b3422f8834ff9dc30c..3acaa571c0c79f2fb007c81b444890bf2d4d149f 100644 (file)
@@ -1,3 +1,391 @@
+2020-12-16  Alan Modra  <amodra@gmail.com>
+
+       * elflink.c (elf_flags_to_names): Constify.
+
+2020-12-16  Alan Modra  <amodra@gmail.com>
+
+       * libxcoff.h (struct xcoff_backend_data_rec): Constify
+       _xcoff_glink_code.
+       (XCOFF_RELOC_FUNCTION_ARGS, XCOFF_COMPLAIN_FUNCTION_ARGS): Delete.
+       (xcoff_reloc_function, xcoff_complain_function): New typedef.
+       (xcoff_calculate_relocation, xcoff_complain_overflow),
+       (xcoff_reloc_type_noop, xcoff_reloc_type_fail),
+       (xcoff_reloc_type_pos, xcoff_reloc_type_neg),
+       (xcoff_reloc_type_rel, xcoff_reloc_type_toc),
+       (xcoff_reloc_type_ba, xcoff_reloc_type_crel): Update declaration.
+       * coff-rs6000.c (xcoff_reloc_type_br): Declare using typedef.
+       (xcoff_complain_overflow_dont_func): Likewise.
+       (xcoff_complain_overflow_bitfield_func): Likewise.
+       (xcoff_complain_overflow_signed_func): Likewise.
+       (xcoff_complain_overflow_unsigned_func): Likewise.
+       (xcoff_calculate_relocation, xcoff_complain_overflow): Constify.
+       (xcoff_glink_code): Constify.
+       * coff64-rs6000.c (xcoff64_reloc_type_br): Declare using typedef.
+       (xcoff64_calculate_relocation, xcoff64_glink_code): Constify.
+
+2020-12-16  Alan Modra  <amodra@gmail.com>
+
+       * elf32-xtensa.c (narrowable, widenable): Constify.
+       * xtensa-modules.c: Constify many arrays.
+
+2020-12-16  Alan Modra  <amodra@gmail.com>
+
+       * elf64-ppc.c (synthetic_opd): Constify.
+
+2020-12-16  Alan Modra  <amodra@gmail.com>
+
+       * arc-plt.h (plt_versions): Constify.
+       * elf32-arc.c (arc_get_plt_version): Constify return pointer,
+       adjust uses throughout.
+
+2020-12-16  Alan Modra  <amodra@gmail.com>
+
+       * coffcode.h (pelength, peheader): Delete static variables.
+       (coff_apply_checksum): Instead, define them as auto vars, and pass..
+       (coff_read_word, coff_compute_checksum): ..to here.  Delete
+       unnecessary forward declarations.
+       * pei-x86_64.c (pdata_count): Delete static variable.
+       (struct pex64_paps): New.
+       (pex64_print_all_pdata_sections, pex64_bfd_print_pdata): Pass
+       a pex64_paps for counting.
+       * peicode.h (jtab): Constify.
+
+2020-12-15  Vivek Das Mohapatra  <vivek@collabora.com>
+
+       * elflink.c (bfd_elf_size_dynamic_sections): Call
+       _bfd_elf_add_dynamic_entry to add a DT_GNU_FLAGS_1 section.
+
+2020-12-14  Alan Modra  <amodra@gmail.com>
+
+       * elf-bfd.h (struct elf_obj_tdata): Add being_created.
+       * elf.c (bfd_section_from_shdr): Delete static vars for loop
+       detection.  Use new tdata variable instead.
+       * elfcode.h (elf_object_p): Allocate being_created.
+
+2020-12-10  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfxx-riscv.c (riscv_ext_dont_care_version): New function.  Return
+       TRUE if we don't care the versions of the extensions.  These extensions
+       are added to the subset list for special purposes, with the explicit
+       versions or the RISCV_UNKNOWN_VERSION versions.
+       (riscv_parse_add_subset): If we do care the versions of the extension,
+       and the versions are unknown, then report errors for the non-implicit
+       extensions, and return directly for the implicit one.
+       (riscv_arch_str1): Do not output i extension after e, and the extensions
+       which versions are unknown.
+
+2020-12-07  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
+       PR 26945
+       * opncls.c (bfd_fdopenw): New function.
+       * bfd-in2.h: Regenerate.
+
+2020-12-07  Alan Modra  <amodra@gmail.com>
+
+       * elf32-csky.c (csky_relocate_contents): Correct negate test.
+       * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Likewise.
+       * elf32-nds32.c (nds32_relocate_contents): Likewise.
+
+2020-12-05  Maciej W. Rozycki  <macro@linux-mips.org>
+
+       * elf32-vax.c (elf_vax_check_relocs) <R_VAX_GOT32>: Use
+       SYMBOL_REFERENCES_LOCAL rather than `h->forced_local' to check
+       whether the symbol referred is local or not.
+
+2020-12-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/27016
+       * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Convert load
+       to mov only for GOTPCRELX relocations.
+
+2020-12-04  Alan Modra  <amodra@gmail.com>
+
+       PR 26978
+       * elflink.c (_bfd_elf_add_default_symbol): Handle the case where
+       a new weak sym@@ver should be overridden by an existing sym@ver.
+       (elf_link_add_object_symbols): Don't _bfd_elf_add_default_symbol
+       for a new weak sym@ver when sym@@ver already exists.
+       * linker.c (link_action): Choose MIND for previous indirect,
+       current def, rather than MDEF.
+       (_bfd_generic_link_add_one_symbol <MIND>): Handle redefinition of
+       weak indirect symbol.
+
+2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfxx-riscv.c (riscv_parse_prefixed_ext): Use riscv_compare_subsets
+       to check the Z* extensions' order.
+
+2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfxx-riscv.c (riscv_parse_add_subset): Allow to add g with
+       RISCV_UNKNOWN_VERSION versions.
+       (riscv_parse_std_ext): Add g to the subset list, we only use it
+       to add the implicit extensions, but won't output it to arch string.
+       (riscv_parse_add_implicit_subsets): Add implicit zicsr and zifencei
+       for g extension.
+       (riscv_arch_str1): Do not output g to the arch string.
+       * elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Moved to include/opcode/riscv.h.
+
+2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfnn-riscv.c (riscv_merge_std_ext): Updated since
+       riscv_lookup_subset is changed.
+       * elfxx-riscv.c (riscv_ext_order): New Array used to compare the
+       extensions' order quickly.
+       (riscv_init_ext_order): New function.  Init the riscv_ext_order
+       according to the riscv_supported_std_ext and parse_config[i].class
+       automatically.
+       (riscv_compare_subsets): New function.  Similar to the strcmp, but
+       compare the subsets with the specific order.
+       (riscv_lookup_subset): Return TRUE and set `current` to the subset
+       if it is found.  Otherwise, return FALSE and set `current` to the
+       place where we should insert the subset.
+       (riscv_add_implicit_subset): New function.  Search the list first,
+       and then find the right place to add the implicit_subset.
+       (riscv_parse_add_subset): Since We have to add all arch string
+       extensions first, and then start to add their implicit extensions.
+       We can add arch string extensions in order by the original
+       riscv_add_subset, and then add the implicit subsets by the
+       riscv_add_implicit_subset.  Besides, do not add the implicit
+       extensions if we failed to find their default versions.
+       (riscv_parse_std_ext): Updated.
+       (riscv_parse_add_implicit_subsets): New function.  Add all implicit
+       extensions according to the arch string extensions.
+       (riscv_parse_subset): Call riscv_init_ext_order and
+       riscv_parse_add_implicit_subsets, before and after parsing the
+       arch string.  Remove parts of the ISA conflict checking since
+       the implicit extensions are added.
+       * elfxx-riscv.h (riscv_lookup_subset): Updated.
+
+2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfxx-riscv.c (riscv_lookup_subset): Moved to front.
+       (riscv_add_subset): Likewise.
+       (riscv_release_subset_list): Likewise.
+       (riscv_parse_add_subset): New function.  Find and check the
+       versions before adding them by riscv_add_subset.
+       (riscv_parsing_subset_version): Remove use_default_version
+       and change the version type from unsigned to int.  Set the
+       versions to RISCV_UNKNOWN_VERSION if we can not find them
+       in the arch string.
+       (riscv_parse_std_ext): Updated.
+       (riscv_parse_prefixed_ext): Updated.  Since we use as_bad
+       rather than as_fatal to report more errors, return NULL
+       string if the parsed end_of_version is NULL, too.
+       (riscv_parse_subset): Use a new boolean, no_conflict, to
+       report more errors when we have more than one ISA conflicts.
+       * elfxx-riscv.h (RISCV_DONT_CARE_VERSION): Changed to
+       RISCV_UNKNOWN_VERSION.
+       (riscv_lookup_subset_version): Removed.
+       (riscv_parse_subset_t): Updated.
+
+2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfxx-riscv.c (riscv_parse_std_ext): Stop parsing standard
+       extensions when parsed h keyword.
+       (riscv_get_prefix_class): Support prefixed h class.
+       (riscv_std_h_ext_strtab): Likewise.
+       (riscv_ext_h_valid_p): Likewise.
+       (parse_config): Likewise.
+       (riscv_std_z_ext_strtab): Add zifencei.
+       * elfxx-riscv.h (riscv_isa_ext_class): Add RV_ISA_CLASS_H.
+
+2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain
+       any uppercase letter.
+
+2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfxx-riscv.c: Re-indent codes, unify and improve the error
+       messages and comments.
+       (riscv_parse_prefixed_ext): Stop parsing the prefixed class
+       extensions if the class is RV_ISA_CLASS_UNKNOWN, I get internal
+       errors before adding this check for march-fail-porder* testcases.
+       (riscv_parse_subset): Move the rv32 with q checking in front.
+       * elfxx-riscv.h: Likewise.
+
+2020-12-01  Alan Modra  <amodra@gmail.com>
+
+       PR 26979
+       * elf-bfd.h (elf_backend_merge_symbol_attribute): Update prototype.
+       * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Likewise.
+       * elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Likewise.
+       * elfxx-x86.h (_bfd_x86_elf_merge_symbol_attribute): Likewise.
+       * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): Replace
+       isym parameter with st_other.  Adjust code.
+       * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): Likewise.
+       * elf64-ppc.c (ppc64_elf_merge_symbol_attribute): Likewise.
+       * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): Likewise.
+       * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): Likewise.
+       * elfxx-x86.c (_bfd_x86_elf_merge_symbol_attribute): Likewise.
+       * elflink.c (elf_merge_st_other): Likewise.
+       (_bfd_elf_merge_symbol, elf_link_add_object_symbols): Adjust to suit.
+       (_bfd_elf_copy_link_hash_symbol_type): Likewise.
+       (_bfd_elf_add_default_symbol): Merge st_other from undecorated
+       symbol and @VER symbol to @@VER symbol.
+
+2020-11-28  Alan Modra  <amodra@gmail.com>
+
+       PR 26907
+       * elf.c (elf_sort_sections): Don't sort zero size !load sections
+       after load sections.
+
+2020-11-27  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
+
+       * elf.c (special_sections_g): Add .gnu.linkonce.n and .gnu.linkonce.p.
+       (special_sections_n): Add .noinit.
+       (special_sections_p): Add .persistent.
+
+2020-11-26  Nick Clifton  <nickc@redhat.com>
+
+       PR 26946
+       * dwarf2.c (read_section): Check for debug sections with excessive
+       sizes.
+
+2020-11-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/26936
+       * elflink.c (_bfd_elf_check_kept_section): Get the real kept
+       section.
+
+2020-11-23  Nick Clifton  <nickc@redhat.com>
+
+       PR 26931
+       * elf-bfd.h (struct elf_backend_data): Add bfd_boolean field to
+       slurp_secondary_relocs field.
+       (_bfd_elf_slurp_secondary_reloc_section): Update prototype.
+       * elf.c (_bfd_elf_slurp_secondary_reloc_section): Add new
+       parameter.  Compute number of symbols based upon the new
+       parameter.
+       * elfcode.h (elf_slurp_reloc_table): Pass dynamic as new
+       parameter.
+
+2020-11-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/26918
+       * elf64-s390.c (elf_s390_finish_dynamic_sections): Set .got
+       sh_entsize only if .got size > 0.
+
+2020-11-21  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfnn-riscv.c (_bfd_riscv_relax_section):  Add a new relax pass
+       to do the pcgp relaxation later, after the lui and call relaxations,
+       but before the delete and alignment relaxations.
+
+2020-11-20  Nick Alcock  <nick.alcock@oracle.com>
+
+       * elflink.c (elf_finalize_dynstr): Call examine_strtab after
+       dynstr finalization.
+       (elf_link_swap_symbols_out): Don't call it here.  Call
+       ctf_new_symbol before swap_symbol_out.
+       (elf_link_output_extsym): Call ctf_new_dynsym before
+       swap_symbol_out.
+       (bfd_elf_final_link): Likewise.
+       * elf.c (swap_out_syms): Pass in bfd_link_info.  Call
+       ctf_new_symbol before swap_symbol_out.
+       (_bfd_elf_compute_section_file_positions): Adjust.
+
+2020-11-19  Nick Clifton  <nickc@redhat.com>
+
+       PR 26918
+       * elf64-s390.c (elf_s390_finish_dynamic_sections): Check for the
+       existance of an sgot output section before setting the
+       sh_entsize.
+
+2020-11-18  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
+       H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_retain.
+       (struct elf_obj_tdata): Increase has_gnu_osabi to 4 bits.
+       * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_retain
+       for SHF_GNU_RETAIN.
+       (_bfd_elf_final_write_processing): Report if SHF_GNU_RETAIN is
+       not supported by the OSABI.
+       Adjust error messages.
+       * elflink.c (elf_link_input_bfd): Copy enabled has_gnu_osabi bits from
+       input BFD to output BFD.
+       (bfd_elf_gc_sections): gc_mark the section if SHF_GNU_RETAIN is set.
+
+2020-11-16  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>
+
+       * cpu-arm.c (processors): Add Cortex-A78C.
+
+2020-11-11  Tom Tromey  <tromey@adacore.com>
+
+       * archive.c (getuid, getgid): Move...
+       * sysdep.h (getuid, getgid): ...here.
+
+2020-11-09  Alan Modra  <amodra@gmail.com>
+
+       * vms-alpha.c (alpha_vms_write_exec): Write 16 bits to eihd.alias.
+
+2020-11-09  Alan Modra  <amodra@gmail.com>
+
+       * archive.c (bfd_ar_hdr_from_filesystem): Use bfd_set_input_error
+       when stat of archive member fails.
+       * coff-rs6000.c (xcoff_write_archive_contents_old),
+       (xcoff_write_archive_contents_big): Likewise, and handle in-memory
+       bfd.
+
+2020-11-03  Alan Modra  <amodra@gmail.com>
+
+       * elf.c (bfd_section_from_shdr): Free sections_being_created.
+       Use bfd_zmalloc.
+
+2020-11-02  Alan Modra  <amodra@gmail.com>
+
+       PR 15146
+       PR 26314
+       PR 26530
+       PR 26806
+       * elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
+       for plugin syms.  Do allow plugin syms to mark as-needed libs.
+
+2020-10-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/26703
+       * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Generate
+       GNU_PROPERTY_X86_ISA_1_BASELINE for -z x86-64-baseline.
+
+2020-10-29  Nick Clifton  <nickc@redhat.com>
+
+       PR 26809
+       * elf.c (_bfd_elf_slurp_secondary_reloc_section): Use the correct
+       sized reloc reading function.
+       (_bfd_elf_write_secondary_reloc_section): Use the correct sized
+       reloc writing function.
+
+2020-10-28  Nick Clifton  <nickc@redhat.com>
+
+       PR 26774
+       * srec.c (srec_write_symbols): Do not emit symbols in sections
+       that have been removed from the output.
+
+2020-10-27  Nick Clifton  <nickc@redhat.com>
+
+       * elf64-hppa.c (elf_hppa_final_link_relocate): Check that the
+       symbol's section is being output before adding its offset to the
+       addend when processing R_PARISC_SECREL32.
+
+2020-10-25  Alan Modra  <amodra@gmail.com>
+
+       * vms-misc.c (_bfd_vms_save_counted_string): Count length byte
+       towards maxlen.
+
+2020-10-20  Dr. David Alan Gilbert  <dgilbert@redhat.com>
+
+       * po/es.po: Fix printf format.
+
+2020-10-16  Nelson Chu  <nelson.chu@sifive.com>
+
+       * elfnn-riscv.c (riscv_elf_link_hash_table): Add last_iplt_index.
+       (riscv_elf_size_dynamic_sections): Initialize the last_iplt_index.
+       (riscv_elf_relocate_section): Use riscv_elf_append_rela.
+       (riscv_elf_finish_dynamic_symbol): If the use_elf_append_rela is
+       false, then we should add the dynamic relocs from the last of
+       the .rela.iplt, and don't use the riscv_elf_append_rela to add.
+
 2020-10-16  Nelson Chu  <nelson.chu@sifive.com>
 
        * elfnn-riscv.c: Include "objalloc.h" since we need objalloc_alloc.
        * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
        sections which are linked to another section.
 
+2020-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>
+
+       * cpu-arm.c: Add cortex-a78 and cortex-a78ae.
+
 2020-09-28  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>
 
        * cpu-arm.c: (processors) Add Cortex-X1.