RISC-V: Reorder the prefixed extensions which are out of order.
[binutils-gdb.git] / bfd / elfxx-riscv.h
index 10b78ee4916ef04ac96b7bf33cc633da3e45d984..ea7126bdb4dd3c4f8482ce8abb06dc41b5ecd779 100644 (file)
@@ -1,5 +1,5 @@
 /* RISC-V ELF specific backend routines.
-   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+   Copyright (C) 2011-2022 Free Software Foundation, Inc.
 
    Contributed by Andrew Waterman (andrew@sifive.com).
    Based on MIPS target.
@@ -23,6 +23,9 @@
 #include "elf/common.h"
 #include "elf/internal.h"
 #include "opcode/riscv.h"
+#include "cpu-riscv.h"
+
+#define RISCV_UNKNOWN_VERSION -1
 
 extern reloc_howto_type *
 riscv_reloc_name_lookup (bfd *, const char *);
@@ -69,18 +72,14 @@ typedef struct
   void (*error_handler) (const char *,
                         ...) ATTRIBUTE_PRINTF_1;
   unsigned *xlen;
-  void (*get_default_version) (const char *,
-                              int *,
-                              int *);
+  enum riscv_spec_class *isa_spec;
+  bool check_unknown_prefixed_ext;
 } riscv_parse_subset_t;
 
 extern bool
 riscv_parse_subset (riscv_parse_subset_t *,
                    const char *);
 
-extern const char *
-riscv_supported_std_ext (void);
-
 extern void
 riscv_release_subset_list (riscv_subset_list_t *);
 
@@ -90,24 +89,25 @@ riscv_arch_str (unsigned, const riscv_subset_list_t *);
 extern size_t
 riscv_estimate_digit (unsigned);
 
-/* ISA extension prefixed name class.  */
-typedef enum riscv_isa_ext_class
-{
-  RV_ISA_CLASS_S,
-  RV_ISA_CLASS_H,
-  RV_ISA_CLASS_Z,
-  RV_ISA_CLASS_X,
-  RV_ISA_CLASS_UNKNOWN
-} riscv_isa_ext_class_t;
-
-riscv_isa_ext_class_t
-riscv_get_prefix_class (const char *);
-
 extern int
 riscv_compare_subsets (const char *, const char *);
 
+extern riscv_subset_list_t *
+riscv_copy_subset_list (riscv_subset_list_t *);
+
 extern bool
-bfd_elf32_riscv_restart_relax_sections (struct bfd_link_info *);
+riscv_update_subset (riscv_parse_subset_t *, const char *);
 
 extern bool
-bfd_elf64_riscv_restart_relax_sections (struct bfd_link_info *);
+riscv_subset_supports (riscv_parse_subset_t *, const char *);
+
+extern bool
+riscv_multi_subset_supports (riscv_parse_subset_t *, enum riscv_insn_class);
+
+extern const char *
+riscv_multi_subset_supports_ext (riscv_parse_subset_t *, enum riscv_insn_class);
+
+extern void
+bfd_elf32_riscv_set_data_segment_info (struct bfd_link_info *, int *);
+extern void
+bfd_elf64_riscv_set_data_segment_info (struct bfd_link_info *, int *);