aboutsummaryrefslogtreecommitdiff
path: root/gas/gen-sframe.c
diff options
context:
space:
mode:
authorIndu Bhagat <indu.bhagat@oracle.com>2024-01-12 00:22:12 -0800
committerIndu Bhagat <indu.bhagat@oracle.com>2024-01-12 00:22:12 -0800
commit6bf40ece270c42b0e5f90459a7dde851e3e7485d (patch)
tree50df52e5c76815dc696fc2c6b4c843c1671f1e74 /gas/gen-sframe.c
parent156a2edbdbb94c197a992b218d482002aa727ce8 (diff)
downloadbinutils-6bf40ece270c42b0e5f90459a7dde851e3e7485d.zip
binutils-6bf40ece270c42b0e5f90459a7dde851e3e7485d.tar.gz
binutils-6bf40ece270c42b0e5f90459a7dde851e3e7485d.tar.bz2
gas: sframe: warn when skipping SFrame FDE generation
Fix PR gas/31213. gas/ PR gas/31213 * gen-sframe.c (sframe_do_cfi_insn): Add new warning. gas/testsuite/ * gas/cfi-sframe/common-empty-1.d: Test the new warning as well. * gas/cfi-sframe/common-empty-2.d: Likewise.
Diffstat (limited to 'gas/gen-sframe.c')
-rw-r--r--gas/gen-sframe.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
index 3c212f3..75781fc 100644
--- a/gas/gen-sframe.c
+++ b/gas/gen-sframe.c
@@ -1247,25 +1247,33 @@ sframe_do_cfi_insn (struct sframe_xlate_ctx *xlate_ctx,
case DW_CFA_GNU_window_save:
err = sframe_xlate_do_gnu_window_save (xlate_ctx, cfi_insn);
break;
+ /* Other CFI opcodes are not processed at this time.
+ These do not impact the coverage of the basic stack tracing
+ information as conveyed in the SFrame format.
+ - DW_CFA_register,
+ - etc. */
+ case DW_CFA_register:
+ if (cfi_insn->u.rr.reg1 == SFRAME_CFA_SP_REG
+#ifdef SFRAME_FRE_RA_TRACKING
+ || cfi_insn->u.rr.reg1 == SFRAME_CFA_RA_REG
+#endif
+ || cfi_insn->u.rr.reg1 == SFRAME_CFA_FP_REG)
+ err = SFRAME_XLATE_ERR_NOTREPRESENTED;
+ break;
case DW_CFA_undefined:
case DW_CFA_same_value:
break;
default:
- {
- /* Other CFI opcodes are not processed at this time.
- These do not impact the coverage of the basic stack tracing
- information as conveyed in the SFrame format.
- - DW_CFA_register,
- - ...
-
- Following skipped operations do, however, impact the asynchronicity:
- - CFI_escape */
-
- err = SFRAME_XLATE_ERR_NOTREPRESENTED;
- // printf (_("SFrame Unsupported or unknown Dwarf CFI number: %#x\n"), op);
- }
+ /* Following skipped operations do, however, impact the asynchronicity:
+ - CFI_escape. */
+ err = SFRAME_XLATE_ERR_NOTREPRESENTED;
}
+ /* An error here will cause no SFrame FDE later. Warn the user because this
+ will affect the overall coverage and hence, asynchronicity. */
+ if (err)
+ as_warn (_("skipping SFrame FDE due to DWARF CFI op %#x"), op);
+
return err;
}