/* Various flags for SFrame. */
/* Function Descriptor Entries are sorted on PC. */
-#define SFRAME_F_FDE_SORTED 0x1
+#define SFRAME_F_FDE_SORTED 0x1
/* Functions preserve frame pointer. */
-#define SFRAME_F_FRAME_POINTER 0x2
+#define SFRAME_F_FRAME_POINTER (0x1 << 1)
+/* Function start address in SFrame FDE is encoded as the distance from the
+ location of the sfde_func_start_address to the start PC of the function.
+ If absent, the function start address in SFrame FDE is encoded as the
+ distance from the start of the SFrame FDE section to the start PC of the
+ function. */
+#define SFRAME_F_FDE_FUNC_START_ADDR_PCREL (0x1 << 2)
#define SFRAME_CFA_FIXED_FP_INVALID 0
#define SFRAME_CFA_FIXED_RA_INVALID 0
/* PS: Keep SFRAME_FLAGS_STR_MAX_LEN in sync if adding more members to
this array. */
#define SFRAME_FLAGS_STR_MAX_LEN 50
-#define MAX_NUM_FLAGS 2
+#define MAX_NUM_FLAGS 3
const struct dump_flags_helper flags_helper[MAX_NUM_FLAGS] = {
{ SFRAME_F_FDE_SORTED, "SFRAME_F_FDE_SORTED"},
- { SFRAME_F_FRAME_POINTER, "SFRAME_F_FRAME_POINTER"}
+ { SFRAME_F_FRAME_POINTER, "SFRAME_F_FRAME_POINTER"},
+ { SFRAME_F_FDE_FUNC_START_ADDR_PCREL, "SFRAME_F_FDE_FUNC_START_ADDR_PCREL"}
};
/* Prepare SFrame section flags string. */
static bool
sframe_header_sanity_check_p (sframe_header *hp)
{
- unsigned char all_flags = SFRAME_F_FDE_SORTED | SFRAME_F_FRAME_POINTER;
+ uint8_t all_flags = (SFRAME_F_FDE_SORTED | SFRAME_F_FRAME_POINTER
+ | SFRAME_F_FDE_FUNC_START_ADDR_PCREL);
/* Check preamble is valid. */
if (hp->sfh_preamble.sfp_magic != SFRAME_MAGIC
|| (hp->sfh_preamble.sfp_version != SFRAME_VERSION_1