From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: weimin.pan@oracle.com, Indu Bhagat <indu.bhagat@oracle.com>
Subject: [PATCH 5/6] libsframe: rename API sframe_fde_func_info to sframe_fde_create_func_info
Date: Wed, 7 Dec 2022 11:52:21 -0800 [thread overview]
Message-ID: <20221207195222.1182788-6-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20221207195222.1182788-1-indu.bhagat@oracle.com>
The new name better reflects the purpose of the function.
ChangeLog:
* bfd/elfxx-x86.c (_bfd_x86_elf_create_sframe_plt): Use new
name.
* libsframe/sframe.c (sframe_fde_create_func_info): Rename
sframe_fde_func_info to this.
* libsframe/testsuite/libsframe.encode/encode-1.c: Use new name.
include/ChangeLog:
* sframe-api.h (sframe_fde_create_func_info): Rename
sframe_fde_func_info to this.
---
bfd/elfxx-x86.c | 6 +++---
include/sframe-api.h | 4 ++--
libsframe/sframe.c | 6 +++---
libsframe/testsuite/libsframe.encode/encode-1.c | 8 ++++----
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index bbf868826e5..88c34d397a8 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -1857,8 +1857,7 @@ _bfd_x86_elf_create_sframe_plt (bfd *output_bfd,
/* FRE type is dependent on the size of the function. */
fre_type = sframe_calc_fre_type (dpltsec->size);
- func_info = sframe_fde_func_info (fre_type,
- SFRAME_FDE_TYPE_PCINC);
+ func_info = sframe_fde_create_func_info (fre_type, SFRAME_FDE_TYPE_PCINC);
/* Add SFrame FDE and the associated FREs for plt0 if plt0 has been
generated. */
@@ -1888,7 +1887,8 @@ _bfd_x86_elf_create_sframe_plt (bfd *output_bfd,
pattern of the instructions in these entries. Using this SFrame FDE
type helps in keeping the unwind information for pltn entries
compact. */
- func_info = sframe_fde_func_info (fre_type, SFRAME_FDE_TYPE_PCMASK);
+ func_info = sframe_fde_create_func_info (fre_type,
+ SFRAME_FDE_TYPE_PCMASK);
/* Add the SFrame FDE for all PCs starting at the first pltn entry (hence,
function start address = plt0_entry_size. As usual, this will be
updated later at _bfd_elf_merge_section_sframe, by when the
diff --git a/include/sframe-api.h b/include/sframe-api.h
index c658474253f..0a86389857c 100644
--- a/include/sframe-api.h
+++ b/include/sframe-api.h
@@ -83,10 +83,10 @@ _SFRAME_ERRORS
extern const char *
sframe_errmsg (int error);
-/* Get FDE function info given a FRE_TYPE. */
+/* Create an FDE function info bye given an FRE_TYPE and an FDE_TYPE. */
extern unsigned char
-sframe_fde_func_info (unsigned int fre_type, unsigned int fde_type);
+sframe_fde_create_func_info (unsigned int fre_type, unsigned int fde_type);
/* Gather the FRE type given the function size. */
diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index 64fa9078d62..d4eaaee2297 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -548,12 +548,12 @@ sframe_decoder_free (sframe_decoder_ctx **decoder)
}
}
-/* Create a FDE function info byte given an FRE_TYPE and an FDE_TYPE. */
+/* Create an FDE function info byte given an FRE_TYPE and an FDE_TYPE. */
/* FIXME API for linker. Revisit if its better placed somewhere else? */
unsigned char
-sframe_fde_func_info (unsigned int fre_type,
- unsigned int fde_type)
+sframe_fde_create_func_info (unsigned int fre_type,
+ unsigned int fde_type)
{
unsigned char func_info;
sframe_assert (fre_type == SFRAME_FRE_TYPE_ADDR1
diff --git a/libsframe/testsuite/libsframe.encode/encode-1.c b/libsframe/testsuite/libsframe.encode/encode-1.c
index 4075591ffa1..01481106a62 100644
--- a/libsframe/testsuite/libsframe.encode/encode-1.c
+++ b/libsframe/testsuite/libsframe.encode/encode-1.c
@@ -39,8 +39,8 @@ add_fde1 (sframe_encoder_ctx *encode, int idx)
{0x1a, 0x5, {0x8, 0xf0, 0}}
};
- unsigned char finfo = sframe_fde_func_info (SFRAME_FRE_TYPE_ADDR1,
- SFRAME_FDE_TYPE_PCINC);
+ unsigned char finfo = sframe_fde_create_func_info (SFRAME_FRE_TYPE_ADDR1,
+ SFRAME_FDE_TYPE_PCINC);
err = sframe_encoder_add_funcdesc (encode, 0xfffff03e, 0x1b, finfo, 4);
if (err == -1)
return err;
@@ -64,8 +64,8 @@ add_fde2 (sframe_encoder_ctx *encode, int idx)
{0xf, 0x5, {0x8, 0xf0, 0}}
};
- unsigned char finfo = sframe_fde_func_info (SFRAME_FRE_TYPE_ADDR1,
- SFRAME_FDE_TYPE_PCINC);
+ unsigned char finfo = sframe_fde_create_func_info (SFRAME_FRE_TYPE_ADDR1,
+ SFRAME_FDE_TYPE_PCINC);
err = sframe_encoder_add_funcdesc (encode, 0xfffff059, 0x10, finfo, 4);
if (err == -1)
return err;
--
2.37.2
next prev parent reply other threads:[~2022-12-07 19:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 19:52 [PATCH 0/6] Small improvements around SFrame support Indu Bhagat
2022-12-07 19:52 ` [PATCH 1/6] libsframe: minor formatting nits Indu Bhagat
2022-12-08 11:03 ` Nick Clifton
2022-12-07 19:52 ` [PATCH 2/6] sframe.h: make some macros more precise Indu Bhagat
2022-12-07 23:52 ` Hans-Peter Nilsson
2022-12-08 17:36 ` Indu Bhagat
2022-12-08 20:26 ` [PATCH,V2 " Indu Bhagat
2022-12-12 16:02 ` Nick Clifton
2022-12-07 19:52 ` [PATCH 3/6] sframe: gas: libsframe: define constants and remove magic numbers Indu Bhagat
2022-12-08 11:10 ` Nick Clifton
2022-12-08 17:43 ` Indu Bhagat
2022-12-08 18:38 ` Indu Bhagat
2022-12-07 19:52 ` [PATCH 4/6] gas: sframe: fine tune the fragment fixup for SFrame func info Indu Bhagat
2022-12-08 11:12 ` Nick Clifton
2022-12-07 19:52 ` Indu Bhagat [this message]
2022-12-08 11:13 ` [PATCH 5/6] libsframe: rename API sframe_fde_func_info to sframe_fde_create_func_info Nick Clifton
2022-12-07 19:52 ` [PATCH 6/6] objdump: sframe: fix memory leaks Indu Bhagat
2022-12-08 11:14 ` 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=20221207195222.1182788-6-indu.bhagat@oracle.com \
--to=indu.bhagat@oracle.com \
--cc=binutils@sourceware.org \
--cc=weimin.pan@oracle.com \
/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).