Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > 96c6fcad26b4c60fa9809f334cafc603 > files > 2

binutils-2.33.1-1.mga7.src.rpm

From 6e613b58acc527e366e05fb9d9b29bee04874a88 Mon Sep 17 00:00:00 2001
From: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Fri, 6 Dec 2019 12:00:17 +0000
Subject: [PATCH] [gas] Implement .cfi_negate_ra_state directive

2019-12-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backported from mainline.
	2019-12-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* dw2gencfi.c (cfi_pseudo_table): Add cfi_negate_ra_state.
	* testsuite/gas/aarch64/pac_negate_ra_state.s: New file.
	* testsuite/gas/aarch64/pac_negate_ra_state.d: Likewise.
---
 gas/ChangeLog                                 |  9 +++++++
 gas/dw2gencfi.c                               |  1 +
 .../gas/aarch64/pac_negate_ra_state.d         | 26 +++++++++++++++++++
 .../gas/aarch64/pac_negate_ra_state.s         | 20 ++++++++++++++
 4 files changed, 56 insertions(+)
 create mode 100644 gas/testsuite/gas/aarch64/pac_negate_ra_state.d
 create mode 100644 gas/testsuite/gas/aarch64/pac_negate_ra_state.s

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0955809b5b..fcb5592f9f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2019-12-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+	Backported from mainline.
+	2019-12-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+	* dw2gencfi.c (cfi_pseudo_table): Add cfi_negate_ra_state.
+	* testsuite/gas/aarch64/pac_negate_ra_state.s: New file.
+	* testsuite/gas/aarch64/pac_negate_ra_state.d: Likewise.
+
 2019-10-14  Tamar Christina  <tamar.christina@arm.com>
 
 	Backported from mainline.
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index f30734d384..ab97ac4e16 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -726,6 +726,7 @@ const pseudo_typeS cfi_pseudo_table[] =
     { "cfi_remember_state", dot_cfi, DW_CFA_remember_state },
     { "cfi_restore_state", dot_cfi, DW_CFA_restore_state },
     { "cfi_window_save", dot_cfi, DW_CFA_GNU_window_save },
+    { "cfi_negate_ra_state", dot_cfi, DW_CFA_AARCH64_negate_ra_state },
     { "cfi_escape", dot_cfi_escape, 0 },
     { "cfi_signal_frame", dot_cfi, CFI_signal_frame },
     { "cfi_personality", dot_cfi_personality, 0 },
diff --git a/gas/testsuite/gas/aarch64/pac_negate_ra_state.d b/gas/testsuite/gas/aarch64/pac_negate_ra_state.d
new file mode 100644
index 0000000000..7ab0f2369d
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/pac_negate_ra_state.d
@@ -0,0 +1,26 @@
+#objdump: --dwarf=frames
+
+.+:     file .+
+
+Contents of the .eh_frame section:
+
+00000000 0000000000000010 00000000 CIE
+  Version:               1
+  Augmentation:          "zR"
+  Code alignment factor: 4
+  Data alignment factor: -8
+  Return address column: 30
+  Augmentation data:     1b
+  DW_CFA_def_cfa: r31 \(sp\) ofs 0
+
+00000014 0000000000000018 00000018 FDE cie=00000000 pc=0000000000000000..0000000000000008
+  DW_CFA_advance_loc: 4 to 0000000000000004
+  DW_CFA_GNU_window_save
+  DW_CFA_advance_loc: 4 to 0000000000000008
+  DW_CFA_def_cfa_offset: 16
+  DW_CFA_offset: r29 \(x29\) at cfa-16
+  DW_CFA_offset: r30 \(x30\) at cfa-8
+  DW_CFA_nop
+  DW_CFA_nop
+
+
diff --git a/gas/testsuite/gas/aarch64/pac_negate_ra_state.s b/gas/testsuite/gas/aarch64/pac_negate_ra_state.s
new file mode 100644
index 0000000000..36ddbeb43b
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/pac_negate_ra_state.s
@@ -0,0 +1,20 @@
+	.arch armv8-a
+	.text
+	.align	2
+	.global	_Z5foo_av
+	.type	_Z5foo_av, %function
+_Z5foo_av:
+.LFB0:
+	.cfi_startproc
+	hint	25 // paciasp
+	.cfi_negate_ra_state
+	stp	x29, x30, [sp, -16]!
+	.cfi_def_cfa_offset 16
+	.cfi_offset 29, -16
+	.cfi_offset 30, -8
+	.cfi_endproc
+.LFE0:
+	.size	_Z5foo_av, .-_Z5foo_av
+	.align	2
+	.global	_Z5foo_bv
+	.type	_Z5foo_bv, %function
-- 
2.25.1