public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Indu Bhagat <indu.bhagat@oracle.com>
To: gnu-gabi@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [PATCH] Add PT_GNU_SFRAME segment
Date: Mon, 23 Jan 2023 11:56:19 -0800	[thread overview]
Message-ID: <20230123195619.16513-1-indu.bhagat@oracle.com> (raw)

Hello,

As advised by Florian on libc-alpha, here is a patch to add PT_GNU_SFRAME to
the list of p_type values.

As I submit this patch, I am reminded of my ongoing unease with using the
keyword "unwind information" with SFrame format. SFrame format, is the Simple
Frame format, which represents the minimal necessary information for
backtracing:
  - Canonical Frame Address (CFA)
  - Frame Pointer (FP)
  - Return Address (RA)
As such, one can argue that there is a clear distinction between "backtrace"
(=simple call trace) and "unwind"(=stack walk + recover state/regs). 

What do you think will the "correct" terminology here (if there is one) ?
Simple Frame format is for backtracing only, but calling it a "backtrace
format" also sounds off. May be "backtracing format" ? Simple Frame, SFrame,
  backtracing format...

Thoughts?

Thanks
Indu

---
 program-loading-and-dynamic-linking.txt | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/program-loading-and-dynamic-linking.txt b/program-loading-and-dynamic-linking.txt
index a07c195..9148486 100644
--- a/program-loading-and-dynamic-linking.txt
+++ b/program-loading-and-dynamic-linking.txt
@@ -129,6 +129,19 @@ PT_GNU_PROPERTY  0x6474e553
 
   Reference: https://raw.githubusercontent.com/wiki/hjl-tools/linux-abi/linux-abi-draft.pdf
 
+PT_GNU_SFRAME    0x6474e554
+
+  Segment contains the SFrame section (Simple Frame format unwind information).
+
+  NOTE: The virtual address range referred to by PT_GNU_SFRAME must be covered
+  by a PT_LOAD entry - PT_GNU_SFRAME on its own does not trigger the
+  mapping/loading of any data.
+
+  The contents of the SFrame section are described in the binutils
+  documentation.  As of 2.40:
+
+  https://sourceware.org/binutils/docs/sframe-spec.html
+
 There are further extensions to p_type but currently they are all
 architecture specific and should be documented in the relevant ABIs.
 
-- 
2.39.0


             reply	other threads:[~2023-01-23 19:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 19:56 Indu Bhagat [this message]
2023-01-24 11:13 ` Mark Wielaard
2023-01-24 13:10   ` Carlos O'Donell
2023-01-24 13:20   ` Florian Weimer
2023-01-24 14:57     ` Carlos O'Donell
2023-01-24 21:52       ` 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=20230123195619.16513-1-indu.bhagat@oracle.com \
    --to=indu.bhagat@oracle.com \
    --cc=gnu-gabi@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).