#if DEFAULT_SFRAME
enum gen_sframe_option flag_gen_sframe = GEN_SFRAME_CONFIG_ENABLED;
#endif
+/* Version of SFrame stack trace info to generate. Default version is
+ SFRAME_VERSION_3. */
+enum gen_sframe_version flag_gen_sframe_version = GEN_SFRAME_VERSION_3;
segT reg_section;
segT expr_section;
generate GNU Build notes if none are present in the input\n"));
fprintf (stream, _("\
--gsframe[={no|yes}] whether to generate SFrame stack trace information\n\
- (default: %s)\n"), DEFAULT_SFRAME ? "yes" : "no");
+ (default: %s)\n\
+ Default version emitted is V3\n"),
+ DEFAULT_SFRAME ? "yes" : "no");
+ fprintf (stream, _("\
+ --gsframe-<N> generate SFrame version <N> information. 3 == <N>\n"));
# if defined (TARGET_USE_SCFI) && defined (TARGET_USE_GINSN)
fprintf (stream, _("\
--scfi=experimental Synthesize DWARF CFI for hand-written asm\n\
OPTION_NO_PAD_SECTIONS,
OPTION_MULTIBYTE_HANDLING, /* = STD_BASE + 40 */
OPTION_SFRAME,
+ OPTION_SFRAME_3,
OPTION_SCFI,
OPTION_INFO,
OPTION_NOINFO
,{"sectname-subst", no_argument, NULL, OPTION_SECTNAME_SUBST}
,{"generate-missing-build-notes", required_argument, NULL, OPTION_ELF_BUILD_NOTES}
,{"gsframe", optional_argument, NULL, OPTION_SFRAME}
+ ,{"gsframe-3", no_argument, NULL, OPTION_SFRAME_3}
# if defined (TARGET_USE_SCFI) && defined (TARGET_USE_GINSN)
,{"scfi", required_argument, NULL, OPTION_SCFI}
# endif
flag_gen_sframe = GEN_SFRAME_ENABLED;
break;
+ case OPTION_SFRAME_3:
+ flag_gen_sframe_version = GEN_SFRAME_VERSION_3;
+ break;
+
#endif /* OBJ_ELF */
case 'Z':
/* State of the setting for SFrame section creation. */
COMMON enum gen_sframe_option flag_gen_sframe;
+enum gen_sframe_version
+{
+ GEN_SFRAME_VERSION_3 = 3,
+};
+
+COMMON enum gen_sframe_version flag_gen_sframe_version;
+
/* name of emitted object file */
COMMON const char *out_file_name;
[@b{--gdwarf-cie-version}=@var{VERSION}]
[@b{--generate-missing-build-notes=[no|yes]}]
[@b{--gsframe}] [@b{--gsframe=[no|yes]}]
+ [@b{--gsframe-3}]
[@b{--hash-size}=@var{N}]
[@b{--help}] [@b{--target-help}]
[@b{--info}] [@b{--no-info}]
Create @var{.sframe} section from CFI directives. The explicit
@option{--gsframe=yes} option behaves the same as @option{--gsframe}.
Generation can be suppressed with @option{--gsframe=no}. The default can be
-controlled by a configure option @option{--enable-default-sframe}.
+controlled by a configure option @option{--enable-default-sframe}. The current
+version of the emitted SFrame stack trace data is SFRAME_VERSION_3.
+
+@item --gsframe-3
+Generate SFrame stack trace information as per Version 3 of the specification.
@end ifset
/* SFrame version specific operations setup. */
static void
-sframe_set_version (uint32_t sframe_version ATTRIBUTE_UNUSED)
+sframe_set_version (enum gen_sframe_version flag_ver)
{
- sframe_ver_ops.format_version = SFRAME_VERSION_3;
-
- /* These operations remain the same for SFRAME_VERSION_3 as fre_info and
- func_info have not changed from SFRAME_VERSION_2 and SFRAME_VERSION_1. */
-
- sframe_ver_ops.set_fre_info = sframe_v1_set_fre_info;
-
- sframe_ver_ops.set_func_info = sframe_v3_set_func_info;
+ if (flag_ver == GEN_SFRAME_VERSION_3)
+ {
+ sframe_ver_ops.format_version = SFRAME_VERSION_3;
+ /* These operations remain the same for SFRAME_VERSION_3 as fre_info and
+ func_info layout has not changed from SFRAME_VERSION_2 and
+ SFRAME_VERSION_1. */
+ sframe_ver_ops.set_fre_info = sframe_v1_set_fre_info;
+ sframe_ver_ops.set_func_info = sframe_v3_set_func_info;
+ }
}
/* SFrame set FRE info. */
{
(void) sframe_seg;
+ /* Currently only SFRAME_VERSION_3 can be emitted. */
+ gas_assert (flag_gen_sframe_version == GEN_SFRAME_VERSION_3);
/* Setup the version specific access functions. */
- sframe_set_version (SFRAME_VERSION_3);
+ sframe_set_version (flag_gen_sframe_version);
/* Process all fdes and create SFrame stack trace information. */
create_sframe_all ();
--- /dev/null
+#as: --gsframe-3
+#readelf: --sframe
+#name: Generate SFrame V3 section
+Contents of the SFrame section .sframe:
+ Header :
+
+ Version: SFRAME_VERSION_3
+ Flags: SFRAME_F_FDE_FUNC_START_PCREL
+#...
+ Num FDEs: 1
+ Num FREs: 1
+
+#...
--- /dev/null
+ .cfi_sections .sframe
+ .cfi_startproc
+ .cfi_endproc
run_dump_test "cfi-sframe-common-1"
run_dump_test "cfi-sframe-common-1b"
run_dump_test "cfi-sframe-common-1c"
+ run_dump_test "cfi-sframe-common-1d"
run_dump_test "cfi-sframe-common-2"
run_dump_test "cfi-sframe-common-3"
run_dump_test "cfi-sframe-common-4"