diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/aout-target.h | 9 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 18 | ||||
-rw-r--r-- | bfd/coff-rs6000.c | 2 | ||||
-rw-r--r-- | bfd/coff64-rs6000.c | 2 | ||||
-rw-r--r-- | bfd/coffcode.h | 2 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 4 | ||||
-rw-r--r-- | bfd/elf-sframe.c | 9 | ||||
-rw-r--r-- | bfd/elf.c | 61 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 7 | ||||
-rw-r--r-- | bfd/elfxx-riscv.c | 142 | ||||
-rw-r--r-- | bfd/elfxx-riscv.h | 3 | ||||
-rw-r--r-- | bfd/elfxx-target.h | 2 | ||||
-rw-r--r-- | bfd/libbfd-in.h | 9 | ||||
-rw-r--r-- | bfd/libbfd.c | 10 | ||||
-rw-r--r-- | bfd/libbfd.h | 9 | ||||
-rw-r--r-- | bfd/libecoff.h | 3 | ||||
-rw-r--r-- | bfd/libpei.h | 2 | ||||
-rw-r--r-- | bfd/mach-o-target.c | 1 | ||||
-rw-r--r-- | bfd/mach-o.c | 12 | ||||
-rw-r--r-- | bfd/mach-o.h | 3 | ||||
-rw-r--r-- | bfd/mmo.c | 1 | ||||
-rw-r--r-- | bfd/peXXigen.c | 6 | ||||
-rw-r--r-- | bfd/plugin.c | 5 | ||||
-rw-r--r-- | bfd/ppcboot.c | 1 | ||||
-rw-r--r-- | bfd/section.c | 7 | ||||
-rw-r--r-- | bfd/som.c | 14 | ||||
-rw-r--r-- | bfd/targets.c | 11 | ||||
-rw-r--r-- | bfd/version.h | 2 | ||||
-rw-r--r-- | bfd/vms-alpha.c | 1 |
29 files changed, 160 insertions, 198 deletions
diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 1b71104..c6d9d60 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -214,9 +214,11 @@ static bool MY_bfd_copy_private_section_data (bfd *ibfd, asection *isec ATTRIBUTE_UNUSED, bfd *obfd, - asection *osec ATTRIBUTE_UNUSED) + asection *osec ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info) { - if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour + if (link_info == NULL + && bfd_get_flavour (ibfd) == bfd_target_aout_flavour && bfd_get_flavour (obfd) == bfd_target_aout_flavour) obj_aout_subformat (obfd) = obj_aout_subformat (ibfd); return true; @@ -562,9 +564,6 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data #endif -#define MY_init_private_section_data \ - _bfd_generic_init_private_section_data - #ifndef MY_bfd_copy_private_symbol_data #define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data #endif diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index d5d1b51..b013ef9 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1034,11 +1034,12 @@ bool bfd_malloc_and_get_section (bfd *abfd, asection *section, bfd_byte **buf); bool bfd_copy_private_section_data - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec, + struct bfd_link_info *link_info); -#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ +#define bfd_copy_private_section_data(ibfd, isec, obfd, osec, link_info) \ BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + (ibfd, isec, obfd, osec, link_info)) bool bfd_generic_is_group_section (bfd *, const asection *sec); const char *bfd_generic_group_name (bfd *, const asection *sec); @@ -7636,7 +7637,6 @@ typedef struct bfd_target #define BFD_JUMP_TABLE_COPY(NAME) \ NAME##_bfd_copy_private_bfd_data, \ NAME##_bfd_merge_private_bfd_data, \ - NAME##_init_private_section_data, \ NAME##_bfd_copy_private_section_data, \ NAME##_bfd_copy_private_symbol_data, \ NAME##_bfd_copy_private_header_data, \ @@ -7649,16 +7649,10 @@ typedef struct bfd_target /* Called to merge BFD general private data from one object file to a common output file when linking. */ bool (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); - /* Called to initialize BFD private section data from one object file - to another. */ -#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, \ - (ibfd, isec, obfd, osec, link_info)) - bool (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr, - struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr); + bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private symbol data from one symbol to another. */ bool (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index ae9a0f6..3c18518 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -4456,8 +4456,6 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { #define _bfd_xcoff_get_section_contents _bfd_generic_get_section_contents /* For copy private data entry points. */ -#define _bfd_xcoff_init_private_section_data \ - _bfd_generic_init_private_section_data #define _bfd_xcoff_bfd_copy_private_bfd_data \ _bfd_xcoff_copy_private_bfd_data #define _bfd_xcoff_bfd_merge_private_bfd_data \ diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index ec7ed08..d335348 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -2621,7 +2621,6 @@ const bfd_target rs6000_xcoff64_vec = /* Copy */ _bfd_xcoff_copy_private_bfd_data, _bfd_generic_bfd_merge_private_bfd_data, - _bfd_generic_init_private_section_data, _bfd_generic_bfd_copy_private_section_data, _bfd_generic_bfd_copy_private_symbol_data, _bfd_generic_bfd_copy_private_header_data, @@ -2892,7 +2891,6 @@ const bfd_target rs6000_xcoff64_aix_vec = /* Copy */ _bfd_xcoff_copy_private_bfd_data, _bfd_generic_bfd_merge_private_bfd_data, - _bfd_generic_init_private_section_data, _bfd_generic_bfd_copy_private_section_data, _bfd_generic_bfd_copy_private_symbol_data, _bfd_generic_bfd_copy_private_header_data, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index bd0374f..b81195d 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -5955,8 +5955,6 @@ static const bfd_coff_backend_data bigobj_swap_table = #define coff_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #endif -#define coff_init_private_section_data _bfd_generic_init_private_section_data - #ifndef coff_bfd_copy_private_section_data #define coff_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data #endif diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index f625709..2bd855a 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2393,10 +2393,8 @@ extern bool _bfd_elf_copy_private_header_data (bfd *, bfd *); extern bool _bfd_elf_copy_private_symbol_data (bfd *, asymbol *, bfd *, asymbol *); -extern bool _bfd_elf_init_private_section_data - (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); extern bool _bfd_elf_copy_private_section_data - (bfd *, asection *, bfd *, asection *); + (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); extern bool _bfd_elf_write_object_contents (bfd *); extern bool _bfd_elf_write_corefile_contents diff --git a/bfd/elf-sframe.c b/bfd/elf-sframe.c index 24a3d35..d74235b 100644 --- a/bfd/elf-sframe.c +++ b/bfd/elf-sframe.c @@ -23,6 +23,7 @@ #include "libbfd.h" #include "elf-bfd.h" #include "sframe-api.h" +#include "sframe-internal.h" /* Return TRUE if the function has been marked for deletion during the linking process. */ @@ -373,8 +374,8 @@ _bfd_elf_merge_section_sframe (bfd *abfd, uint8_t tflags = dctx_flags & ~SFRAME_F_FDE_SORTED; /* ld always generates an output section with SFRAME_F_FDE_FUNC_START_PCREL flag set. Later using - SFRAME_F_LD_MUSTHAVE_FLAGS, it is enforced that the provided input - sections also have this flag set. */ + SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS, it is enforced that the provided + input sections also have this flag set. */ tflags |= SFRAME_F_FDE_FUNC_START_PCREL; htab->sfe_info.sfe_ctx = sframe_encode (SFRAME_VERSION_2, tflags, /* SFrame flags. */ @@ -430,8 +431,8 @@ _bfd_elf_merge_section_sframe (bfd *abfd, related flags set. The implementation does not support updating these data encodings on the fly; confirm by checking the ectx_flags. */ ectx_flags = sframe_encoder_get_flags (sfe_ctx); - if ((dctx_flags & ectx_flags & SFRAME_F_LD_MUSTHAVE_FLAGS) - != SFRAME_F_LD_MUSTHAVE_FLAGS) + if ((dctx_flags & ectx_flags & SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS) + != SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS) { _bfd_error_handler (_("SFrame sections with unexpected data encoding prevent" @@ -8375,25 +8375,34 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) return rewrite_elf_program_header (ibfd, obfd, maxpagesize); } -/* Initialize private output section information from input section. */ +/* Copy private section information from input to output. This function + is called both by objcopy where LINK_INFO is NULL, and ld where + LINK_INFO is non-NULL in the usual case but NULL for a special case + when dealing with LTO IR or cloning output sections. */ bool -_bfd_elf_init_private_section_data (bfd *ibfd, +_bfd_elf_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec, struct bfd_link_info *link_info) - { - Elf_Internal_Shdr *ihdr, *ohdr; - bool final_link = (link_info != NULL - && !bfd_link_relocatable (link_info)); - if (ibfd->xvec->flavour != bfd_target_elf_flavour || obfd->xvec->flavour != bfd_target_elf_flavour) return true; - BFD_ASSERT (elf_section_data (osec) != NULL); + Elf_Internal_Shdr *ihdr = &elf_section_data (isec)->this_hdr; + Elf_Internal_Shdr *ohdr = &elf_section_data (osec)->this_hdr; + if (link_info == NULL) + { + ohdr->sh_entsize = ihdr->sh_entsize; + + if (ihdr->sh_type == SHT_SYMTAB + || ihdr->sh_type == SHT_DYNSYM + || ihdr->sh_type == SHT_GNU_verneed + || ihdr->sh_type == SHT_GNU_verdef) + ohdr->sh_info = ihdr->sh_info; + } /* If this is a known ABI section, ELF section type and flags may have been set up when OSEC was created. For normal sections we @@ -8403,11 +8412,14 @@ _bfd_elf_init_private_section_data (bfd *ibfd, || elf_section_type (osec) == SHT_NOTE || elf_section_type (osec) == SHT_NOBITS) elf_section_type (osec) = SHT_NULL; + /* For objcopy and relocatable link, copy the ELF section type from the input file if the BFD section flags are the same. (If they are different the user may be doing something like "objcopy --set-section-flags .text=alloc,data".) For a final link allow some flags that the linker clears to differ. */ + bool final_link = (link_info != NULL + && !bfd_link_relocatable (link_info)); if (elf_section_type (osec) == SHT_NULL && (osec->flags == isec->flags || (final_link @@ -8445,14 +8457,11 @@ _bfd_elf_init_private_section_data (bfd *ibfd, elf_section_flags (osec) |= (elf_section_flags (isec) & SHF_COMPRESSED); - ihdr = &elf_section_data (isec)->this_hdr; - /* We need to handle elf_linked_to_section for SHF_LINK_ORDER. We don't use the output section of the linked-to section since it may be NULL at this point. */ if ((ihdr->sh_flags & SHF_LINK_ORDER) != 0) { - ohdr = &elf_section_data (osec)->this_hdr; ohdr->sh_flags |= SHF_LINK_ORDER; elf_linked_to_section (osec) = elf_linked_to_section (isec); } @@ -8462,36 +8471,6 @@ _bfd_elf_init_private_section_data (bfd *ibfd, return true; } -/* Copy private section information. This copies over the entsize - field, and sometimes the info field. */ - -bool -_bfd_elf_copy_private_section_data (bfd *ibfd, - asection *isec, - bfd *obfd, - asection *osec) -{ - Elf_Internal_Shdr *ihdr, *ohdr; - - if (ibfd->xvec->flavour != bfd_target_elf_flavour - || obfd->xvec->flavour != bfd_target_elf_flavour) - return true; - - ihdr = &elf_section_data (isec)->this_hdr; - ohdr = &elf_section_data (osec)->this_hdr; - - ohdr->sh_entsize = ihdr->sh_entsize; - - if (ihdr->sh_type == SHT_SYMTAB - || ihdr->sh_type == SHT_DYNSYM - || ihdr->sh_type == SHT_GNU_verneed - || ihdr->sh_type == SHT_GNU_verdef) - ohdr->sh_info = ihdr->sh_info; - - return _bfd_elf_init_private_section_data (ibfd, isec, obfd, osec, - NULL); -} - /* Look at all the SHT_GROUP sections in IBFD, making any adjustments necessary if we are removing either the SHT_GROUP section or any of the group member sections. DISCARDED is the value that a section's diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index b9b3cf8..c40a0c5 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -6136,13 +6136,14 @@ elf_x86_64_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, static bool elf_x86_64_copy_private_section_data (bfd *ibfd, asection *isec, - bfd *obfd, asection *osec) + bfd *obfd, asection *osec, + struct bfd_link_info *link_info) { - if (!_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)) + if (!_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec, link_info)) return false; /* objcopy --set-section-flags without "large" drops SHF_X86_64_LARGE. */ - if (ibfd != obfd) + if (link_info == NULL && ibfd != obfd) elf_section_flags (osec) &= ~SHF_X86_64_LARGE; return true; diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index 43d3c0d..1200032 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1178,9 +1178,20 @@ static bool check_implicit_for_zcf (riscv_parse_subset_t *rps, const riscv_subset_t *subset ATTRIBUTE_UNUSED) { - riscv_subset_t *tmp = NULL; - return *rps->xlen == 32 - && riscv_lookup_subset (rps->subset_list, "f", &tmp); + return (rps != NULL + && rps->xlen != NULL + && *rps->xlen == 32 + && riscv_subset_supports (rps, "f")); +} + +/* Add the implicit only when 'd' extension is also available. */ + +static bool +check_implicit_for_zcd (riscv_parse_subset_t *rps, + const riscv_subset_t *subset ATTRIBUTE_UNUSED) +{ + return (rps != NULL + && riscv_subset_supports (rps, "d")); } /* Record all implicit information for the subsets. */ @@ -1237,15 +1248,6 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"zvl128b", "+zvl64b", check_implicit_always}, {"zvl64b", "+zvl32b", check_implicit_always}, - {"zce", "+zca,+zcb,+zcmp,+zcmt", check_implicit_always}, - {"zce", "+zcf", check_implicit_for_zcf}, - {"zcb", "+zca", check_implicit_always}, - {"zcd", "+d,+zca", check_implicit_always}, - {"zcf", "+f,+zca", check_implicit_always}, - {"zcmp", "+zca", check_implicit_always}, - {"zcmop", "+zca", check_implicit_always}, - {"zcmt", "+zca,+zicsr", check_implicit_always}, - {"zicfilp", "+zicsr", check_implicit_always}, {"zicfiss", "+zimop,+zicsr", check_implicit_always}, {"zclsd", "+zca,+zilsd", check_implicit_always}, @@ -1262,6 +1264,9 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"zhinx", "+zhinxmin", check_implicit_always}, {"zhinxmin", "+zfinx", check_implicit_always}, + {"zcd", "+d,+zca", check_implicit_always}, + {"zcf", "+f,+zca", check_implicit_always}, + {"q", "+d", check_implicit_always}, {"zqinx", "+zdinx", check_implicit_always}, @@ -1275,6 +1280,16 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"zfinx", "+zicsr", check_implicit_always}, {"f", "+zicsr", check_implicit_always}, + {"zce", "+zcb,+zcmp,+zcmt", check_implicit_always}, + {"zce", "+zcf", check_implicit_for_zcf}, + {"zcb", "+zca", check_implicit_always}, + {"zcmp", "+zca", check_implicit_always}, + {"zcmop", "+zca", check_implicit_always}, + {"zcmt", "+zca,+zicsr", check_implicit_always}, + {"c", "+zcf", check_implicit_for_zcf}, + {"c", "+zcd", check_implicit_for_zcd}, + {"c", "+zca", check_implicit_always}, + {"b", "+zba,+zbb,+zbs", check_implicit_always}, {"zk", "+zkn,+zkr,+zkt", check_implicit_always}, @@ -2208,7 +2223,7 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps) && riscv_subset_supports (rps, "zcd")) { rps->error_handler - (_("zcmp' is incompatible with `d/zcd' extension")); + (_("zcmp' is incompatible with `d' and `c', or `zcd' extension")); no_conflict = false; } if (riscv_lookup_subset (rps->subset_list, "zcf", &subset) @@ -2602,7 +2617,7 @@ riscv_remove_subset (riscv_subset_list_t *subset_list, called from riscv_update_subset./ The IMPLICIT_EXTS, +extension[version] [,...,+extension_n[version_n]] - -extension [,...,-extension_n], + (Deprecated) -extension [,...,-extension_n], full ISA. */ static bool @@ -2694,16 +2709,26 @@ riscv_update_subset1 (riscv_parse_subset_t *rps, return false; } - if (explicit_subset == NULL - && (strcmp (subset, "i") == 0 - || strcmp (subset, "e") == 0 - || strcmp (subset, "g") == 0)) + if (explicit_subset == NULL) { - rps->error_handler - (_("%scannot + or - base extension `%s' in %s `%s'"), - errmsg_internal, subset, errmsg_caller, implicit_exts); - free (subset); - return false; + if (removed) + { + rps->error_handler + (_("%sdeprecated - extension `%s' in %s `%s'"), + errmsg_internal, subset, errmsg_caller, implicit_exts); + free (subset); + return false; + } + else if (strcmp (subset, "i") == 0 + || strcmp (subset, "e") == 0 + || strcmp (subset, "g") == 0) + { + rps->error_handler + (_("%scannot + base extension `%s' in %s `%s'"), + errmsg_internal, subset, errmsg_caller, implicit_exts); + free (subset); + return false; + } } if (removed) @@ -2729,8 +2754,8 @@ riscv_update_subset1 (riscv_parse_subset_t *rps, return no_conflict; } -/* Add/Remove an extension to/from the subset list. This is used for - the .option rvc or norvc, and .option arch directives. */ +/* Add an extension to/from the subset list. This is used for the .option rvc + and .option arch directives. */ bool riscv_update_subset (riscv_parse_subset_t *rps, @@ -2739,6 +2764,16 @@ riscv_update_subset (riscv_parse_subset_t *rps, return riscv_update_subset1 (rps, NULL, str); } +/* Called from .option norvc directives. */ + +bool +riscv_update_subset_norvc (riscv_parse_subset_t *rps) +{ + return riscv_update_subset1 (rps, rps->subset_list->head, + "-c,-zca,-zcd,-zcf,-zcb,-zce,-zcmp,-zcmt," + "-zcmop,-zclsd"); +} + /* Check if the FEATURE subset is supported or not in the subset list. Return true if it is supported; Otherwise, return false. */ @@ -2775,10 +2810,9 @@ riscv_multi_subset_supports (riscv_parse_subset_t *rps, return riscv_subset_supports (rps, "zifencei"); case INSN_CLASS_ZIHINTNTL: return riscv_subset_supports (rps, "zihintntl"); - case INSN_CLASS_ZIHINTNTL_AND_C: - return (riscv_subset_supports (rps, "zihintntl") - && (riscv_subset_supports (rps, "c") - || riscv_subset_supports (rps, "zca"))); + case INSN_CLASS_ZIHINTNTL_AND_ZCA: + return riscv_subset_supports (rps, "zihintntl") + && riscv_subset_supports (rps, "zca"); case INSN_CLASS_ZIHINTPAUSE: return riscv_subset_supports (rps, "zihintpause"); case INSN_CLASS_ZIMOP: @@ -2813,17 +2847,12 @@ riscv_multi_subset_supports (riscv_parse_subset_t *rps, return riscv_subset_supports (rps, "d"); case INSN_CLASS_Q: return riscv_subset_supports (rps, "q"); - case INSN_CLASS_C: - return (riscv_subset_supports (rps, "c") - || riscv_subset_supports (rps, "zca")); - case INSN_CLASS_F_AND_C: - return (riscv_subset_supports (rps, "f") - && (riscv_subset_supports (rps, "c") - || riscv_subset_supports (rps, "zcf"))); - case INSN_CLASS_D_AND_C: - return (riscv_subset_supports (rps, "d") - && (riscv_subset_supports (rps, "c") - || riscv_subset_supports (rps, "zcd"))); + case INSN_CLASS_ZCA: + return riscv_subset_supports (rps, "zca"); + case INSN_CLASS_ZCF: + return riscv_subset_supports (rps, "zcf"); + case INSN_CLASS_ZCD: + return riscv_subset_supports (rps, "zcd"); case INSN_CLASS_F_INX: return (riscv_subset_supports (rps, "f") || riscv_subset_supports (rps, "zfinx")); @@ -3070,11 +3099,10 @@ riscv_multi_subset_supports_ext (riscv_parse_subset_t *rps, return "zicfilp"; case INSN_CLASS_ZIHINTNTL: return "zihintntl"; - case INSN_CLASS_ZIHINTNTL_AND_C: + case INSN_CLASS_ZIHINTNTL_AND_ZCA: if (!riscv_subset_supports (rps, "zihintntl")) { - if (!riscv_subset_supports (rps, "c") - && !riscv_subset_supports (rps, "zca")) + if (!riscv_subset_supports (rps, "zca")) return _("zihintntl' and `c', or `zihintntl' and `zca"); else return "zihintntl"; @@ -3105,30 +3133,12 @@ riscv_multi_subset_supports_ext (riscv_parse_subset_t *rps, return "d"; case INSN_CLASS_Q: return "q"; - case INSN_CLASS_C: + case INSN_CLASS_ZCA: return _("c' or `zca"); - case INSN_CLASS_F_AND_C: - if (!riscv_subset_supports (rps, "f")) - { - if (!riscv_subset_supports (rps, "c") - && !riscv_subset_supports (rps, "zcf")) - return _("f' and `c', or `f' and `zcf"); - else - return "f"; - } - else - return _("c' or `zcf"); - case INSN_CLASS_D_AND_C: - if (!riscv_subset_supports (rps, "d")) - { - if (!riscv_subset_supports (rps, "c") - && !riscv_subset_supports (rps, "zcd")) - return _("d' and `c', or `d' and `zcd"); - else - return "d"; - } - else - return _("c' or `zcd"); + case INSN_CLASS_ZCF: + return _("f' and `c', or `zcf"); + case INSN_CLASS_ZCD: + return _("d' and `c', or `zcd"); case INSN_CLASS_F_INX: return _("f' or `zfinx"); case INSN_CLASS_D_INX: diff --git a/bfd/elfxx-riscv.h b/bfd/elfxx-riscv.h index db494d0..fbbefb5 100644 --- a/bfd/elfxx-riscv.h +++ b/bfd/elfxx-riscv.h @@ -119,6 +119,9 @@ extern bool riscv_update_subset (riscv_parse_subset_t *, const char *); extern bool +riscv_update_subset_norvc (riscv_parse_subset_t *); + +extern bool riscv_subset_supports (riscv_parse_subset_t *, const char *); extern bool diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 625243c..4cf02bb 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -225,8 +225,6 @@ _bfd_elf_copy_private_symbol_data #endif -#define bfd_elfNN_init_private_section_data \ - _bfd_elf_init_private_section_data #ifndef bfd_elfNN_bfd_copy_private_section_data #define bfd_elfNN_bfd_copy_private_section_data \ _bfd_elf_copy_private_section_data diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index ae6d303..213cc7d 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -270,17 +270,14 @@ extern bool _bfd_generic_get_section_contents #define _bfd_generic_bfd_merge_private_bfd_data \ _bfd_bool_bfd_link_true #define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true -#define _bfd_generic_bfd_copy_private_section_data \ - _bfd_bool_bfd_asection_bfd_asection_true +extern bool _bfd_generic_bfd_copy_private_section_data + (bfd *, asection *, bfd *, asection *, struct bfd_link_info *) + ATTRIBUTE_HIDDEN; #define _bfd_generic_bfd_copy_private_symbol_data \ _bfd_bool_bfd_asymbol_bfd_asymbol_true #define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true #define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true -extern bool _bfd_generic_init_private_section_data - (bfd *, asection *, bfd *, asection *, struct bfd_link_info *) - ATTRIBUTE_HIDDEN; - /* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */ diff --git a/bfd/libbfd.c b/bfd/libbfd.c index f2daf79..6587fc1 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -1514,11 +1514,11 @@ _bfd_write_unsigned_leb128 (bfd_byte *p, bfd_byte *end, bfd_vma val) } bool -_bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED, - asection *isec ATTRIBUTE_UNUSED, - bfd *obfd ATTRIBUTE_UNUSED, - asection *osec ATTRIBUTE_UNUSED, - struct bfd_link_info *link_info ATTRIBUTE_UNUSED) +_bfd_generic_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED, + asection *isec ATTRIBUTE_UNUSED, + bfd *obfd ATTRIBUTE_UNUSED, + asection *osec ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED) { return true; } diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 3cb3c14..bab1f71 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -276,17 +276,14 @@ extern bool _bfd_generic_get_section_contents #define _bfd_generic_bfd_merge_private_bfd_data \ _bfd_bool_bfd_link_true #define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true -#define _bfd_generic_bfd_copy_private_section_data \ - _bfd_bool_bfd_asection_bfd_asection_true +extern bool _bfd_generic_bfd_copy_private_section_data + (bfd *, asection *, bfd *, asection *, struct bfd_link_info *) + ATTRIBUTE_HIDDEN; #define _bfd_generic_bfd_copy_private_symbol_data \ _bfd_bool_bfd_asymbol_bfd_asymbol_true #define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true #define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true -extern bool _bfd_generic_init_private_section_data - (bfd *, asection *, bfd *, asection *, struct bfd_link_info *) - ATTRIBUTE_HIDDEN; - /* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */ diff --git a/bfd/libecoff.h b/bfd/libecoff.h index 51a00e0..08b601d 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -250,9 +250,6 @@ extern bool _bfd_ecoff_get_section_contents #define _bfd_ecoff_bfd_link_split_section _bfd_generic_link_split_section #define _bfd_ecoff_bfd_link_check_relocs _bfd_generic_link_check_relocs -#define _bfd_ecoff_init_private_section_data \ - _bfd_generic_init_private_section_data - extern bool _bfd_ecoff_bfd_copy_private_bfd_data (bfd *, bfd *); #define _bfd_ecoff_bfd_copy_private_section_data \ diff --git a/bfd/libpei.h b/bfd/libpei.h index 4932fb1..fc1ada2 100644 --- a/bfd/libpei.h +++ b/bfd/libpei.h @@ -473,7 +473,7 @@ CODEVIEW_INFO *_bfd_XXi_slurp_codeview_record unsigned _bfd_XX_only_swap_filehdr_out (bfd *, void *, void *); unsigned _bfd_XXi_only_swap_filehdr_out (bfd *, void *, void *); bool _bfd_XX_bfd_copy_private_section_data - (bfd *, asection *, bfd *, asection *); + (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); bool _bfd_pe_print_ce_compressed_pdata (bfd *, void *); bool _bfd_pe64_print_ce_compressed_pdata (bfd *, void *); diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c index fa1953f..e402d3a 100644 --- a/bfd/mach-o-target.c +++ b/bfd/mach-o-target.c @@ -74,7 +74,6 @@ #define bfd_mach_o_write_armap _bfd_noarchive_write_armap #define bfd_mach_o_get_elt_at_index _bfd_noarchive_get_elt_at_index #define bfd_mach_o_update_armap_timestamp _bfd_noarchive_update_armap_timestamp -#define bfd_mach_o_init_private_section_data _bfd_generic_init_private_section_data #define TARGET_NAME_BACKEND XCONCAT2(TARGET_NAME,_backend) diff --git a/bfd/mach-o.c b/bfd/mach-o.c index fb5bde1..cc191b9 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -583,15 +583,17 @@ bfd_mach_o_bfd_copy_private_symbol_data (bfd *ibfd ATTRIBUTE_UNUSED, bool bfd_mach_o_bfd_copy_private_section_data (bfd *ibfd, asection *isection, - bfd *obfd, asection *osection) + bfd *obfd, asection *osection, + struct bfd_link_info *link_info) { - bfd_mach_o_section *os = bfd_mach_o_get_mach_o_section (osection); - bfd_mach_o_section *is = bfd_mach_o_get_mach_o_section (isection); - - if (ibfd->xvec->flavour != bfd_target_mach_o_flavour + if (link_info != NULL + || ibfd->xvec->flavour != bfd_target_mach_o_flavour || obfd->xvec->flavour != bfd_target_mach_o_flavour) return true; + bfd_mach_o_section *os = bfd_mach_o_get_mach_o_section (osection); + bfd_mach_o_section *is = bfd_mach_o_get_mach_o_section (isection); + BFD_ASSERT (is != NULL && os != NULL); os->flags = is->flags; diff --git a/bfd/mach-o.h b/bfd/mach-o.h index 3aaae38..1cda072 100644 --- a/bfd/mach-o.h +++ b/bfd/mach-o.h @@ -691,7 +691,8 @@ bool bfd_mach_o_write_contents (bfd *); bool bfd_mach_o_bfd_copy_private_symbol_data (bfd *, asymbol *, bfd *, asymbol *); bool bfd_mach_o_bfd_copy_private_section_data (bfd *, asection *, - bfd *, asection *); + bfd *, asection *, + struct bfd_link_info *); bool bfd_mach_o_bfd_copy_private_header_data (bfd *, bfd *); bool bfd_mach_o_bfd_set_private_flags (bfd *, flagword); bool bfd_mach_o_bfd_print_private_bfd_data (bfd *, void *); @@ -3350,7 +3350,6 @@ mmo_write_object_contents (bfd *abfd) #define mmo_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define mmo_bfd_set_private_flags _bfd_generic_bfd_set_private_flags #define mmo_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data -#define mmo_init_private_section_data _bfd_generic_init_private_section_data const bfd_target mmix_mmo_vec = { diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 19f38a4..c337fc5 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -3115,9 +3115,11 @@ bool _bfd_XX_bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, - asection *osec) + asection *osec, + struct bfd_link_info *link_info) { - if (bfd_get_flavour (ibfd) != bfd_target_coff_flavour + if (link_info != NULL + || bfd_get_flavour (ibfd) != bfd_target_coff_flavour || bfd_get_flavour (obfd) != bfd_target_coff_flavour) return true; diff --git a/bfd/plugin.c b/bfd/plugin.c index d57ae59..1c72b74 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -73,8 +73,6 @@ dlerror (void) #define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_plugin_new_section_hook _bfd_generic_new_section_hook #define bfd_plugin_get_section_contents _bfd_generic_get_section_contents -#define bfd_plugin_init_private_section_data _bfd_generic_init_private_section_data -#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define bfd_plugin_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data #define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags @@ -782,7 +780,8 @@ static bool bfd_plugin_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED, asection *isection ATTRIBUTE_UNUSED, bfd *obfd ATTRIBUTE_UNUSED, - asection *osection ATTRIBUTE_UNUSED) + asection *osection ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return true; diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index b4b59c9..dd70267 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -474,7 +474,6 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg) #define ppcboot_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data #define ppcboot_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data -#define ppcboot_init_private_section_data _bfd_generic_init_private_section_data #define ppcboot_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data #define ppcboot_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data #define ppcboot_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data diff --git a/bfd/section.c b/bfd/section.c index 9460ff9..5f0cf6e 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -1667,7 +1667,8 @@ FUNCTION SYNOPSIS bool bfd_copy_private_section_data - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec, + struct bfd_link_info *link_info); DESCRIPTION Copy private section information from @var{isec} in the BFD @@ -1678,9 +1679,9 @@ DESCRIPTION o <<bfd_error_no_memory>> - Not enough memory exists to create private data for @var{osec}. -.#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ +.#define bfd_copy_private_section_data(ibfd, isec, obfd, osec, link_info) \ . BFD_SEND (obfd, _bfd_copy_private_section_data, \ -. (ibfd, isection, obfd, osection)) +. (ibfd, isec, obfd, osec, link_info)) */ /* @@ -5372,17 +5372,17 @@ static bool som_bfd_copy_private_section_data (bfd *ibfd, asection *isection, bfd *obfd, - asection *osection) + asection *osection, + struct bfd_link_info *link_info) { - size_t amt; - /* One day we may try to grok other private data. */ - if (ibfd->xvec->flavour != bfd_target_som_flavour + if (link_info != NULL + || ibfd->xvec->flavour != bfd_target_som_flavour || obfd->xvec->flavour != bfd_target_som_flavour || (!som_is_space (isection) && !som_is_subspace (isection))) return true; - amt = sizeof (struct som_copyable_section_data_struct); + size_t amt = sizeof (struct som_copyable_section_data_struct); som_section_data (osection)->copy_data = bfd_zalloc (obfd, amt); if (som_section_data (osection)->copy_data == NULL) return false; @@ -5401,7 +5401,8 @@ som_bfd_copy_private_section_data (bfd *ibfd, { /* User has specified a subspace without its containing space. */ _bfd_error_handler (_("%pB[%pA]: no output section for space %pA"), - obfd, osection, som_section_data (osection)->copy_data->container); + obfd, osection, + som_section_data (osection)->copy_data->container); return false; } } @@ -6779,7 +6780,6 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) #define som_bfd_link_hide_symbol _bfd_generic_link_hide_symbol #define som_bfd_define_start_stop bfd_generic_define_start_stop #define som_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data -#define som_init_private_section_data _bfd_generic_init_private_section_data #define som_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags #define som_find_inliner_info _bfd_nosymbols_find_inliner_info diff --git a/bfd/targets.c b/bfd/targets.c index 18f5782..2333370 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -282,7 +282,6 @@ BFD_JUMP_TABLE macros. .#define BFD_JUMP_TABLE_COPY(NAME) \ . NAME##_bfd_copy_private_bfd_data, \ . NAME##_bfd_merge_private_bfd_data, \ -. NAME##_init_private_section_data, \ . NAME##_bfd_copy_private_section_data, \ . NAME##_bfd_copy_private_symbol_data, \ . NAME##_bfd_copy_private_header_data, \ @@ -295,16 +294,10 @@ BFD_JUMP_TABLE macros. . {* Called to merge BFD general private data from one object file . to a common output file when linking. *} . bool (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); -. {* Called to initialize BFD private section data from one object file -. to another. *} -.#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ -. BFD_SEND (obfd, _bfd_init_private_section_data, \ -. (ibfd, isec, obfd, osec, link_info)) -. bool (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr, -. struct bfd_link_info *); . {* Called to copy BFD private section data from one object file . to another. *} -. bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr); +. bool (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, sec_ptr, +. struct bfd_link_info *); . {* Called to copy BFD private symbol data from one symbol . to another. *} . bool (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, diff --git a/bfd/version.h b/bfd/version.h index 4371993..7739244 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20250709 +#define BFD_VERSION_DATE 20250710 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 548a979..c4b2484 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -10156,7 +10156,6 @@ bfd_vms_get_data (bfd *abfd) #define vms_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data #define vms_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data -#define vms_init_private_section_data _bfd_generic_init_private_section_data #define vms_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data #define vms_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data #define vms_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data |