diff options
Diffstat (limited to 'libsframe')
-rw-r--r-- | libsframe/doc/sframe-spec.texi | 20 | ||||
-rw-r--r-- | libsframe/sframe.c | 24 |
2 files changed, 24 insertions, 20 deletions
diff --git a/libsframe/doc/sframe-spec.texi b/libsframe/doc/sframe-spec.texi index 7307789..f25791e 100644 --- a/libsframe/doc/sframe-spec.texi +++ b/libsframe/doc/sframe-spec.texi @@ -20,7 +20,7 @@ License''. @titlepage @title The SFrame Format -@subtitle Version 2 +@subtitle Version 2 (Errata 1) @sp 15 @center @today{} @author Indu Bhagat @@ -35,9 +35,9 @@ License''. @node Top @top The SFrame format -This manual describes version 2 of the SFrame file format. SFrame stands for -Simple Frame. The SFrame format keeps track of the minimal necessary -information needed for generating stack traces: +This manual describes version 2 (errata 1) of the SFrame file format. SFrame +stands for Simple Frame. The SFrame format keeps track of the minimal +necessary information needed for generating stack traces: @itemize @minus @item @@ -130,9 +130,9 @@ the data structure. The above two imply that each SFrame function descriptor entry has a fixed size of 20 bytes instead of its size of 17 bytes in SFrame format version 1. @item -Add a new flag SFRAME_F_FDE_FUNC_START_PCREL, as an erratum to SFrame -Version 2, to indicate the encoding of the SFrame FDE function start address -field: +[Errata 1] Add a new flag SFRAME_F_FDE_FUNC_START_PCREL, as an erratum to +SFrame Version 2, to indicate the encoding of the SFrame FDE function start +address field: @itemize @minus @item if set, @code{sfde_func_start_address} field contains the offset in bytes to the start PC of the associated function from the field itself. @@ -141,8 +141,8 @@ bytes to the start PC of the associated function from the start of the SFrame section. @end itemize @item -Add a new ABI/arch identifier SFRAME_ABI_S390X_ENDIAN_BIG for the s390 -architecture (64-bit) s390x ABI. Other s390x-specific backward compatible +[Errata 1] Add a new ABI/arch identifier SFRAME_ABI_S390X_ENDIAN_BIG for the +s390 architecture (64-bit) s390x ABI. Other s390x-specific backward compatible changes including the following helper definitions have been incrementally added to SFrame version 2 only: @itemize @minus @@ -165,6 +165,8 @@ CFA offset adjustment and then scale down by CFA offset alignment factor). @item SFRAME_V2_S390X_CFA_OFFSET_DECODE: Decode CFA offset (i.e., scale up by CFA offset alignment factor and then revert CFA offset adjustment). @end itemize +@item +[Errata 1] An ELF SFrame section has the type SHT_GNU_SFRAME. @end itemize SFrame version 1 is now obsolete and should not be used. diff --git a/libsframe/sframe.c b/libsframe/sframe.c index 7357fc1..824d1fd 100644 --- a/libsframe/sframe.c +++ b/libsframe/sframe.c @@ -1328,13 +1328,14 @@ sframe_decoder_get_fre (sframe_decoder_ctx *ctx, if (!sframe_fre_sanity_check_p (&ifre)) return sframe_set_errno (&err, SFRAME_ERR_FRE_INVAL); - sframe_frame_row_entry_copy (fre, &ifre); + /* Although a stricter sanity check on fre_start_addr like: + if (fdep->sfde_func_size) + sframe_assert (frep->fre_start_addr < fdep->sfde_func_size); + is more suitable, some code has been seen to not abide by it. See + PR libsframe/33131. */ + sframe_assert (ifre.fre_start_addr <= fdep->sfde_func_size); - if (fdep->sfde_func_size) - sframe_assert (fre->fre_start_addr < fdep->sfde_func_size); - else - /* A SFrame FDE with func size equal to zero is possible. */ - sframe_assert (fre->fre_start_addr == fdep->sfde_func_size); + sframe_frame_row_entry_copy (fre, &ifre); return 0; } @@ -1587,11 +1588,12 @@ sframe_encoder_add_fre (sframe_encoder_ctx *encoder, = frep->fre_start_addr; ectx_frep->fre_info = frep->fre_info; - if (fdep->sfde_func_size) - sframe_assert (frep->fre_start_addr < fdep->sfde_func_size); - else - /* A SFrame FDE with func size equal to zero is possible. */ - sframe_assert (frep->fre_start_addr == fdep->sfde_func_size); + /* Although a stricter sanity check on fre_start_addr like: + if (fdep->sfde_func_size) + sframe_assert (frep->fre_start_addr < fdep->sfde_func_size); + is more suitable, some code has been seen to not abide by it. See PR + libsframe/33131. */ + sframe_assert (frep->fre_start_addr <= fdep->sfde_func_size); /* frep has already been sanity check'd. Get offsets size. */ offsets_sz = sframe_fre_offset_bytes_size (frep->fre_info); |