]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Revert "gas: Don't skip SFrame FDE if .cfi_register specifies RA w/o tracking"
authorIndu Bhagat <indu.bhagat@oracle.com>
Fri, 14 Nov 2025 06:49:14 +0000 (22:49 -0800)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 9 Dec 2025 08:26:10 +0000 (00:26 -0800)
This reverts commit df174a6b760ac5c66ee62ecb872c760ae21fd4cd.

    commit df174a6b760ac5c66ee62ecb872c760ae21fd4cd
    Date:   Thu Jul 4 10:34:12 2024 +0200

    gas: Don't skip SFrame FDE if .cfi_register specifies RA w/o tracking

    Do not skip SFrame FDE if .cfi_register specifies RA register without
    RA tracking being actually used. Without RA tracking the register
    contents can always be restored from the stack using the fixed
    RA offset from CFA.

Even for ABI/arch without RA tracking, there may be instances where user
may specify '.cfi_register RA, reg'.  This needs to be caught, skipping
this from SFrame generation may not be correct.  This may be done in
certain hand-written asm sequences where the user needs to manipulate
the return to a certain function.

A later commit will add a testcase for documentation purposes.

gas/gen-sframe.c

index 0d6edd362cbc54b977cda6f7c0a9d93bd6b72ec5..eead58b00f66351833675c98cad76c4ae338afc4 100644 (file)
@@ -1281,7 +1281,7 @@ sframe_xlate_do_register (struct sframe_xlate_ctx *xlate_ctx,
      instruction can be safely skipped without sacrificing the asynchronicity of
      stack trace information.  */
   if (cfi_insn->u.rr.reg1 == SFRAME_CFA_FP_REG
-      || (sframe_ra_tracking_p () && cfi_insn->u.rr.reg1 == SFRAME_CFA_RA_REG)
+      || cfi_insn->u.rr.reg1 == SFRAME_CFA_RA_REG
       /* Ignore SP reg, as it can be recovered from the CFA tracking info.  */
       )
     {