gas: sframe: skip DW_CFA_GNU_args_size when safe to ignore
Currently, gas warns and skips generating SFrame FDE when it sees:
.cfi_escape 0x2e,XX
From the documentation of DW_CFA_GNU_args_size:
"The DW_CFA_GNU_args_size instruction takes an unsigned LEB128 operand
representing an argument size. This instruction specifies the total of
the size of the arguments which have been pushed onto the stack."
With origins seemingly for VAX architecture, the usage of
DW_CFA_GNU_args_size seems to have evolved. The purpose of
DW_CFA_GNU_args_size is to adjust SP when performing stack unwinding for
exception handling.
For the purpose of stack tracing using SFrame, DW_CFA_GNU_args_size is
safe to skip, especially when the CFA restoration is known to be FP
based. A previous summary of the reasoning and intent was indicated
here [1].
[1] https://sourceware.org/pipermail/binutils/2025-August/143829.html
This fixes PR gas/33414 - sframe: handle DW_CFA_GNU_args_size in gas better
gas/
PR gas/33414
* gen-sframe.c (sframe_xlate_do_escape_gnu_args_size): New
definition.
(sframe_xlate_do_cfi_escape): Handle DW_CFA_GNU_args_size.
gas/testsuite/
PR gas/33414
* gas/cfi-sframe/cfi-sframe.exp: New test.
* gas/cfi-sframe/cfi-sframe-common-12.d: New test.
* gas/cfi-sframe/cfi-sframe-common-12.s: New test.
* gas/cfi-sframe/cfi-sframe-x86_64-3.d: New test.
* gas/cfi-sframe/cfi-sframe-x86_64-3.s: New test.
6 files changed