public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: nickc@redhat.com, Indu Bhagat <indu.bhagat@oracle.com>
Subject: [COMMITTED, V2 4/5] [4/5] gas: sframe: testsuite: add testcase for .cfi_b_key_frame
Date: Mon, 19 Dec 2022 12:23:27 -0800	[thread overview]
Message-ID: <20221219202328.1442022-5-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20221219202328.1442022-1-indu.bhagat@oracle.com>

[Changes in V2]
  - Adjust the testcase as we now emit "[s]" marker when the return
  address in either reg / stack is mangled.
[End of changes in V2]

This is actually a composite test that checks the behaviour of both the
.cfi_negate_ra_state and .cfi_b_key_frame directives on aarch64.

ChangeLog:

	* testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d:
	New test.
	* testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s:
	Likewise.
	* testsuite/gas/cfi-sframe/cfi-sframe.exp: Run new test.
---
 .../cfi-sframe-aarch64-pac-ab-key-1.d         | 27 ++++++++++++++
 .../cfi-sframe-aarch64-pac-ab-key-1.s         | 36 +++++++++++++++++++
 gas/testsuite/gas/cfi-sframe/cfi-sframe.exp   |  1 +
 3 files changed, 64 insertions(+)
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d
 create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s

diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d
new file mode 100644
index 00000000000..666a94101ab
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d
@@ -0,0 +1,27 @@
+#as: --gsframe
+#objdump: --sframe=.sframe
+#name: SFrame cfi_b_key_frame and cfi_negate_ra_state composite test
+#...
+Contents of the SFrame section .sframe:
+
+  Header :
+
+    Version: SFRAME_VERSION_1
+    Flags: NONE
+    Num FDEs: 2
+    Num FREs: 6
+
+  Function Index :
+    func idx \[0\]: pc = 0x0, size = 12 bytes
+    STARTPC + CFA + FP + RA +
+    0+0000 +sp\+0 +u +u +
+    0+0004 +sp\+0 +u +u\[s\] +
+    0+0008 +sp\+16 +c-16 +c-8\[s\] +
+
+    func idx \[1\]: pc = 0x0, size = 20 bytes, pauth = B key
+    STARTPC + CFA + FP +  RA +
+    0+0000 +sp\+0 +u +u +
+    0+0004 +sp\+0 +u +u\[s\] +
+    0+0008 +sp\+16 +c-16 +c-8\[s\] +
+
+#pass
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s
new file mode 100644
index 00000000000..d9a408c668c
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s
@@ -0,0 +1,36 @@
+## same as aarch64/pac_ab_key.s
+	.arch armv8-a
+	.text
+	.align	2
+	.global	_Z5foo_av
+	.type	_Z5foo_av, %function
+_Z5foo_av:
+.LFB0:
+	.cfi_startproc
+	hint	25 // paciasp
+	.cfi_window_save
+	stp	x29, x30, [sp, -16]!
+	.cfi_def_cfa_offset 16
+	.cfi_offset 29, -16
+	.cfi_offset 30, -8
+        ret
+	.cfi_endproc
+.LFE0:
+	.size	_Z5foo_av, .-_Z5foo_av
+	.align	2
+	.global	_Z5foo_bv
+	.type	_Z5foo_bv, %function
+_Z5foo_bv:
+.LFB1:
+	.cfi_startproc
+	.cfi_b_key_frame
+	hint	27 // pacibsp
+	.cfi_window_save
+	stp	x29, x30, [sp, -16]!
+	.cfi_def_cfa_offset 16
+	.cfi_offset 29, -16
+	.cfi_offset 30, -8
+	nop
+	nop
+        ret
+	.cfi_endproc
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
index f001fad0e8e..fa153fc52b3 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
@@ -97,4 +97,5 @@ if { [istarget "x86_64-*-*"] && [gas_sframe_check] } then {
 if { [istarget "aarch64*-*-*"] && [gas_sframe_check] } then {
     run_dump_test "cfi-sframe-aarch64-1"
     run_dump_test "cfi-sframe-aarch64-2"
+    run_dump_test "cfi-sframe-aarch64-pac-ab-key-1"
 }
-- 
2.37.2


  parent reply	other threads:[~2022-12-19 20:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 20:07 [PATCH 0/5] SFrame: add support " Indu Bhagat
2022-12-14 20:07 ` [PATCH 1/5] [1/5] sframe.h: " Indu Bhagat
2022-12-14 20:07 ` [PATCH 2/5] [2/5] gas: sframe: " Indu Bhagat
2022-12-14 20:07 ` [PATCH 3/5] [3/5] objdump/readelf: sframe: emit marker for SFrame FDE with B key Indu Bhagat
2022-12-14 20:07 ` [PATCH 4/5] [4/5] gas: sframe: testsuite: add testcase for .cfi_b_key_frame Indu Bhagat
2022-12-14 20:07 ` [PATCH 5/5] [5/5] sframe: doc: update documentation for pauth key in SFrame FDE Indu Bhagat
2022-12-19 15:36 ` [PATCH 0/5] SFrame: add support for .cfi_b_key_frame Nick Clifton
2022-12-19 17:27   ` Indu Bhagat
2022-12-19 20:23   ` [COMMITTED, V2 " Indu Bhagat
2022-12-19 20:23     ` [COMMITTED, V2 1/5] [1/5] sframe.h: " Indu Bhagat
2022-12-19 20:23     ` [COMMITTED, V2 2/5] [2/5] gas: sframe: " Indu Bhagat
2022-12-19 20:23     ` [COMMITTED, V2 3/5] [3/5] objdump/readelf: sframe: emit marker for SFrame FDE with B key Indu Bhagat
2022-12-19 20:23     ` Indu Bhagat [this message]
2022-12-19 20:23     ` [COMMITTED, V2 5/5] [5/5] sframe: doc: update documentation for pauth key in SFrame FDE Indu Bhagat
2022-12-19 21:11     ` [COMMITTED, V2 0/5] SFrame: add support for .cfi_b_key_frame Indu Bhagat
2022-12-19 21:14   ` [PATCH, " Indu Bhagat
2022-12-19 21:14     ` [PATCH, V2 1/5] [1/5] sframe.h: " Indu Bhagat
2022-12-19 21:14     ` [PATCH, V2 2/5] [2/5] gas: sframe: " Indu Bhagat
2022-12-19 21:14     ` [PATCH, V2 3/5] [3/5] objdump/readelf: sframe: emit marker for SFrame FDE with B key Indu Bhagat
2022-12-19 21:14     ` [PATCH, V2 4/5] [4/5] gas: sframe: testsuite: add testcase for .cfi_b_key_frame Indu Bhagat
2022-12-19 21:14     ` [PATCH, V2 5/5] [5/5] sframe: doc: update documentation for pauth key in SFrame FDE Indu Bhagat
2022-12-21 18:19     ` [PATCH, V2 0/5] SFrame: add support for .cfi_b_key_frame Indu Bhagat
2022-12-22  8:40       ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221219202328.1442022-5-indu.bhagat@oracle.com \
    --to=indu.bhagat@oracle.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).