gas: sframe: Init x86_fp_deref_p to false
Patch initializes x86_fp_deref_p to false in gas's sframe module.
This patch corrects an initialization error in the gas assembler’s sframe module. The boolean variable x86_fp_deref_p was incorrectly initialized to true when it should be false for certain ABI architectures. By changing the default initialization to false, the patch ensures correct behavior for frame pointer dereferencing based on the ABI and architecture support.
- proposer
Submits a patch to initialize `x86_fp_deref_p` to `false` in the gas sframe module.
“bool x86_fp_deref_p = true;”
- reviewer
Acknowledges the patch and the observed issue, agreeing with the proposed change.
“On 03.11.2026 12:48, mengqinggang wrote: > --- > gas/gen-sframe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c > index 031421d8ab7..8121939f43e 100644 > --- a/gas/gen-sframe.c > +++ b/gas/gen-sframe.c > @@ -1889,7 +1889,7 @@ sframe_xlate_do_escape_expr (struct sframe_xlate_ctx *xlate_ctx, > > unsigned opcode = items[2]; > un…”
Technical Tradeoffs
- Corrects an initialization bug, potentially fixing incorrect frame pointer handling in generated FDE information, with no negative performance impact.
In Details
The sframe_xlate_do_escape_expr function in gas/gen-sframe.c incorrectly initializes the x86_fp_deref_p flag to true. This flag determines whether frame pointer dereferencing is used, which is dependent on the ABI architecture and whether flex FDE support is enabled. The correct default value for this flag, especially for non-AMD64 little-endian architectures or when flex FDE is not supported, should be false. This patch corrects the initialization to false, ensuring proper frame pointer handling according to the SFrame ABI specifications.
- gas
- The GNU Assembler, a component of the GNU toolchain that translates assembly language code into machine code.
- sframe
- A module within gas related to the generation of FDE (Frame Description Entry) information, used for stack unwinding.
- x86_fp_deref_p
- A boolean flag within the sframe module that indicates whether frame pointer dereferencing is being used on x86 architectures.
- FDE
- Frame Description Entry. Data structures used by debuggers and exception handling mechanisms to describe the stack frame layout and unwind information for a function.
- ABI
- Application Binary Interface. Defines how low-level code, such as compiled object files, should interact, including function calling conventions and data layout.
- AMD64
- The 64-bit version of the x86 instruction set architecture.