aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2018-04-20 15:30:18 -0700
committerJim Wilson <jimw@sifive.com>2018-04-20 15:30:18 -0700
commit7106056554c9f25e9a857b69b4595c9b3c7c4639 (patch)
tree90c03b2214cd6b856319ad23932b775c7277b652 /gas/config
parent5c8f23cdab2a7cde2dae6fcd5f9b18d089efecaf (diff)
downloadgdb-7106056554c9f25e9a857b69b4595c9b3c7c4639.zip
gdb-7106056554c9f25e9a857b69b4595c9b3c7c4639.tar.gz
gdb-7106056554c9f25e9a857b69b4595c9b3c7c4639.tar.bz2
RISC-V: Add new option -mrelax/-mno-relax.
gas/ * config/tc-riscv.c (options): Add OPTION_RELAX and OPTION_NO_RELAX. (md_longopts): New option -mrelax and -mno-relax. (md_parse_option): Handle -mrelax and -mno-relax. * doc/c-riscv.texi: Document for -mrelax and -mno-relax. * testsuite/gas/riscv/no-relax-reloc.d: New. * testsuite/gas/riscv/no-relax-reloc.s: New. * testsuite/gas/riscv/relax-reloc.d: New. * testsuite/gas/riscv/relax-reloc.s: New.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-riscv.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index f657023..be32e6c 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -2136,6 +2136,8 @@ enum options
OPTION_PIC,
OPTION_NO_PIC,
OPTION_MABI,
+ OPTION_RELAX,
+ OPTION_NO_RELAX,
OPTION_END_OF_ENUM
};
@@ -2146,6 +2148,8 @@ struct option md_longopts[] =
{"fpic", no_argument, NULL, OPTION_PIC},
{"fno-pic", no_argument, NULL, OPTION_NO_PIC},
{"mabi", required_argument, NULL, OPTION_MABI},
+ {"mrelax", no_argument, NULL, OPTION_RELAX},
+ {"mno-relax", no_argument, NULL, OPTION_NO_RELAX},
{NULL, no_argument, NULL, 0}
};
@@ -2205,6 +2209,14 @@ md_parse_option (int c, const char *arg)
return 0;
break;
+ case OPTION_RELAX:
+ riscv_opts.relax = TRUE;
+ break;
+
+ case OPTION_NO_RELAX:
+ riscv_opts.relax = FALSE;
+ break;
+
default:
return 0;
}
@@ -2921,6 +2933,8 @@ RISC-V options:\n\
-fno-pic don't generate position-independent code (default)\n\
-march=ISA set the RISC-V architecture\n\
-mabi=ABI set the RISC-V ABI\n\
+ -mrelax enable relax (default)\n\
+ -mno-relax disable relax\n\
"));
}