[0/4] aarch64: Add STO_AARCH64_VARIANT_PCS support

Message ID 72a65558-263b-bb35-5fbb-7d9d5dce1717@arm.com
Headers show
Series
  • aarch64: Add STO_AARCH64_VARIANT_PCS support
Related show

Message

Szabolcs Nagy May 23, 2019, 11:04 a.m.
Adds support for a new aarch64 specific st_other flag that
is used for marking function symbols that follow different
register usage convention from the base PCS. It is required
for lazy binding support for vector PCS calls.

The ELF ABI draft and detailed description is at
https://sourceware.org/ml/binutils/2019-05/msg00294.html

Szabolcs Nagy (4):
  aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS
  aarch64: handle .variant_pcs directive in gas
  aarch64: override default elf .set handling in gas
  aarch64: handle STO_AARCH64_VARIANT_PCS in bfd

 bfd/elfnn-aarch64.c                           | 41 +++++++++++
 binutils/readelf.c                            | 20 ++++++
 gas/config/tc-aarch64.c                       | 55 +++++++++++++++
 gas/config/tc-aarch64.h                       |  6 ++
 gas/doc/c-aarch64.texi                        |  6 ++
 .../gas/aarch64/symbol-variant_pcs-1.d        | 10 +++
 .../gas/aarch64/symbol-variant_pcs-1.s        |  8 +++
 .../gas/aarch64/symbol-variant_pcs-2.d        |  9 +++
 .../gas/aarch64/symbol-variant_pcs-2.s        |  4 ++
 .../gas/aarch64/symbol-variant_pcs-3.d        | 12 ++++
 .../gas/aarch64/symbol-variant_pcs-3.s        | 20 ++++++
 include/elf/aarch64.h                         |  5 ++
 ld/testsuite/ld-aarch64/aarch64-elf.exp       |  4 ++
 ld/testsuite/ld-aarch64/variant_pcs-1.s       | 59 ++++++++++++++++
 ld/testsuite/ld-aarch64/variant_pcs-2.s       | 47 +++++++++++++
 ld/testsuite/ld-aarch64/variant_pcs-now.d     | 68 +++++++++++++++++++
 ld/testsuite/ld-aarch64/variant_pcs-r.d       | 60 ++++++++++++++++
 ld/testsuite/ld-aarch64/variant_pcs-shared.d  | 68 +++++++++++++++++++
 ld/testsuite/ld-aarch64/variant_pcs.ld        | 23 +++++++
 19 files changed, 525 insertions(+)
 create mode 100644 gas/testsuite/gas/aarch64/symbol-variant_pcs-1.d
 create mode 100644 gas/testsuite/gas/aarch64/symbol-variant_pcs-1.s
 create mode 100644 gas/testsuite/gas/aarch64/symbol-variant_pcs-2.d
 create mode 100644 gas/testsuite/gas/aarch64/symbol-variant_pcs-2.s
 create mode 100644 gas/testsuite/gas/aarch64/symbol-variant_pcs-3.d
 create mode 100644 gas/testsuite/gas/aarch64/symbol-variant_pcs-3.s
 create mode 100644 ld/testsuite/ld-aarch64/variant_pcs-1.s
 create mode 100644 ld/testsuite/ld-aarch64/variant_pcs-2.s
 create mode 100644 ld/testsuite/ld-aarch64/variant_pcs-now.d
 create mode 100644 ld/testsuite/ld-aarch64/variant_pcs-r.d
 create mode 100644 ld/testsuite/ld-aarch64/variant_pcs-shared.d
 create mode 100644 ld/testsuite/ld-aarch64/variant_pcs.ld

-- 
2.17.1

Comments

Nick Clifton May 24, 2019, 10:26 a.m. | #1
Hi Szabolcs,

> Szabolcs Nagy (4):

>   aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS

>   aarch64: handle .variant_pcs directive in gas

>   aarch64: override default elf .set handling in gas

>   aarch64: handle STO_AARCH64_VARIANT_PCS in bfd

 
Patch series approved.  (Well modulo the small request for a larger buffer).

Cheers
  Nick
Szabolcs Nagy May 24, 2019, 2:25 p.m. | #2
On 24/05/2019 11:26, Nick Clifton wrote:
> Hi Szabolcs,

> 

>> Szabolcs Nagy (4):

>>   aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS

>>   aarch64: handle .variant_pcs directive in gas

>>   aarch64: override default elf .set handling in gas

>>   aarch64: handle STO_AARCH64_VARIANT_PCS in bfd

>  

> Patch series approved.  (Well modulo the small request for a larger buffer).


thanks, applied.
(with original buffer size)
Szabolcs Nagy May 24, 2019, 3:08 p.m. | #3
On 24/05/2019 11:26, Nick Clifton wrote:
> Hi Szabolcs,

> 

>> Szabolcs Nagy (4):

>>   aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS

>>   aarch64: handle .variant_pcs directive in gas

>>   aarch64: override default elf .set handling in gas

>>   aarch64: handle STO_AARCH64_VARIANT_PCS in bfd

>  

> Patch series approved.  (Well modulo the small request for a larger buffer).


this is new abi, but since it is required for correctness,
i'd like to backport it to the 2.32 release branch after
some testing on the master branch.
Szabolcs Nagy July 5, 2019, 2:29 p.m. | #4
On 24/05/2019 16:08, Szabolcs Nagy wrote:
> On 24/05/2019 11:26, Nick Clifton wrote:

>> Hi Szabolcs,

>>

>>> Szabolcs Nagy (4):

>>>   aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS

>>>   aarch64: handle .variant_pcs directive in gas

>>>   aarch64: override default elf .set handling in gas

>>>   aarch64: handle STO_AARCH64_VARIANT_PCS in bfd

>>  

>> Patch series approved.  (Well modulo the small request for a larger buffer).

> 

> this is new abi, but since it is required for correctness,

> i'd like to backport it to the 2.32 release branch after

> some testing on the master branch.

> 


backported to 2.32 branch.
Szabolcs Nagy July 8, 2019, 2:25 p.m. | #5
On 05/07/2019 15:29, Szabolcs Nagy wrote:
> On 24/05/2019 16:08, Szabolcs Nagy wrote:

>> On 24/05/2019 11:26, Nick Clifton wrote:

>>> Hi Szabolcs,

>>>

>>>> Szabolcs Nagy (4):

>>>>   aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS

>>>>   aarch64: handle .variant_pcs directive in gas

>>>>   aarch64: override default elf .set handling in gas

>>>>   aarch64: handle STO_AARCH64_VARIANT_PCS in bfd

>>>  

>>> Patch series approved.  (Well modulo the small request for a larger buffer).

>>

>> this is new abi, but since it is required for correctness,

>> i'd like to backport it to the 2.32 release branch after

>> some testing on the master branch.

>>

> 

> backported to 2.32 branch.

> 


i made a mistake in the backport that can cause build
failure with -werror.

committed the attached patch to fix it.
From 16ba30dcfaa33637fb06bf4e6ff8afe68cb6c810 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <szabolcs.nagy@arm.com>

Date: Mon, 8 Jul 2019 13:57:43 +0100
Subject: [PATCH] aarch64: fix DT_AARCH64_VARIANT_PCS handling in readelf

backport commit 13acf03468d1e218c0a980ff6e6adaaac4bb5d1e
failed to copy the changes in get_dynamic_type.

this could cause build failure

binutils/readelf.c:1800:1: warning: 'get_aarch64_dynamic_type' defined but not used [-Wunused-function]

binutils/ChangeLog:

2019-07-08  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* readelf.c (get_dynamic_type): Handle EM_AARCH64.
---
 binutils/readelf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/binutils/readelf.c b/binutils/readelf.c
index 28466e0cd7..6b4eb41aee 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2180,6 +2180,9 @@ get_dynamic_type (Filedata * filedata, unsigned long type)
 
 	  switch (filedata->file_header.e_machine)
 	    {
+	    case EM_AARCH64:
+	      result = get_aarch64_dynamic_type (type);
+	      break;
 	    case EM_MIPS:
 	    case EM_MIPS_RS3_LE:
 	      result = get_mips_dynamic_type (type);
-- 
2.17.1