#endif
}
+/* Get whether signal frame. */
+static bool
+get_dw_fde_signal_p (const struct fde_entry *dw_fde)
+{
+ return (dw_fde->signal_frame == 1);
+}
+
/* SFrame Frame Row Entry (FRE) related functions. */
static void
return fre_info;
}
-/* SFrame (SFRAME_VERSION_1) set function info. */
+/* SFrame (SFRAME_VERSION_3) set function info. */
+
static unsigned char
-sframe_v1_set_func_info (unsigned int fde_type, unsigned int fre_type,
- unsigned int pauth_key)
+sframe_v3_set_func_info (unsigned int fde_type, unsigned int fre_type,
+ unsigned int pauth_key, bool signal_p)
{
unsigned char func_info;
- func_info = SFRAME_V1_FUNC_INFO (fde_type, fre_type);
- func_info = SFRAME_V1_FUNC_INFO_UPDATE_PAUTH_KEY (pauth_key, func_info);
+ func_info = SFRAME_V2_FUNC_INFO (fde_type, fre_type);
+ func_info = SFRAME_V2_FUNC_INFO_UPDATE_PAUTH_KEY (pauth_key, func_info);
+ func_info = SFRAME_V3_FUNC_INFO_UPDATE_SIGNAL_P (signal_p, func_info);
return func_info;
}
sframe_ver_ops.set_fre_info = sframe_v1_set_fre_info;
- sframe_ver_ops.set_func_info = sframe_v1_set_func_info;
+ sframe_ver_ops.set_func_info = sframe_v3_set_func_info;
}
/* SFrame set FRE info. */
static unsigned char
sframe_set_func_info (unsigned int fde_type, unsigned int fre_type,
- unsigned int pauth_key)
+ unsigned int pauth_key, bool signal_p)
{
- return sframe_ver_ops.set_func_info (fde_type, fre_type, pauth_key);
+ return sframe_ver_ops.set_func_info (fde_type, fre_type, pauth_key,
+ signal_p);
}
/* Get the number of SFrame FDEs for the current file. */
expressionS exp;
symbolS *dw_fde_start_addrS, *dw_fde_end_addrS;
unsigned int pauth_key;
+ bool signal_p;
dw_fde_start_addrS = get_dw_fde_start_addrS (sframe_fde->dw_fde);
dw_fde_end_addrS = get_dw_fde_end_addrS (sframe_fde->dw_fde);
unsigned char func_info;
pauth_key = (get_dw_fde_pauth_b_key_p (sframe_fde->dw_fde)
? SFRAME_AARCH64_PAUTH_KEY_B : SFRAME_AARCH64_PAUTH_KEY_A);
+ signal_p = get_dw_fde_signal_p (sframe_fde->dw_fde);
func_info = sframe_set_func_info (SFRAME_FDE_TYPE_PCINC,
SFRAME_FRE_TYPE_ADDR4,
- pauth_key);
+ pauth_key, signal_p);
if (SFRAME_FRE_TYPE_SELECTION_OPT)
{
expressionS cexp;
unsigned char (*set_fre_info) (unsigned int, unsigned int, unsigned int,
bool);
/* set SFrame Func info. */
- unsigned char (*set_func_info) (unsigned int, unsigned int, unsigned int);
+ unsigned char (*set_func_info) (unsigned int, unsigned int, unsigned int,
+ bool);
};
/* Generate SFrame stack trace info and prepare contents for the output.
offsetT rest_of_data;
uint8_t fde_type, fre_type;
uint8_t pauth_key;
+ bool signal_p;
expressionS *exp;
symbolS *dataS;
rest_of_data = (symbol_get_value_expression(dataS))->X_add_number;
fde_type = SFRAME_V2_FUNC_FDE_TYPE (rest_of_data);
pauth_key = SFRAME_V2_FUNC_PAUTH_KEY (rest_of_data);
+ signal_p = SFRAME_V3_FUNC_SIGNAL_P (rest_of_data);
gas_assert (fde_type == SFRAME_FDE_TYPE_PCINC);
/* Calculate the applicable fre_type. */
/* Create the new function info. */
value = SFRAME_V2_FUNC_INFO (fde_type, fre_type);
value = SFRAME_V2_FUNC_INFO_UPDATE_PAUTH_KEY (pauth_key, value);
+ value = SFRAME_V3_FUNC_INFO_UPDATE_SIGNAL_P (signal_p, value);
frag->fr_literal[frag->fr_fix] = value;
}
--- /dev/null
+#as: --gsframe
+#objdump: --sframe=.sframe
+#name: Signal Frame
+#...
+Contents of the SFrame section .sframe:
+
+ Header :
+
+ Version: SFRAME_VERSION_3
+ Flags: SFRAME_F_FDE_FUNC_START_PCREL
+#? CFA fixed FP offset: \-?\d+
+#? CFA fixed RA offset: \-?\d+
+ Num FDEs: 1
+ Num FREs: 1
+
+ Function Index :
+ func idx \[0\]: pc = 0x0, size = 0 bytes, attr = \"S\"
+ STARTPC + CFA + FP + RA +
+#pass
--- /dev/null
+ .cfi_startproc
+ .cfi_signal_frame
+ .cfi_endproc
run_dump_test "cfi-sframe-common-10"
run_dump_test "cfi-sframe-common-11"
run_dump_test "cfi-sframe-common-12"
+ run_dump_test "cfi-sframe-common-13"
run_dump_test "common-empty-1"
run_dump_test "common-empty-2"
- 4-bits: Identify the FRE type used for the function.
- 1-bit: Identify the FDE type of the function - mask or inc.
- 1-bit: PAC authorization A/B key (aarch64).
- - 2-bits: Unused.
- --------------------------------------------------------------------------
- | Unused | PAC auth A/B key (aarch64) | FDE type | FRE type |
- | | Unused (amd64, s390x) | | |
- --------------------------------------------------------------------------
- 8 6 5 4 0 */
+ - 1-bits: Unused.
+ - 1-bit: Signal frame.
+ ---------------------------------------------------------------------------------
+ | Signal | Unused | PAC auth A/B key (aarch64) | FDE type | FRE type |
+ | frame | | Unused (amd64) | | |
+ ---------------------------------------------------------------------------------
+ 8 7 6 5 4 0 */
uint8_t sfde_func_info;
/* Size of the block of repeating insns. Used for SFrame FDEs of type
SFRAME_FDE_TYPE_PCMASK. */
#define SFRAME_V3_FUNC_FRE_TYPE(data) (SFRAME_V2_FUNC_FRE_TYPE (data))
#define SFRAME_V3_FUNC_FDE_TYPE(data) (SFRAME_V2_FUNC_FDE_TYPE (data))
#define SFRAME_V3_FUNC_PAUTH_KEY(data) (SFRAME_V2_FUNC_PAUTH_KEY (data))
+#define SFRAME_V3_FUNC_SIGNAL_P(data) (((data) >> 7) & 0x1)
#define SFRAME_V3_FUNC_INFO_UPDATE_PAUTH_KEY(pauth_key, fde_info) \
SFRAME_V2_FUNC_INFO_UPDATE_PAUTH_KEY (pauth_key, fde_info)
+#define SFRAME_V3_FUNC_INFO_UPDATE_SIGNAL_P(signal_p, fde_info) \
+ ((((signal_p) & 0x1) << 7) | ((fde_info) & 0x7f))
+
/* Size of stack frame offsets in an SFrame Frame Row Entry. A single
SFrame FRE has all offsets of the same size. Offset size may vary
across frame row entries. */
funcidx,
NULL);
- /* Mark FDEs with [m] where the FRE start address is interpreted as a
- mask. */
- int fde_type_addrmask_p = (SFRAME_V2_FUNC_FDE_TYPE (func_info)
- == SFRAME_FDE_TYPE_PCMASK);
- const char *fde_type_marker
- = (fde_type_addrmask_p ? "[m]" : " ");
+ /* Gather all FDE attributes. */
+ char attrs[16] = {0};
+ bool fde_signal_p = SFRAME_V3_FUNC_SIGNAL_P (func_info);
+ sprintf (attrs, fde_signal_p ? "S" : "");
printf ("\n func idx [%d]: pc = 0x%"PRIx64 ", size = %d bytes",
funcidx,
func_start_pc_vma,
func_size);
+ /* Print attributes if they exist. */
+ if (attrs[0])
+ printf (", attr = \"%s\"", attrs);
if (is_sframe_abi_arch_aarch64 (sfd_ctx)
&& (SFRAME_V2_FUNC_PAUTH_KEY (func_info) == SFRAME_AARCH64_PAUTH_KEY_B))
printf (", pauth = B key");
- char temp[100];
-
+ /* Mark FDEs with [m] where the FRE start address is interpreted as a
+ mask. */
+ int pc_mask_p
+ = (SFRAME_V2_FUNC_FDE_TYPE (func_info) == SFRAME_FDE_TYPE_PCMASK);
+ const char *pc_mask_marker = (pc_mask_p ? "[m]" : " ");
printf ("\n %-7s%-8s %-10s%-10s%-13s",
- "STARTPC", fde_type_marker, "CFA", "FP", "RA");
+ "STARTPC", pc_mask_marker, "CFA", "FP", "RA");
+
+ char temp[100] = {0};
for (j = 0; j < num_fres; j++)
{
sframe_decoder_get_fre (sfd_ctx, funcidx, j, &fre);
- fre_start_pc_vma = (fde_type_addrmask_p
+ fre_start_pc_vma = (pc_mask_p
? fre.fre_start_addr
: func_start_pc_vma + fre.fre_start_addr);