aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAndrew Carlotti <andrew.carlotti@arm.com>2024-01-12 01:42:08 +0000
committerNick Clifton <nickc@redhat.com>2024-01-12 13:46:35 +0000
commitc17c7aaf40151230320b0d17873734effe131ff1 (patch)
tree5f01f70d52ba8617a1ab1ccc8710cc3197ca7ff7 /gas
parentc7c16ea5aed733477e6a7a32a1181b20bd4c42f5 (diff)
downloadgdb-c17c7aaf40151230320b0d17873734effe131ff1.zip
gdb-c17c7aaf40151230320b0d17873734effe131ff1.tar.gz
gdb-c17c7aaf40151230320b0d17873734effe131ff1.tar.bz2
aarch64: Fix option parsing to disallow prefixes of valid options
Add "+rdm" as an explicit alias for "+rdma", to maintain existing compatibility with Clang.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-aarch64.c4
-rw-r--r--gas/testsuite/gas/aarch64/opt-invalid.d1
-rw-r--r--gas/testsuite/gas/aarch64/opt-invalid.s1
-rw-r--r--gas/testsuite/gas/aarch64/rdma.d1
4 files changed, 6 insertions, 1 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 6b11c4e..c2f77a4 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -10274,6 +10274,7 @@ static const struct aarch64_option_cpu_value_table aarch64_features[] = {
{"lor", AARCH64_FEATURE (LOR), AARCH64_NO_FEATURES},
{"ras", AARCH64_FEATURE (RAS), AARCH64_NO_FEATURES},
{"rdma", AARCH64_FEATURE (RDMA), AARCH64_FEATURE (SIMD)},
+ {"rdm", AARCH64_FEATURE (RDMA), AARCH64_FEATURE (SIMD)},
{"fp16", AARCH64_FEATURE (F16), AARCH64_FEATURE (FP)},
{"fp16fml", AARCH64_FEATURE (F16_FML), AARCH64_FEATURE (F16)},
{"profile", AARCH64_FEATURE (PROFILE), AARCH64_NO_FEATURES},
@@ -10438,7 +10439,8 @@ aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p,
gas_assert (adding_value != -1);
for (opt = aarch64_features; opt->name != NULL; opt++)
- if (strncmp (opt->name, str, optlen) == 0)
+ if (optlen == (int) strlen(opt->name)
+ && strncmp (opt->name, str, optlen) == 0)
{
aarch64_feature_set set;
diff --git a/gas/testsuite/gas/aarch64/opt-invalid.d b/gas/testsuite/gas/aarch64/opt-invalid.d
new file mode 100644
index 0000000..500c68a
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/opt-invalid.d
@@ -0,0 +1 @@
+#error: .*: Error: unknown architectural extension `s'
diff --git a/gas/testsuite/gas/aarch64/opt-invalid.s b/gas/testsuite/gas/aarch64/opt-invalid.s
new file mode 100644
index 0000000..058d4c1
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/opt-invalid.s
@@ -0,0 +1 @@
+.arch armv8-a+s
diff --git a/gas/testsuite/gas/aarch64/rdma.d b/gas/testsuite/gas/aarch64/rdma.d
index d634909..b506d7d 100644
--- a/gas/testsuite/gas/aarch64/rdma.d
+++ b/gas/testsuite/gas/aarch64/rdma.d
@@ -1,5 +1,6 @@
#objdump: -dr
#as: -march=armv8-a+rdma
+#as: -march=armv8-a+rdm
.*: file format .*