[binutils-gdb] gas: libsframe: use SFRAME_V2_* macro where available

Indu Bhagat ibhagat@sourceware.org
Wed Dec 24 08:43:18 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d1a0fa4704be9fd6d920a9ccb93c4d8d68542371

commit d1a0fa4704be9fd6d920a9ccb93c4d8d68542371
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Wed Dec 24 00:42:14 2025 -0800

    gas: libsframe: use SFRAME_V2_* macro where available
    
    No functional change.
    
    Reviewed-by: Jens Remus <jremus@linux.ibm.com>
    
    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_fre_check_range_p): Likewise.
            (sframe_fde_create_func_info): Likewise.

Diff:
---
 gas/sframe-opt.c        | 12 ++++++------
 libsframe/sframe-dump.c | 11 +++++------
 libsframe/sframe.c      | 18 +++++++++---------
 3 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/gas/sframe-opt.c b/gas/sframe-opt.c
index 6787ca562b1..41d54d16438 100644
--- a/gas/sframe-opt.c
+++ b/gas/sframe-opt.c
@@ -104,7 +104,7 @@ sframe_convert_frag (fragS *frag)
   offsetT value;
 
   offsetT rest_of_data;
-  uint8_t fde_type, fre_type;
+  uint8_t fde_pc_type, fre_type;
   uint8_t pauth_key;
 
   expressionS *exp;
@@ -128,9 +128,9 @@ 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);
-      gas_assert (fde_type == SFRAME_FDE_TYPE_PCINC);
+      fde_pc_type = SFRAME_V2_FUNC_PC_TYPE (rest_of_data);
+      pauth_key = SFRAME_V2_FUNC_PAUTH_KEY (rest_of_data);
+      gas_assert (fde_pc_type == SFRAME_FDE_TYPE_PCINC);
 
       /* Calculate the applicable fre_type.  */
       fsizeS = exp->X_op_symbol;
@@ -143,8 +143,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_pc_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..763ff8144df 100644
--- a/libsframe/sframe-dump.c
+++ b/libsframe/sframe-dump.c
@@ -156,10 +156,9 @@ 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)
-			     == SFRAME_FDE_TYPE_PCMASK);
-  const char *fde_type_marker
-    = (fde_type_addrmask_p ? "[m]" : "   ");
+  int pc_mask_p
+    = (SFRAME_V2_FUNC_PC_TYPE (func_info) == SFRAME_FDE_TYPE_PCMASK);
+  const char *fde_type_marker = (pc_mask_p ? "[m]" : "   ");
 
   printf ("\n    func idx [%d]: pc = 0x%"PRIx64 ", size = %d bytes",
 	  funcidx,
@@ -167,7 +166,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];
@@ -178,7 +177,7 @@ dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
     {
       sframe_decoder_get_fre (sfd_ctx, funcidx, j, &fre);
 
-      fre_start_pc_vma = (fde_type_addrmask_p
+      fre_start_pc_vma = (pc_mask_p
 			  ? fre.fre_start_addr
 			  : func_start_pc_vma + fre.fre_start_addr);
 
diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index 1252cac9c8c..d85b53142c7 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -209,17 +209,17 @@ 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;
 }
 
 static uint32_t
-sframe_get_fde_type (sframe_func_desc_entry_int *fdep)
+sframe_get_fde_pc_type (sframe_func_desc_entry_int *fdep)
 {
-  uint32_t fde_type = 0;
+  uint32_t fde_pc_type = 0;
   if (fdep)
-    fde_type = SFRAME_V1_FUNC_FDE_TYPE (fdep->func_info);
-  return fde_type;
+    fde_pc_type = SFRAME_V2_FUNC_PC_TYPE (fdep->func_info);
+  return fde_pc_type;
 }
 
 /* Check if flipping is needed, based on ENDIAN.  */
@@ -509,15 +509,15 @@ sframe_fre_check_range_p (sframe_decoder_ctx *dctx, uint32_t func_idx,
   sframe_func_desc_entry_int *fdep;
   int32_t func_start_pc_offset;
   uint8_t rep_block_size;
-  uint32_t fde_type;
+  uint32_t pc_type;
   uint32_t pc_offset;
   bool mask_p;
 
   fdep = &dctx->sfd_funcdesc->entry[func_idx];
   func_start_pc_offset = sframe_decoder_get_secrel_func_start_addr (dctx,
 								    func_idx);
-  fde_type = sframe_get_fde_type (fdep);
-  mask_p = (fde_type == SFRAME_FDE_TYPE_PCMASK);
+  pc_type = sframe_get_fde_pc_type (fdep);
+  mask_p = (pc_type == SFRAME_FDE_TYPE_PCMASK);
   rep_block_size = fdep->func_rep_size;
 
   if (func_start_pc_offset > pc)
@@ -807,7 +807,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;
 }


More information about the Binutils-cvs mailing list