]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: aarch64: Accept `purecap` and `hybrid` ABI parameters
authorMatthew Malcomson <matthew.malcomson@arm.com>
Thu, 29 Jul 2021 14:40:34 +0000 (15:40 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 30 Jul 2021 09:20:38 +0000 (10:20 +0100)
When GCC is given an ABI parameter with `-mabi=<whatever>` 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  <matthew.malcomson@arm.com>

* 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.

gas/ChangeLog
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/morello-abis-ignored.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/morello-abis-ignored.s [new file with mode: 0644]

index 81d580b64c52985128b4cd682d227dfec5eaf239..06ff1d04022dcc6f4027e2f09d7ff18aee9cf78a 100644 (file)
@@ -1,3 +1,11 @@
+2021-07-29  Matthew Malcomson  <matthew.malcomson@arm.com>
+
+       * 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  <matthew.malcomson@arm.com>
 
        * config/tc-aarch64.c (s_aarch64_capinit, s_aarch64_chericap):
index 3d0436d538c856a418f6949fb47998f69558b6fc..5735d127848bdf22685b436b541424f4af0ae636 100644 (file)
@@ -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 (file)
index 0000000..37d7735
--- /dev/null
@@ -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 (file)
index 0000000..3959063
--- /dev/null
@@ -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