public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
@ 2021-10-05  8:43 Tejas Belagod
  2021-10-28 14:41 ` Tejas Belagod
  0 siblings, 1 reply; 8+ messages in thread
From: Tejas Belagod @ 2021-10-05  8:43 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]


Hi,

This patch adds readelf support for decoding the exception table opcode for restoring the RA_AUTH_CODE pseudo register defined by the EHABI (https://github.com/ARM-software/abi-aa/releases/download/2021Q1/ehabi32.pdf Section 10.3).

Tested for arm-none-eabi. OK for master?

Thanks,
Tejas.

binutils/Changelog:

2021-10-05  Tejas Belagod  <tejas.belagod@arm.com>

	* readelf.c (decode_arm_unwind_bytecode): Add support to decode restoring
	RA_AUTH_CODE pseudo register.

[-- Attachment #2: ra_auth_code-decode.txt --]
[-- Type: text/plain, Size: 514 bytes --]

diff --git a/binutils/readelf.c b/binutils/readelf.c
index 4a6fcff3cc1237a1c801cd8912c18eabf3fb1f33..a9dd3f936821a6d3c83ffb0b26a86bac0a07abd8 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -9370,6 +9370,8 @@ decode_arm_unwind_bytecode (Filedata *                 filedata,
 	    printf ("-D%d", first + last);
 	  printf ("}");
 	}
+      else if (op == 0xb4)
+	printf (_("     pop {ra_auth_code}"));
       else if ((op & 0xf8) == 0xb8 || (op & 0xf8) == 0xd0)
 	{
 	  unsigned int count = op & 0x07;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
  2021-10-05  8:43 [Patch, Arm, Readelf] Support for a new pacbti unwind opcode Tejas Belagod
@ 2021-10-28 14:41 ` Tejas Belagod
  2021-10-29 10:09   ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: Tejas Belagod @ 2021-10-28 14:41 UTC (permalink / raw)
  To: binutils; +Cc: Richard Earnshaw

Ping

> -----Original Message-----
> From: Binutils <binutils-bounces+tejas.belagod=arm.com@sourceware.org>
> On Behalf Of Tejas Belagod via Binutils
> Sent: Tuesday, October 5, 2021 9:43 AM
> To: binutils@sourceware.org
> Subject: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
> 
> 
> Hi,
> 
> This patch adds readelf support for decoding the exception table opcode for
> restoring the RA_AUTH_CODE pseudo register defined by the EHABI
> (https://github.com/ARM-software/abi-
> aa/releases/download/2021Q1/ehabi32.pdf Section 10.3).
> 
> Tested for arm-none-eabi. OK for master?
> 
> Thanks,
> Tejas.
> 
> binutils/Changelog:
> 
> 2021-10-05  Tejas Belagod  <tejas.belagod@arm.com>
> 
> 	* readelf.c (decode_arm_unwind_bytecode): Add support to
> decode restoring
> 	RA_AUTH_CODE pseudo register.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
  2021-10-28 14:41 ` Tejas Belagod
@ 2021-10-29 10:09   ` Alan Modra
  2021-10-29 12:45     ` Tejas Belagod
  2021-10-29 14:50     ` Tejas Belagod
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Modra @ 2021-10-29 10:09 UTC (permalink / raw)
  To: Tejas Belagod; +Cc: binutils, Richard Earnshaw

On Thu, Oct 28, 2021 at 02:41:57PM +0000, Tejas Belagod via Binutils wrote:
> Ping
> 

Applied.  Would you mind having a look at this fail?

armeb-linuxeabi  +FAIL: Unwind information for Armv8.1-M.Mainline PACBTI extension

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
  2021-10-29 10:09   ` Alan Modra
@ 2021-10-29 12:45     ` Tejas Belagod
  2021-10-29 14:50     ` Tejas Belagod
  1 sibling, 0 replies; 8+ messages in thread
From: Tejas Belagod @ 2021-10-29 12:45 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, Richard Earnshaw



> -----Original Message-----
> From: Alan Modra <amodra@gmail.com>
> Sent: Friday, October 29, 2021 11:09 AM
> To: Tejas Belagod <Tejas.Belagod@arm.com>
> Cc: binutils@sourceware.org; Richard Earnshaw
> <Richard.Earnshaw@arm.com>
> Subject: Re: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
> 
> On Thu, Oct 28, 2021 at 02:41:57PM +0000, Tejas Belagod via Binutils wrote:
> > Ping
> >
> 
> Applied.  Would you mind having a look at this fail?
> 
> armeb-linuxeabi  +FAIL: Unwind information for Armv8.1-M.Mainline PACBTI
> extension
> 

Thanks. Will do - looks like an invalid test for armeb target.

Thanks,
Tejas.

> --
> Alan Modra
> Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
  2021-10-29 10:09   ` Alan Modra
  2021-10-29 12:45     ` Tejas Belagod
@ 2021-10-29 14:50     ` Tejas Belagod
  2021-10-31  2:50       ` Alan Modra
  1 sibling, 1 reply; 8+ messages in thread
From: Tejas Belagod @ 2021-10-29 14:50 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]



> -----Original Message-----
> From: Alan Modra <amodra@gmail.com>
> Sent: Friday, October 29, 2021 11:09 AM
> To: Tejas Belagod <Tejas.Belagod@arm.com>
> Cc: binutils@sourceware.org; Richard Earnshaw
> <Richard.Earnshaw@arm.com>
> Subject: Re: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
> 
> On Thu, Oct 28, 2021 at 02:41:57PM +0000, Tejas Belagod via Binutils wrote:
> > Ping
> >
> 
> Applied.  Would you mind having a look at this fail?
> 
> armeb-linuxeabi  +FAIL: Unwind information for Armv8.1-M.Mainline PACBTI
> extension
> 

gas/testsuite/arm/unwind-pacbti-m.d only tests for Little-Endian targets.
Disable it for Big-Endian targets.

2021-10-29  Tejas Belagod  <tbelagod@arm.com>

	* testsuite/gas/arm/unwind-pacbti-m.d: Disable for armeb targets.

Regression tested on armeb-linuxeabi, armeb-none-elf, arm-none-eabi. OK to apply?

Thanks,
Tejas.




[-- Attachment #2: armeb.txt --]
[-- Type: text/plain, Size: 631 bytes --]

diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m.d b/gas/testsuite/gas/arm/unwind-pacbti-m.d
index 584b12037b30136decb15da75a3e2641bd010827..ee21ab6e7acb822f9eb312bb80d695ea0fe9bf52 100644
--- a/gas/testsuite/gas/arm/unwind-pacbti-m.d
+++ b/gas/testsuite/gas/arm/unwind-pacbti-m.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Unwind information for Armv8.1-M.Mainline PACBTI extension
-# This test is only valid on ELF based ports.
-#notarget: *-*-pe *-*-wince
+# This test is only valid on Little-Endian or ELF based ports.
+#notarget: *-*-pe *-*-wince armeb*-*
 # VxWorks needs a special variant of this file.
 #skip: *-*-vxworks*
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
  2021-10-29 14:50     ` Tejas Belagod
@ 2021-10-31  2:50       ` Alan Modra
  2021-11-01 12:05         ` Tejas Belagod
  2021-11-02 12:13         ` Tejas Belagod
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Modra @ 2021-10-31  2:50 UTC (permalink / raw)
  To: Tejas Belagod; +Cc: binutils, Richard Earnshaw

On Fri, Oct 29, 2021 at 02:50:02PM +0000, Tejas Belagod wrote:
> 
> 
> > -----Original Message-----
> > From: Alan Modra <amodra@gmail.com>
> > Sent: Friday, October 29, 2021 11:09 AM
> > To: Tejas Belagod <Tejas.Belagod@arm.com>
> > Cc: binutils@sourceware.org; Richard Earnshaw
> > <Richard.Earnshaw@arm.com>
> > Subject: Re: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
> > 
> > On Thu, Oct 28, 2021 at 02:41:57PM +0000, Tejas Belagod via Binutils wrote:
> > > Ping
> > >
> > 
> > Applied.  Would you mind having a look at this fail?
> > 
> > armeb-linuxeabi  +FAIL: Unwind information for Armv8.1-M.Mainline PACBTI
> > extension
> > 
> 
> gas/testsuite/arm/unwind-pacbti-m.d only tests for Little-Endian targets.
> Disable it for Big-Endian targets.

Is there a reason the test should not run for BE?  How about this
instead?

	* testsuite/gas/arm/unwind-pacbti-m.d: Match armeb output.

diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m.d b/gas/testsuite/gas/arm/unwind-pacbti-m.d
index 584b12037b3..28021758a74 100644
--- a/gas/testsuite/gas/arm/unwind-pacbti-m.d
+++ b/gas/testsuite/gas/arm/unwind-pacbti-m.d
@@ -14,10 +14,10 @@ OFFSET   TYPE              VALUE
 
 
 Contents of section .text:
- 0000 10b54df8 04cd5df8 04cb10bd  .*
+ 0000 (10b54df8 04cd5df8 04cb10bd|b510f84d cd04f85d cb04bd10)  .*
 Contents of section .ARM.exidx:
- 0000 00000000 b0a8b480  .*
+ 0000 00000000 (b0a8b480|80b4a8b0)  .*
 Contents of section .ARM.attributes:
- 0000 41290000 00616561 62690001 1f000000  .*
+ 0000 41(290000 00|000000 29)616561 62690001 (1f000000|0000001f)  .*
  0010 05382e31 2d4d2e4d 41494e00 0615074d  .*
  0020 09033202 34024a01 4c01               .*


-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
  2021-10-31  2:50       ` Alan Modra
@ 2021-11-01 12:05         ` Tejas Belagod
  2021-11-02 12:13         ` Tejas Belagod
  1 sibling, 0 replies; 8+ messages in thread
From: Tejas Belagod @ 2021-11-01 12:05 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, Richard Earnshaw



> -----Original Message-----
> From: Alan Modra <amodra@gmail.com>
> Sent: Sunday, October 31, 2021 2:51 AM
> To: Tejas Belagod <Tejas.Belagod@arm.com>
> Cc: binutils@sourceware.org; Richard Earnshaw
> <Richard.Earnshaw@arm.com>
> Subject: Re: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
> 
> On Fri, Oct 29, 2021 at 02:50:02PM +0000, Tejas Belagod wrote:
> >
> >
> > > -----Original Message-----
> > > From: Alan Modra <amodra@gmail.com>
> > > Sent: Friday, October 29, 2021 11:09 AM
> > > To: Tejas Belagod <Tejas.Belagod@arm.com>
> > > Cc: binutils@sourceware.org; Richard Earnshaw
> > > <Richard.Earnshaw@arm.com>
> > > Subject: Re: [Patch, Arm, Readelf] Support for a new pacbti unwind
> opcode.
> > >
> > > On Thu, Oct 28, 2021 at 02:41:57PM +0000, Tejas Belagod via Binutils
> wrote:
> > > > Ping
> > > >
> > >
> > > Applied.  Would you mind having a look at this fail?
> > >
> > > armeb-linuxeabi  +FAIL: Unwind information for Armv8.1-M.Mainline
> > > PACBTI extension
> > >
> >
> > gas/testsuite/arm/unwind-pacbti-m.d only tests for Little-Endian targets.
> > Disable it for Big-Endian targets.
> 
> Is there a reason the test should not run for BE?  How about this instead?
> 
It should be run for BE too.
I was planning BE as another test case in a subsequent patch - the patch you propose here is better. I shall prepare the patch along these lines.

Thanks,
Tejas.

> 	* testsuite/gas/arm/unwind-pacbti-m.d: Match armeb output.
> 
> diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m.d
> b/gas/testsuite/gas/arm/unwind-pacbti-m.d
> index 584b12037b3..28021758a74 100644
> --- a/gas/testsuite/gas/arm/unwind-pacbti-m.d
> +++ b/gas/testsuite/gas/arm/unwind-pacbti-m.d
> @@ -14,10 +14,10 @@ OFFSET   TYPE              VALUE
> 
> 
>  Contents of section .text:
> - 0000 10b54df8 04cd5df8 04cb10bd  .*
> + 0000 (10b54df8 04cd5df8 04cb10bd|b510f84d cd04f85d cb04bd10)  .*
>  Contents of section .ARM.exidx:
> - 0000 00000000 b0a8b480  .*
> + 0000 00000000 (b0a8b480|80b4a8b0)  .*
>  Contents of section .ARM.attributes:
> - 0000 41290000 00616561 62690001 1f000000  .*
> + 0000 41(290000 00|000000 29)616561 62690001 (1f000000|0000001f)  .*
>   0010 05382e31 2d4d2e4d 41494e00 0615074d  .*
>   0020 09033202 34024a01 4c01               .*
> 
> 
> --
> Alan Modra
> Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
  2021-10-31  2:50       ` Alan Modra
  2021-11-01 12:05         ` Tejas Belagod
@ 2021-11-02 12:13         ` Tejas Belagod
  1 sibling, 0 replies; 8+ messages in thread
From: Tejas Belagod @ 2021-11-02 12:13 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]



> -----Original Message-----
> From: Alan Modra <amodra@gmail.com>
> Sent: Sunday, October 31, 2021 2:51 AM
> To: Tejas Belagod <Tejas.Belagod@arm.com>
> Cc: binutils@sourceware.org; Richard Earnshaw
> <Richard.Earnshaw@arm.com>
> Subject: Re: [Patch, Arm, Readelf] Support for a new pacbti unwind opcode.
> 
> On Fri, Oct 29, 2021 at 02:50:02PM +0000, Tejas Belagod wrote:
> >
> >
> > > -----Original Message-----
> > > From: Alan Modra <amodra@gmail.com>
> > > Sent: Friday, October 29, 2021 11:09 AM
> > > To: Tejas Belagod <Tejas.Belagod@arm.com>
> > > Cc: binutils@sourceware.org; Richard Earnshaw
> > > <Richard.Earnshaw@arm.com>
> > > Subject: Re: [Patch, Arm, Readelf] Support for a new pacbti unwind
> opcode.
> > >
> > > On Thu, Oct 28, 2021 at 02:41:57PM +0000, Tejas Belagod via Binutils
> wrote:
> > > > Ping
> > > >
> > >
> > > Applied.  Would you mind having a look at this fail?
> > >
> > > armeb-linuxeabi  +FAIL: Unwind information for Armv8.1-M.Mainline
> > > PACBTI extension
> > >
> >
> > gas/testsuite/arm/unwind-pacbti-m.d only tests for Little-Endian targets.
> > Disable it for Big-Endian targets.
> 
> Is there a reason the test should not run for BE?  How about this instead?
> 
> 	* testsuite/gas/arm/unwind-pacbti-m.d: Match armeb output.
> 
> diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m.d
> b/gas/testsuite/gas/arm/unwind-pacbti-m.d
> index 584b12037b3..28021758a74 100644
> --- a/gas/testsuite/gas/arm/unwind-pacbti-m.d
> +++ b/gas/testsuite/gas/arm/unwind-pacbti-m.d
> @@ -14,10 +14,10 @@ OFFSET   TYPE              VALUE
> 
> 
>  Contents of section .text:
> - 0000 10b54df8 04cd5df8 04cb10bd  .*
> + 0000 (10b54df8 04cd5df8 04cb10bd|b510f84d cd04f85d cb04bd10)  .*
>  Contents of section .ARM.exidx:
> - 0000 00000000 b0a8b480  .*
> + 0000 00000000 (b0a8b480|80b4a8b0)  .*
>  Contents of section .ARM.attributes:
> - 0000 41290000 00616561 62690001 1f000000  .*
> + 0000 41(290000 00|000000 29)616561 62690001 (1f000000|0000001f)  .*
>   0010 05382e31 2d4d2e4d 41494e00 0615074d  .*
>   0020 09033202 34024a01 4c01               .*
> 

Thanks for the reviews and suggestions. Attached is the patch with review comments incorporated.

gas/testsuite/arm/unwind-pacbti-m.d presently only tests for Little-Endian
targets.  Add support for testing Big-Endian targets.

2021-11-02  Tejas Belagod  <tbelagod@arm.com>

	* testsuite/gas/arm/unwind-pacbti-m.d: Add armeb tests.

Regression tested on armeb-linuxeabi, armeb-none-elf, arm-eabi.  OK for master?

Thanks,
Tejas.

> 
> --
> Alan Modra
> Australia Development Lab, IBM

[-- Attachment #2: pacbti-m-eleb.txt --]
[-- Type: text/plain, Size: 824 bytes --]

diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m.d b/gas/testsuite/gas/arm/unwind-pacbti-m.d
index 584b12037b30136decb15da75a3e2641bd010827..28021758a7487097689ef4c44cc25546ccac5221 100644
--- a/gas/testsuite/gas/arm/unwind-pacbti-m.d
+++ b/gas/testsuite/gas/arm/unwind-pacbti-m.d
@@ -14,10 +14,10 @@ OFFSET   TYPE              VALUE
 
 
 Contents of section .text:
- 0000 10b54df8 04cd5df8 04cb10bd  .*
+ 0000 (10b54df8 04cd5df8 04cb10bd|b510f84d cd04f85d cb04bd10)  .*
 Contents of section .ARM.exidx:
- 0000 00000000 b0a8b480  .*
+ 0000 00000000 (b0a8b480|80b4a8b0)  .*
 Contents of section .ARM.attributes:
- 0000 41290000 00616561 62690001 1f000000  .*
+ 0000 41(290000 00|000000 29)616561 62690001 (1f000000|0000001f)  .*
  0010 05382e31 2d4d2e4d 41494e00 0615074d  .*
  0020 09033202 34024a01 4c01               .*

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-02 12:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05  8:43 [Patch, Arm, Readelf] Support for a new pacbti unwind opcode Tejas Belagod
2021-10-28 14:41 ` Tejas Belagod
2021-10-29 10:09   ` Alan Modra
2021-10-29 12:45     ` Tejas Belagod
2021-10-29 14:50     ` Tejas Belagod
2021-10-31  2:50       ` Alan Modra
2021-11-01 12:05         ` Tejas Belagod
2021-11-02 12:13         ` Tejas Belagod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).