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 4/5] bfd: use "stack trace" instead of "unwind" for SFrame
Date: Tue, 31 Jan 2023 15:34:28 -0800	[thread overview]
Message-ID: <20230131233429.3708328-5-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20230131233429.3708328-1-indu.bhagat@oracle.com>

SFrame format is meant for generating stack traces only.

bfd/
	* elf-bfd.h: Replace the use of "unwind" with "stack trace".
	* elf-sframe.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elfxx-x86.c: Likewise.

include/
	* elf/common.h: Likewise.
---
 bfd/elf-bfd.h        |  2 +-
 bfd/elf-sframe.c     | 11 ++++++-----
 bfd/elf64-x86-64.c   |  2 +-
 bfd/elfxx-x86.c      |  8 ++++----
 include/elf/common.h |  2 +-
 5 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 2b7c574f540..dff19822547 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -702,7 +702,7 @@ struct elf_link_hash_table
   /* Used by eh_frame code when editing .eh_frame.  */
   struct eh_frame_hdr_info eh_info;
 
-  /* Used to link unwind data in .sframe sections.  */
+  /* Used to link stack trace info in .sframe sections.  */
   struct sframe_enc_info sfe_info;
 
   /* A linked list of local symbols to be added to .dynsym.  */
diff --git a/bfd/elf-sframe.c b/bfd/elf-sframe.c
index 8a7fd021931..d2954ba9193 100644
--- a/bfd/elf-sframe.c
+++ b/bfd/elf-sframe.c
@@ -206,7 +206,7 @@ _bfd_elf_parse_sframe (bfd *abfd,
       return false;
     }
 
-  /* Read the SFrame unwind information from abfd.  */
+  /* Read the SFrame stack trace information from abfd.  */
   if (!bfd_malloc_and_get_section (abfd, sec, &sfbuf))
     goto fail_no_free;
 
@@ -438,10 +438,11 @@ _bfd_elf_merge_section_sframe (bfd *abfd,
 		}
 	      else
 		{
-		  /* Expected to land here for SFrame unwind info as created
-		     for the .plt* sections.  These sections can have upto two
-		     FDE entries.  Although the code should work for > 2,
-		     leaving this assert here for safety.  */
+		  /* Expected to land here when SFrame stack trace info is
+		     created dynamically for the .plt* sections.  These
+		     sections are expected to have upto two SFrame FDE entries.
+		     Although the code should work for > 2,  leaving this
+		     assert here for safety.  */
 		  BFD_ASSERT (num_fidx <= 2);
 		  /* For the first entry, we know the offset of the SFrame FDE's
 		     sfde_func_start_address.  Side note: see how the value
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 914f82d0151..5f89190a6a0 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -895,7 +895,7 @@ static const struct elf_x86_sframe_plt elf_x86_64_sframe_plt =
   { &elf_x86_64_sframe_pltn_fre1, &elf_x86_64_sframe_pltn_fre2 },
   NON_LAZY_PLT_ENTRY_SIZE,
   1, /* Number of FREs for PLTn for second PLT.  */
-  /* FREs for second plt ( unwind info for .plt.got is
+  /* FREs for second plt (stack trace info for .plt.got is
      identical).  Used when IBT or non-lazy PLT is in effect.  */
   { &elf_x86_64_sframe_sec_pltn_fre1 }
 };
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 42af84b8e04..132fb791ac6 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -1804,7 +1804,7 @@ enum dynobj_sframe_plt_type
   SFRAME_PLT_SEC = 2
 };
 
-/* Create SFrame unwind info for the plt entries in the .plt section
+/* Create SFrame stack trace info for the plt entries in the .plt section
    of type PLT_SEC_TYPE.  */
 
 static bool
@@ -1819,7 +1819,7 @@ _bfd_x86_elf_create_sframe_plt (bfd *output_bfd,
   unsigned int plt0_entry_size;
   unsigned char func_info;
   unsigned int fre_type;
-  /* The dynamic plt section for which .sframe unwind information is being
+  /* The dynamic plt section for which .sframe stack trace information is being
      created.  */
   asection *dpltsec;
 
@@ -1832,7 +1832,7 @@ _bfd_x86_elf_create_sframe_plt (bfd *output_bfd,
 
   bed = get_elf_backend_data (output_bfd);
   htab = elf_x86_hash_table (info, bed->target_id);
-  /* Whether SFrame unwind info for plt0 is to be generated.  */
+  /* Whether SFrame stack trace info for plt0 is to be generated.  */
   plt0_generated_p = htab->plt.has_plt0;
   plt0_entry_size
     = (plt0_generated_p) ? htab->sframe_plt->plt0_entry_size : 0;
@@ -1906,7 +1906,7 @@ _bfd_x86_elf_create_sframe_plt (bfd *output_bfd,
       /* pltn entries use an SFrame FDE of type
 	 SFRAME_FDE_TYPE_PCMASK to exploit the repetitive
 	 pattern of the instructions in these entries.  Using this SFrame FDE
-	 type helps in keeping the unwind information for pltn entries
+	 type helps in keeping the SFrame stack trace info for pltn entries
 	 compact.  */
       func_info	= sframe_fde_create_func_info (fre_type,
 					       SFRAME_FDE_TYPE_PCMASK);
diff --git a/include/elf/common.h b/include/elf/common.h
index bb93123d14a..d19d6f9927d 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -489,7 +489,7 @@
 #define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
 #define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
 #define PT_GNU_PROPERTY	(PT_LOOS + 0x474e553) /* GNU property */
-#define PT_GNU_SFRAME	(PT_LOOS + 0x474e554) /* SFrame unwind information */
+#define PT_GNU_SFRAME	(PT_LOOS + 0x474e554) /* SFrame stack trace information */
 
 /* OpenBSD segment types.  */
 #define PT_OPENBSD_RANDOMIZE (PT_LOOS + 0x5a3dbe6)  /* Fill with random data.  */
-- 
2.39.0


  parent reply	other threads:[~2023-01-31 23:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 23:34 [PATCH 0/5] Reword to reflect SFrame is a stack trace format Indu Bhagat
2023-01-31 23:34 ` [PATCH 1/5] libsframe/doc: use "stack trace" instead of "unwind" for SFrame Indu Bhagat
2023-01-31 23:34 ` [PATCH 2/5] sframe: " Indu Bhagat
2023-01-31 23:34 ` [PATCH 3/5] gas: " Indu Bhagat
2023-01-31 23:34 ` Indu Bhagat [this message]
2023-01-31 23:34 ` [PATCH 5/5] ld/doc: " Indu Bhagat
2023-02-01  9:42 ` [PATCH 0/5] Reword to reflect SFrame is a stack trace format Nick Clifton

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=20230131233429.3708328-5-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).