]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: sframe: fix handling of .cfi_def_cfa_register
authorClaudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Tue, 15 Apr 2025 09:20:40 +0000 (12:20 +0300)
committerIndu Bhagat <indu.bhagat@oracle.com>
Thu, 24 Apr 2025 15:27:16 +0000 (08:27 -0700)
commit3602da6fa285d6b22d87bcc39056e919e939ef07
tree1431b703b9f38a4dd06e9a6d083197ff727e25cd
parent8c8e5b1f1abfbce913783da0f1cd1f85c60bd445
gas: sframe: fix handling of .cfi_def_cfa_register

Fix PR gas/32879 sframe: Assembler internal error when translating
cfi_def_cfa_register

As per the documentation, .cfi_def_cfa_register modifies a rule for
computing CFA; the register is updated, but the offset remains the same.

While translating .cfi_def_cfa_register into SFrame context, we use the
information from last translated FRE to set the CFA offset. However,
there may be cases when the last translated FRE is empty.  Use last FRE
only if available.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Signed-off-by: Indu Bhagat <indu.bhagat@oracle.com>
gas/gen-sframe.c
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.d [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.s [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe.exp