X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felfxx-riscv.h;h=10b78ee4916ef04ac96b7bf33cc633da3e45d984;hb=0a1b45a20eaa98d4d9026dc1fd17e79e741183af;hp=836f05db5209509fe4e03e22f6063af6ac26e727;hpb=0aa13feeeb78fc9323bee329c4d91c30f25de121;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elfxx-riscv.h b/bfd/elfxx-riscv.h index 836f05db52..10b78ee491 100644 --- a/bfd/elfxx-riscv.h +++ b/bfd/elfxx-riscv.h @@ -1,5 +1,5 @@ /* RISC-V ELF specific backend routines. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. Contributed by Andrew Waterman (andrew@sifive.com). Based on MIPS target. @@ -22,6 +22,7 @@ #include "elf/common.h" #include "elf/internal.h" +#include "opcode/riscv.h" extern reloc_howto_type * riscv_reloc_name_lookup (bfd *, const char *); @@ -31,3 +32,82 @@ riscv_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); extern reloc_howto_type * riscv_elf_rtype_to_howto (bfd *, unsigned int r_type); + +/* The information of architecture attribute. */ +struct riscv_subset_t +{ + const char *name; + int major_version; + int minor_version; + struct riscv_subset_t *next; +}; + +typedef struct riscv_subset_t riscv_subset_t; + +typedef struct +{ + riscv_subset_t *head; + riscv_subset_t *tail; +} riscv_subset_list_t; + +extern void +riscv_release_subset_list (riscv_subset_list_t *); + +extern void +riscv_add_subset (riscv_subset_list_t *, + const char *, + int, int); + +extern bool +riscv_lookup_subset (const riscv_subset_list_t *, + const char *, + riscv_subset_t **); + +typedef struct +{ + riscv_subset_list_t *subset_list; + void (*error_handler) (const char *, + ...) ATTRIBUTE_PRINTF_1; + unsigned *xlen; + void (*get_default_version) (const char *, + int *, + int *); +} 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 *); + +extern char * +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 bool +bfd_elf32_riscv_restart_relax_sections (struct bfd_link_info *); + +extern bool +bfd_elf64_riscv_restart_relax_sections (struct bfd_link_info *);