[V3 33/36] [SFrame-V3] include: libsframe: remove SFRAME_F_FRAME_POINTER flag

Indu Bhagat indu.bhagat@oracle.com
Tue Jan 13 11:12:37 GMT 2026


SFrame V3 has 8 precious flag bits, two of which are being used.  More
flag byte (s) can be added to the auxiliary header when it comes to
that.  But for now, it may be worthwhile to use the 8-bits frugally.

SFRAME_F_FRAME_POINTER flag bit was added with the intention of marking
binaries built with frame-pointer preserved.  A stack tracer could then
use this (deterministic) information if necessary.  But such a marking
of binary will ideally be done by the linker, and at the moment adding
such a framework is not justified for such small gain.  The outcome of
this is that SFRAME_F_FRAME_POINTER is never set in SFrame V2 binaries.

Remove the definition SFRAME_F_FRAME_POINTER for SFrame V3.  The
relinquished bit can be used when reading/dumping SFrame V2 sections are
no longer supported by consumers.  Changing the values of existing flags
like SFRAME_F_FDE_FUNC_START_PCREL is being done for V3, to avoid
version-specific flag bit reading (albeit doable) in consumers.

Related changes to the specification are done in a subsequent commit.

include/
	* sframe.h (SFRAME_V3_F_ALL_FLAGS): Remove
	SFRAME_F_FRAME_POINTER from the set of V3 flags.
libsframe/
	* sframe-dump.c (dump_sframe_header_flags): Add a comment for
	clarity.

---
[New in V2]

[Changes in V3]
  - Conditionalize PRINT_FLAG for SFRAME_F_FRAME_POINTER.
    SFRAME_F_FRAME_POINTER is not expected for V3 and above [Indu].
[End of changes in V3]
---
 include/sframe.h        | 3 +--
 libsframe/sframe-dump.c | 9 ++++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/sframe.h b/include/sframe.h
index 07565e167d6..aea589e8704 100644
--- a/include/sframe.h
+++ b/include/sframe.h
@@ -100,8 +100,7 @@ extern "C"
 
 /* Set of all defined flags in SFrame V3.  */
 #define SFRAME_V3_F_ALL_FLAGS \
-  (SFRAME_F_FDE_SORTED | SFRAME_F_FRAME_POINTER \
-   | SFRAME_F_FDE_FUNC_START_PCREL)
+  (SFRAME_F_FDE_SORTED | SFRAME_F_FDE_FUNC_START_PCREL)
 
 #define SFRAME_CFA_FIXED_FP_INVALID 0
 #define SFRAME_CFA_FIXED_RA_INVALID 0
diff --git a/libsframe/sframe-dump.c b/libsframe/sframe-dump.c
index b09e67f050b..cd538564f8e 100644
--- a/libsframe/sframe-dump.c
+++ b/libsframe/sframe-dump.c
@@ -143,10 +143,11 @@ sframe_s390x_offset_decode_regnum (int32_t offset, uint8_t ver)
 static void
 dump_sframe_header_flags (const sframe_decoder_ctx *sfd_ctx)
 {
-  uint8_t flags;
   const char *prefix = "Flags: ";
 
-  flags = sframe_decoder_get_flags (sfd_ctx);
+  uint8_t ver = sframe_decoder_get_version (sfd_ctx);
+  uint8_t flags = sframe_decoder_get_flags (sfd_ctx);
+
   if (!flags)
     {
       printf ("%11sNONE\n", prefix);
@@ -161,7 +162,9 @@ dump_sframe_header_flags (const sframe_decoder_ctx *sfd_ctx)
     }
 
   PRINT_FLAG (SFRAME_F_FDE_SORTED);
-  PRINT_FLAG (SFRAME_F_FRAME_POINTER);
+  /* SFRAME_F_FRAME_POINTER has been removed from SFrame V3 and beyond.  */
+  if (ver == SFRAME_VERSION_2)
+    PRINT_FLAG (SFRAME_F_FRAME_POINTER);
   PRINT_FLAG (SFRAME_F_FDE_FUNC_START_PCREL);
 #undef PRINT_FLAG
 
-- 
2.43.0



More information about the Binutils mailing list