From: Matthew Malcomson Date: Thu, 29 Jul 2021 14:40:34 +0000 (+0100) Subject: gas: aarch64: Accept `purecap` and `hybrid` ABI parameters X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87128493874c3d33fee1c75be78d4987f4516aa9;p=thirdparty%2Fbinutils-gdb.git gas: aarch64: Accept `purecap` and `hybrid` ABI parameters When GCC is given an ABI parameter with `-mabi=` it passes that argument down to GAS. GAS does not need to know the Morello ABI that is being used, since all decisions are based on the processor state (whether +c64 is enabled or not). GAS doesn't currently accept `purecap` or `hybrid` as arguments to the `-mabi` option. Even though it does not need this information, I think it should accept the arguments. This would mean GCC does not need implement special handling to avoid passing the `-mabi` argument to GAS in these specific cases. gas/ChangeLog: 2021-07-30 Matthew Malcomson * config/tc-aarch64.c (aarch64_abi_type): Introduce PURECAP and HYBRID enum entries. (aarch64_abis): Add "purecap" and "hybrid" parameters. * testsuite/gas/aarch64/morello-abis-ignored.s: New. * testsuite/gas/aarch64/morello-abis-ignored.d: New. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 81d580b64c5..06ff1d04022 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2021-07-29 Matthew Malcomson + + * config/tc-aarch64.c (aarch64_abi_type): Introduce PURECAP and HYBRID + enum entries. + (aarch64_abis): Add "purecap" and "hybrid" parameters. + * testsuite/gas/aarch64/morello-abis-ignored.s: New. + * testsuite/gas/aarch64/morello-abis-ignored.d: New. + 2021-07-29 Matthew Malcomson * config/tc-aarch64.c (s_aarch64_capinit, s_aarch64_chericap): diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 3d0436d538c..5735d127848 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -75,7 +75,9 @@ enum aarch64_abi_type { AARCH64_ABI_NONE = 0, AARCH64_ABI_LP64 = 1, - AARCH64_ABI_ILP32 = 2 + AARCH64_ABI_ILP32 = 2, + AARCH64_ABI_PURECAP = 3, + AARCH64_ABI_HYBRID = 4, }; #ifndef DEFAULT_ARCH @@ -10048,6 +10050,10 @@ struct aarch64_option_abi_value_table static const struct aarch64_option_abi_value_table aarch64_abis[] = { {"ilp32", AARCH64_ABI_ILP32}, {"lp64", AARCH64_ABI_LP64}, + /* Note that these values are accepted since they are valid parameters to + the -mabi argument for GCC. However we base no decision on them. */ + {"purecap", AARCH64_ABI_PURECAP}, + {"hybrid", AARCH64_ABI_HYBRID}, }; static int diff --git a/gas/testsuite/gas/aarch64/morello-abis-ignored.d b/gas/testsuite/gas/aarch64/morello-abis-ignored.d new file mode 100644 index 00000000000..37d7735ac67 --- /dev/null +++ b/gas/testsuite/gas/aarch64/morello-abis-ignored.d @@ -0,0 +1,18 @@ +#name: Morello ABI arguments accepted but ignored. +#as: -mabi=purecap +#as: -mabi=lp64 +#as: -mabi=hybrid +#readelf: --syms + +Symbol table '\.symtab' contains 10 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 + 2: 0000000000000000 0 SECTION LOCAL DEFAULT 2 + 3: 0000000000000000 0 SECTION LOCAL DEFAULT 3 + 4: 0000000000000001 0 FUNC LOCAL DEFAULT 1 foo + 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$c + 6: 0000000000000008 0 FUNC LOCAL DEFAULT 1 bar + 7: 0000000000000008 0 NOTYPE LOCAL DEFAULT 1 \$x + 8: 0000000000000011 0 FUNC LOCAL DEFAULT 1 baz + 9: 0000000000000010 0 NOTYPE LOCAL DEFAULT 1 \$c diff --git a/gas/testsuite/gas/aarch64/morello-abis-ignored.s b/gas/testsuite/gas/aarch64/morello-abis-ignored.s new file mode 100644 index 00000000000..39590632b60 --- /dev/null +++ b/gas/testsuite/gas/aarch64/morello-abis-ignored.s @@ -0,0 +1,15 @@ + .arch morello+c64 + .type foo, @function +foo: + mov x0, #0 + ret c30 + .arch morello + .type bar,@function +bar: + mov x0, #0 + ret c30 + .arch morello+c64 + .type baz, @function +baz: + mov x0, #0 + ret c30