From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [PATCH 4/6] [4/6] libsframe: provide new access API for mangled RA bit
Date: Wed, 14 Dec 2022 11:58:57 -0800 [thread overview]
Message-ID: <20221214195859.1233809-5-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20221214195859.1233809-1-indu.bhagat@oracle.com>
include/ChangeLog:
* sframe-api.h (sframe_fre_get_ra_mangled_p): New declaration.
ChangeLog:
* libsframe/sframe.c (sframe_get_fre_ra_mangled_p): New
definition.
(sframe_fre_get_ra_mangled_p): New static function.
---
include/sframe-api.h | 7 +++++++
libsframe/sframe.c | 18 ++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/include/sframe-api.h b/include/sframe-api.h
index 0a86389857c..3338a2ebd5c 100644
--- a/include/sframe-api.h
+++ b/include/sframe-api.h
@@ -21,6 +21,7 @@
#define _SFRAME_API_H
#include <sframe.h>
+#include <stdbool.h>
#ifdef __cplusplus
extern "C"
@@ -180,6 +181,12 @@ extern int32_t
sframe_fre_get_ra_offset (sframe_decoder_ctx *dctx,
sframe_frame_row_entry *fre, int *errp);
+/* Get whether the RA is mangled. */
+
+extern bool
+sframe_fre_get_ra_mangled_p (sframe_decoder_ctx *dctx,
+ sframe_frame_row_entry *fre, int *errp);
+
/* The SFrame Encoder. */
/* Create an encoder context with the given SFrame format version VER, FLAGS
diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index d4eaaee2297..ef821da3901 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -124,6 +124,12 @@ sframe_fre_get_offset_size (unsigned char fre_info)
return SFRAME_V1_FRE_OFFSET_SIZE (fre_info);
}
+static bool
+sframe_get_fre_ra_mangled_p (unsigned char fre_info)
+{
+ return SFRAME_V1_FRE_MANGLED_RA_P (fre_info);
+}
+
/* Access functions for info from function descriptor entry. */
static unsigned int
@@ -640,6 +646,18 @@ sframe_fre_get_ra_offset (sframe_decoder_ctx *dctx,
return sframe_get_fre_offset (fre, SFRAME_FRE_RA_OFFSET_IDX, errp);
}
+/* Get whether the RA is mangled. */
+
+bool
+sframe_fre_get_ra_mangled_p (sframe_decoder_ctx *dctx ATTRIBUTE_UNUSED,
+ sframe_frame_row_entry *fre, int *errp)
+{
+ if (fre == NULL || !sframe_fre_sanity_check_p (fre))
+ return sframe_set_errno (errp, SFRAME_ERR_FRE_INVAL);
+
+ return sframe_get_fre_ra_mangled_p (fre->fre_info);
+}
+
static int
sframe_frame_row_entry_copy (sframe_frame_row_entry *dst, sframe_frame_row_entry *src)
{
--
2.37.2
next prev parent reply other threads:[~2022-12-14 19:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 19:58 [PATCH 0/6] SFrame: support for .cfi_negate_ra_state in aarch64 Indu Bhagat
2022-12-14 19:58 ` [PATCH 1/6] [1/6] sframe.h: add support for .cfi_negate_ra_state Indu Bhagat
2022-12-14 19:58 ` [PATCH 2/6] [2/6] gas: sframe: " Indu Bhagat
2022-12-14 19:58 ` [PATCH 3/6] [3/6] gas: sframe: testsuite: add testcase " Indu Bhagat
2022-12-14 19:58 ` Indu Bhagat [this message]
2022-12-14 19:58 ` [PATCH 5/6] [5/6] objdump/readelf: sframe: emit marker for FREs with mangled RA Indu Bhagat
2022-12-14 19:58 ` [PATCH 6/6] [6/6] sframe: doc: update spec for the mangled-RA bit in FRE Indu Bhagat
2022-12-16 16:39 ` [PATCH 0/6] SFrame: support for .cfi_negate_ra_state in aarch64 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=20221214195859.1233809-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).