Make bfd_byte an int8_t, flagword a uint32_t
[binutils-gdb.git] / bfd / elfxx-riscv.h
index 6a2501b7be80065e4531b7fd91b3d004d6eb5f00..abcb409bd78df33a5f76f6bdb40f257b7812b8e3 100644 (file)
@@ -1,5 +1,5 @@
 /* RISC-V ELF specific backend routines.
-   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+   Copyright (C) 2011-2023 Free Software Foundation, Inc.
 
    Contributed by Andrew Waterman (andrew@sifive.com).
    Based on MIPS target.
 #include "elf/common.h"
 #include "elf/internal.h"
 #include "opcode/riscv.h"
+#include "cpu-riscv.h"
 
 #define RISCV_UNKNOWN_VERSION -1
 
+struct riscv_elf_params
+{
+  /* Whether to relax code sequences to GP-relative addressing.  */
+  bool relax_gp;
+};
+
+extern void riscv_elf32_set_options (struct bfd_link_info *,
+                                    struct riscv_elf_params *);
+extern void riscv_elf64_set_options (struct bfd_link_info *,
+                                    struct riscv_elf_params *);
+
 extern reloc_howto_type *
 riscv_reloc_name_lookup (bfd *, const char *);
 
@@ -50,6 +62,7 @@ typedef struct
 {
   riscv_subset_t *head;
   riscv_subset_t *tail;
+  const char *arch_str;
 } riscv_subset_list_t;
 
 extern void
@@ -71,9 +84,7 @@ 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;
 
@@ -81,9 +92,6 @@ 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 *);
 
@@ -96,10 +104,20 @@ riscv_estimate_digit (unsigned);
 extern int
 riscv_compare_subsets (const char *, const char *);
 
+extern riscv_subset_list_t *
+riscv_copy_subset_list (riscv_subset_list_t *);
+
+extern bool
+riscv_update_subset (riscv_parse_subset_t *, const char *);
+
 extern bool
-bfd_elf32_riscv_restart_relax_sections (struct bfd_link_info *);
+riscv_subset_supports (riscv_parse_subset_t *, const char *);
+
 extern bool
-bfd_elf64_riscv_restart_relax_sections (struct bfd_link_info *);
+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 *);