]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: sframe: fix PR gas/33277
authorIndu Bhagat <indu.bhagat@oracle.com>
Wed, 5 Nov 2025 06:59:11 +0000 (22:59 -0800)
committerIndu Bhagat <indu.bhagat@oracle.com>
Wed, 5 Nov 2025 06:59:55 +0000 (22:59 -0800)
commit6384e241e8fd037e2aab1da34da7a0bf0b2ea521
tree2e0e5873516d7393b1e237dcafd4f3fd5f4ed627
parent58fedddb895318d72189dbae912f4902dab96b4c
gas: sframe: fix PR gas/33277

In SFrame stack trace format, the representation of stack offsets allows
for either 1-byte, 2-byte or 4-byte integers.

Add new internal function sframe_fre_stack_offset_bound_p () which
checks if the given offset is within bounds (at most as a 4-byte
integer).  Use this to check if CFA offset is within bounds, if not skip
emitting the FDE, and warn the user.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>
gas/
PR gas/33277
        * gen-sframe.c (sframe_fre_stack_offset_bound_p): New
definition.
        (sframe_xlate_do_def_cfa): Check bounds of offset.
        (sframe_xlate_do_def_cfa_offset): Likewise.

gas/testsuite/
PR gas/33277
        * gas/cfi-sframe/cfi-sframe.exp: Add new test.
        * gas/cfi-sframe/cfi-sframe-x86_64-empty-pr33277.d: Likewise.
        * gas/cfi-sframe/cfi-sframe-x86_64-empty-pr33277.s: Likewise.
gas/gen-sframe.c
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-pr33277.d [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-pr33277.s [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe.exp