X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-riscv.c;h=055d80c3444431d5b3305f72970fb96958cde4b4;hb=0ba59a29407a9d24559a653ce0401a26d9a37aaa;hp=e50505138e95d386d51c80ca3119b5838b47e608;hpb=7e9ad3a35cde2342e07c34345d5ee671ea8aeeb4;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index e50505138e..055d80c344 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -446,12 +446,6 @@ opcode_name_lookup (char **s) return o; } -struct regname -{ - const char *name; - unsigned int num; -}; - enum reg_class { RCLASS_GPR, @@ -489,7 +483,7 @@ hash_reg_names (enum reg_class class, const char * const names[], unsigned n) static unsigned int reg_lookup_internal (const char *s, enum reg_class class) { - struct regname *r = (struct regname *) hash_find (reg_names_hash, s); + void *r = hash_find (reg_names_hash, s); if (r == NULL || DECODE_REG_CLASS (r) != class) return -1; @@ -2347,6 +2341,12 @@ riscv_after_parse_args (void) /* Insert float_abi into the EF_RISCV_FLOAT_ABI field of elf_flags. */ elf_flags |= float_abi * (EF_RISCV_FLOAT_ABI & ~(EF_RISCV_FLOAT_ABI << 1)); + + /* If the CIE to be produced has not been overridden on the command line, + then produce version 3 by default. This allows us to use the full + range of registers in a .cfi_return_column directive. */ + if (flag_dwarf_cie_version == -1) + flag_dwarf_cie_version = 3; } long @@ -3043,6 +3043,10 @@ tc_riscv_regname_to_dw2regnum (char *regname) if ((reg = reg_lookup_internal (regname, RCLASS_FPR)) >= 0) return reg + 32; + /* CSRs are numbered 4096 -> 8191. */ + if ((reg = reg_lookup_internal (regname, RCLASS_CSR)) >= 0) + return reg + 4096; + as_bad (_("unknown register `%s'"), regname); return -1; }