public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [PATCH 11/12] doc: sframe: add details about alignment in the SFrame format
Date: Tue, 27 Jun 2023 14:20:27 -0700	[thread overview]
Message-ID: <20230627212028.2138604-12-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20230627212028.2138604-1-indu.bhagat@oracle.com>

A portion of the SFrame stack trace format has an unaligned on-disk
representation.  Add description at relevant points in the specification
to clarify the alignment related details.
---
 libsframe/doc/sframe-spec.texi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libsframe/doc/sframe-spec.texi b/libsframe/doc/sframe-spec.texi
index 68f465e2aa7..8a59aa76f52 100644
--- a/libsframe/doc/sframe-spec.texi
+++ b/libsframe/doc/sframe-spec.texi
@@ -77,6 +77,11 @@ a new segment of its own, PT_GNU_SFRAME.
 The SFrame format is currently supported only for select ABIs, namely, AMD64
 and AAPCS64.
 
+A portion of the SFrame format follows an unaligned on-disk representation.
+Some data structures, however, (namely the SFrame header and the SFrame
+function descriptor entry) have elements at their natural boundaries.  All data
+structures are packed, unless otherwise stated.
+
 The contents of the SFrame section are stored in the target endianness, i.e.,
 in the endianness of the system on which the section is targetted to be used.
 An SFrame section reader may use the magic number in the SFrame header to
@@ -147,6 +152,8 @@ typedef struct sframe_preamble
 @} ATTRIBUTE_PACKED sframe_preamble;
 @end example
 
+Every element of the SFrame preamble is naturally aligned.
+
 All values are stored in the endianness of the target system for which the
 SFrame section is intended.  Further details:
 
@@ -258,6 +265,8 @@ typedef struct sframe_header
 @} ATTRIBUTE_PACKED sframe_header;
 @end example
 
+Every element of the SFrame header is naturally aligned.
+
 The sub-section offsets, namely @code{sfh_fdeoff} and @code{sfh_freoff}, in the
 SFrame header are relative to the @emph{end} of the SFrame header; they are
 each an offset in bytes into the SFrame section where the SFrame FDE
@@ -384,6 +393,8 @@ typedef struct sframe_func_desc_entry
 @} ATTRIBUTE_PACKED sframe_func_desc_entry;
 @end example
 
+Every element of the SFrame function descriptor entry is naturally aligned.
+
 @code{sfde_func_start_fre_off} is the offset to the first SFrame FRE for the
 function.  This offset is relative to the @emph{end of the SFrame FDE}
 sub-section (unlike the offsets in the SFrame header, which are relative to the
@@ -608,6 +619,11 @@ typedef struct sframe_frame_row_entry_addr4
 @} ATTRIBUTE_PACKED sframe_frame_row_entry_addr4;
 @end example
 
+For ensuring compactness, SFrame frame row entries are stored unaligned on
+disk.  Appropriate mechanisms need to be employed, as necessary, by the
+serializing and deserializing entities, if unaligned accesses need to be
+avoided.
+
 @code{sfre_start_address} is an unsigned 8-bit/16-bit/32-bit integral field
 identifies the start address of the range of program counters, for which the
 SFrame FRE applies.  The value encoded in the @code{sfre_start_address} field
-- 
2.39.2


  parent reply	other threads:[~2023-06-27 21:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 21:20 [PATCH 00/12] SFrame Version 2 - definition and support Indu Bhagat
2023-06-27 21:20 ` [PATCH 01/12] sframe.h: format bump to SFrame version 2 Indu Bhagat
2023-06-27 21:20 ` [PATCH 02/12] gas: generate SFrame section with version SFRAME_VERSION_2 Indu Bhagat
2023-06-27 21:20 ` [PATCH 03/12] libsframe: add new APIs to get SFrame version Indu Bhagat
2023-06-27 21:20 ` [PATCH 04/12] libsframe: add new APIs to add and get SFrame FDE in SFrame version 2 Indu Bhagat
2023-06-27 21:20 ` [PATCH 05/12] libsframe: adjust version check in sframe_header_sanity_check_p Indu Bhagat
2023-06-27 21:20 ` [PATCH 06/12] libsframe: testsuite: fixes for SFRAME_VERSION_2 Indu Bhagat
2023-06-27 21:20 ` [PATCH 07/12] bfd: linker: add support for rep_block_size for pltN entries Indu Bhagat
2023-06-27 21:20 ` [PATCH 08/12] bfd: linker: generate SFrame sections with version SFRAME_VERSION_2 Indu Bhagat
2023-06-27 21:20 ` [PATCH 09/12] objdump/readelf: adjust for SFRAME_VERSION_2 Indu Bhagat
2023-06-28 23:04   ` Hans-Peter Nilsson
2023-06-29  6:41     ` Indu Bhagat
2023-06-27 21:20 ` [PATCH 10/12] doc: sframe: update specification " Indu Bhagat
2023-06-27 21:20 ` Indu Bhagat [this message]
2023-06-27 21:20 ` [PATCH 12/12] binutils/NEWS: announce SFrame version 2 as the new default Indu Bhagat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230627212028.2138604-12-indu.bhagat@oracle.com \
    --to=indu.bhagat@oracle.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).