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:
parent
c7c16ea5ae
commit
c17c7aaf40
@ -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;
|
||||
|
||||
|
1
gas/testsuite/gas/aarch64/opt-invalid.d
Normal file
1
gas/testsuite/gas/aarch64/opt-invalid.d
Normal file
@ -0,0 +1 @@
|
||||
#error: .*: Error: unknown architectural extension `s'
|
1
gas/testsuite/gas/aarch64/opt-invalid.s
Normal file
1
gas/testsuite/gas/aarch64/opt-invalid.s
Normal file
@ -0,0 +1 @@
|
||||
.arch armv8-a+s
|
@ -1,5 +1,6 @@
|
||||
#objdump: -dr
|
||||
#as: -march=armv8-a+rdma
|
||||
#as: -march=armv8-a+rdm
|
||||
|
||||
.*: file format .*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user