aarch64: Fix option parsing to disallow prefixes of valid options

Add "+rdm" as an explicit alias for "+rdma", to maintain existing compatibility
with Clang.
This commit is contained in:
Andrew Carlotti 2024-01-12 01:42:08 +00:00 committed by Nick Clifton
parent c7c16ea5ae
commit c17c7aaf40
4 changed files with 6 additions and 1 deletions

View File

@ -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;

View File

@ -0,0 +1 @@
#error: .*: Error: unknown architectural extension `s'

View File

@ -0,0 +1 @@
.arch armv8-a+s

View File

@ -1,5 +1,6 @@
#objdump: -dr
#as: -march=armv8-a+rdma
#as: -march=armv8-a+rdm
.*: file format .*