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: [COMMITTED, V2 4/6] objdump/readelf: sframe: emit marker for FREs with mangled RA
Date: Fri, 16 Dec 2022 22:41:26 -0800	[thread overview]
Message-ID: <20221217064128.11326-5-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20221217064128.11326-1-indu.bhagat@oracle.com>

[Chnages in V2]
  - Emit "[s]" marker also when return address is in a register.
[End of changes in V2]

In the textual dump of the SFrame section, when an SFrame FRE recovers a
mangled RA, use string "[s]" in the output to indicate that the return
address is a signed (mangled) one.

ChangeLog:

        * libsframe/sframe-dump.c (dump_sframe_func_with_fres): Postfix
	with "[s]" if RA is signed with authorization code.
---
 libsframe/sframe-dump.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libsframe/sframe-dump.c b/libsframe/sframe-dump.c
index 5b063c9962d..5f778bee338 100644
--- a/libsframe/sframe-dump.c
+++ b/libsframe/sframe-dump.c
@@ -116,7 +116,7 @@ dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
   char temp[100];
   memset (temp, 0, 100);
 
-  printf ("\n    %-7s%-8s %-10s%-10s%-10s", "STARTPC", fde_type_marker, "CFA", "FP", "RA");
+  printf ("\n    %-7s%-8s %-10s%-10s%-13s", "STARTPC", fde_type_marker, "CFA", "FP", "RA");
   for (j = 0; j < num_fres; j++)
     {
       sframe_decoder_get_fre (sfd_ctx, funcidx, j, &fre);
@@ -152,7 +152,14 @@ dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
 	sprintf (temp, "c%+d", ra_offset);
       else
 	strcpy (temp, "u");
-      printf ("%-10s", temp);
+      /* Mark SFrame FRE's RA information with "[s]" if the RA is mangled
+	 with signature bits.  */
+      const char *ra_mangled_p_str
+	= ((sframe_fre_get_ra_mangled_p (sfd_ctx, &fre, &err[2]))
+	   ? "[s]" : "   ");
+      size_t ra_mangled_p_str_size = strlen (ra_mangled_p_str);
+      strncat (temp, ra_mangled_p_str, ra_mangled_p_str_size);
+      printf ("%-13s", temp);
     }
 }
 
-- 
2.37.2


  parent reply	other threads:[~2022-12-17  6:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  6:41 [COMMITTED, V2 0/6] SFrame: support for .cfi_negate_ra_state in aarch64 Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 1/6] sframe.h: add support for .cfi_negate_ra_state Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 2/6] gas: sframe: " Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 3/6] libsframe: provide new access API for mangled RA bit Indu Bhagat
2022-12-17  6:41 ` Indu Bhagat [this message]
2022-12-17  6:41 ` [COMMITTED, V2 5/6] gas: sframe: testsuite: add testcase for .cfi_negate_ra_state Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 6/6] sframe: doc: update spec for the mangled-RA bit in FRE 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=20221217064128.11326-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).