]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[SFrame-V3] gas: sframe: allow SFrame FDEs with 0 FREs for signal frames
authorIndu Bhagat <indu.bhagat@oracle.com>
Sun, 7 Dec 2025 04:35:45 +0000 (20:35 -0800)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 9 Dec 2025 08:26:13 +0000 (00:26 -0800)
commit1adbbd16c14be7390c55cc9551255c34916f43b3
tree9e89063f1add4a5c086a6fed9efde8653e995615
parent15ca4c5d5461819c288137fe38fe4ccebd1a55d3
[SFrame-V3] gas: sframe: allow SFrame FDEs with 0 FREs for signal frames

Update the SFrame generation logic in GAS to emit Function Descriptor Entries
(FDEs) for signal frames even when no Frame Row Entries (FREs) could be
generated.

Previously, create_sframe_all () would discard any FDE that failed
translation or resulted in zero FREs. However, for signal frames (marked
with .cfi_signal_frame), preserving the FDE may be valuable even without
stack offsets. The presence of the SFrame FDE with the 'Signal'
attribute may allow stack tracers to identify the frame as a signal
trampoline and potentially apply fallback handling, rather than treating
the PC range as having no stack trace info at all.

The patch modifies create_sframe_all () to detect translation errors for
signal frames, effectively allowing the generation of an empty FDE (0 FREs)
marked with the 'S' attribute.

TBD:
 - But the warnings are already issued, we may emit SFrame FDE with no
   FREs.  Somewhat misleading.

gas/
* gen-sframe.c (sframe_fde_free): Add NULL check for safety.
(create_sframe_all): Allow FDEs for signal frames even if translation
encountered errors or produced no FREs.
gas/testsuite/
* gas/cfi-sframe/cfi-sframe.exp: New test.
* gas/cfi-sframe/cfi-sframe-x86_64-signal-1.d: New test ensuring
signal frame FDE is emitted with 0 FREs.
* gas/cfi-sframe/cfi-sframe-x86_64-signal-1.s: New test.
gas/gen-sframe.c
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-signal-1.d [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-signal-1.s [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe.exp