[07/13] gas: libsframe: use SFRAME_V2_* macro where available

Message ID 20251202073414.200246-8-indu.bhagat@oracle.com
State New
Headers
Series sframe: some refactoring and misc improvements |

Commit Message

Indu Bhagat Dec. 2, 2025, 7:34 a.m. UTC
  No functional change.

gas/
        * sframe-opt.c (sframe_convert_frag): Use SFRAME_V2_
	prefixed macro instead.
libsframe/
	* sframe-dump.c (dump_sframe_func_with_fres): Likewise.
        * sframe.c (sframe_get_fre_type): Likewise.
        (sframe_get_fde_type): Likewise.
        (sframe_fde_create_func_info): Likewise.
---
 gas/sframe-opt.c        | 8 ++++----
 libsframe/sframe-dump.c | 4 ++--
 libsframe/sframe.c      | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)
  

Patch

diff --git a/gas/sframe-opt.c b/gas/sframe-opt.c
index 65520734828..690617fab44 100644
--- a/gas/sframe-opt.c
+++ b/gas/sframe-opt.c
@@ -116,8 +116,8 @@  sframe_convert_frag (fragS *frag)
 	 the fre_type.  */
       dataS = exp->X_add_symbol;
       rest_of_data = (symbol_get_value_expression(dataS))->X_add_number;
-      fde_type = SFRAME_V1_FUNC_FDE_TYPE (rest_of_data);
-      pauth_key = SFRAME_V1_FUNC_PAUTH_KEY (rest_of_data);
+      fde_type = SFRAME_V2_FUNC_FDE_TYPE (rest_of_data);
+      pauth_key = SFRAME_V2_FUNC_PAUTH_KEY (rest_of_data);
       gas_assert (fde_type == SFRAME_FDE_TYPE_PCINC);
 
       /* Calculate the applicable fre_type.  */
@@ -131,8 +131,8 @@  sframe_convert_frag (fragS *frag)
 	fre_type = SFRAME_FRE_TYPE_ADDR4;
 
       /* Create the new function info.  */
-      value = SFRAME_V1_FUNC_INFO (fde_type, fre_type);
-      value = SFRAME_V1_FUNC_INFO_UPDATE_PAUTH_KEY (pauth_key, value);
+      value = SFRAME_V2_FUNC_INFO (fde_type, fre_type);
+      value = SFRAME_V2_FUNC_INFO_UPDATE_PAUTH_KEY (pauth_key, value);
 
       frag->fr_literal[frag->fr_fix] = value;
     }
diff --git a/libsframe/sframe-dump.c b/libsframe/sframe-dump.c
index a1a67e98fe6..dc856cd1356 100644
--- a/libsframe/sframe-dump.c
+++ b/libsframe/sframe-dump.c
@@ -156,7 +156,7 @@  dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
 
   /* Mark FDEs with [m] where the FRE start address is interpreted as a
      mask.  */
-  int fde_type_addrmask_p = (SFRAME_V1_FUNC_FDE_TYPE (func_info)
+  int fde_type_addrmask_p = (SFRAME_V2_FUNC_FDE_TYPE (func_info)
 			     == SFRAME_FDE_TYPE_PCMASK);
   const char *fde_type_marker
     = (fde_type_addrmask_p ? "[m]" : "   ");
@@ -167,7 +167,7 @@  dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
 	  func_size);
 
   if (is_sframe_abi_arch_aarch64 (sfd_ctx)
-      && (SFRAME_V1_FUNC_PAUTH_KEY (func_info) == SFRAME_AARCH64_PAUTH_KEY_B))
+      && (SFRAME_V2_FUNC_PAUTH_KEY (func_info) == SFRAME_AARCH64_PAUTH_KEY_B))
     printf (", pauth = B key");
 
   char temp[100];
diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index 8c4159e27b5..16fc3a3f11b 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -209,7 +209,7 @@  sframe_get_fre_type (sframe_func_desc_entry_int *fdep)
 {
   uint32_t fre_type = 0;
   if (fdep)
-    fre_type = SFRAME_V1_FUNC_FRE_TYPE (fdep->func_info);
+    fre_type = SFRAME_V2_FUNC_FRE_TYPE (fdep->func_info);
   return fre_type;
 }
 
@@ -218,7 +218,7 @@  sframe_get_fde_type (sframe_func_desc_entry_int *fdep)
 {
   uint32_t fde_type = 0;
   if (fdep)
-    fde_type = SFRAME_V1_FUNC_FDE_TYPE (fdep->func_info);
+    fde_type = SFRAME_V2_FUNC_FDE_TYPE (fdep->func_info);
   return fde_type;
 }
 
@@ -806,7 +806,7 @@  sframe_fde_create_func_info (uint32_t fre_type,
 		   || fre_type == SFRAME_FRE_TYPE_ADDR4);
   sframe_assert (fde_type == SFRAME_FDE_TYPE_PCINC
 		    || fde_type == SFRAME_FDE_TYPE_PCMASK);
-  func_info = SFRAME_V1_FUNC_INFO (fde_type, fre_type);
+  func_info = SFRAME_V2_FUNC_INFO (fde_type, fre_type);
   return func_info;
 }