[02/12] gas: generate SFrame section with version SFRAME_VERSION_2

Message ID 20230627212028.2138604-3-indu.bhagat@oracle.com
State Accepted
Headers
Series SFrame Version 2 - definition and support |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Indu Bhagat June 27, 2023, 9:20 p.m. UTC
  gas/
	* gen-sframe.c (sframe_set_version): Update to SFRAME_VERSION_2.
	(output_sframe): Likewise.

gas/testsuite/
	* gas/cfi-sframe/cfi-sframe-aarch64-1.d: Use SFRAME_VERSION_2.
	* gas/cfi-sframe/cfi-sframe-aarch64-2.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-1.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-2.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-3.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-4.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-5.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-6.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-7.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-common-8.d: Likewise.
	* gas/cfi-sframe/cfi-sframe-x86_64-1.d: Likewise.
	* gas/cfi-sframe/common-empty-1.d: Likewise.
	* gas/cfi-sframe/common-empty-2.d: Likewise.
	* gas/cfi-sframe/common-empty-3.d: Likewise.
---
 gas/gen-sframe.c                                         | 9 +++++++--
 gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-1.d      | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-2.d      | 2 +-
 .../gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d     | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d       | 2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-1.d            | 2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-2.d            | 2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-3.d            | 2 +-
 16 files changed, 22 insertions(+), 17 deletions(-)
  

Patch

diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
index b0bf514be75..7fca83bd610 100644
--- a/gas/gen-sframe.c
+++ b/gas/gen-sframe.c
@@ -278,7 +278,10 @@  sframe_v1_set_func_info (unsigned int fde_type, unsigned int fre_type,
 static void
 sframe_set_version (uint32_t sframe_version ATTRIBUTE_UNUSED)
 {
-  sframe_ver_ops.format_version = SFRAME_VERSION_1;
+  sframe_ver_ops.format_version = SFRAME_VERSION_2;
+
+  /* These operations remain the same for SFRAME_VERSION_2 as fre_info and
+     func_info have not changed from SFRAME_VERSION_1.  */
 
   sframe_ver_ops.set_fre_info = sframe_v1_set_fre_info;
 
@@ -605,6 +608,8 @@  output_sframe_funcdesc (symbolS *start_of_fre_section,
 #else
   out_one (func_info);
 #endif
+  out_one (0);
+  out_two (0);
 }
 
 static void
@@ -1355,7 +1360,7 @@  output_sframe (segT sframe_seg)
   (void) sframe_seg;
 
   /* Setup the version specific access functions.  */
-  sframe_set_version (SFRAME_VERSION_1);
+  sframe_set_version (SFRAME_VERSION_2);
 
   /* Process all fdes and create SFrame stack trace information.  */
   create_sframe_all ();
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-1.d
index aeefbc9cdef..8ae46217117 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-1.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-1.d
@@ -5,7 +5,7 @@ 
 Contents of the SFrame section .sframe:
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 3
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-2.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-2.d
index 985f51fcda9..b7834d53b07 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-2.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-2.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 2
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
index 666a94101ab..599d4c4e795 100644
--- 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
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 2
     Num FREs: 6
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d
index 7d97383bb90..32577f31860 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 1
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d
index fc7d5c440db..3e3f74dbe42 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 1
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d
index 95954508e3d..6430d463a89 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 1
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d
index b835980ecbd..319ff96cce2 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 3
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d
index d2bef7507c2..82d34973ddd 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 3
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d
index f915ac5f234..fe6917c7080 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 3
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d
index cab19d5bc25..39724d9cdf1 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 3
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d
index c0a4a8de250..c0a0e627fad 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 2
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d
index bba3b5920f1..ae36c21b3b7 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 1
     Num FREs: 4
diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-1.d b/gas/testsuite/gas/cfi-sframe/common-empty-1.d
index 0b09799826c..141922517f0 100644
--- a/gas/testsuite/gas/cfi-sframe/common-empty-1.d
+++ b/gas/testsuite/gas/cfi-sframe/common-empty-1.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 0
     Num FREs: 0
diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-2.d b/gas/testsuite/gas/cfi-sframe/common-empty-2.d
index e566c078249..ab8de0b8afa 100644
--- a/gas/testsuite/gas/cfi-sframe/common-empty-2.d
+++ b/gas/testsuite/gas/cfi-sframe/common-empty-2.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 0
     Num FREs: 0
diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-3.d b/gas/testsuite/gas/cfi-sframe/common-empty-3.d
index f7a6062d392..df0b19ee1bd 100644
--- a/gas/testsuite/gas/cfi-sframe/common-empty-3.d
+++ b/gas/testsuite/gas/cfi-sframe/common-empty-3.d
@@ -6,7 +6,7 @@  Contents of the SFrame section .sframe:
 
   Header :
 
-    Version: SFRAME_VERSION_1
+    Version: SFRAME_VERSION_2
     Flags: NONE
     Num FDEs: 0
     Num FREs: 0