aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Remus <jremus@linux.ibm.com>2024-03-28 10:31:00 +0100
committerJens Remus <jremus@linux.ibm.com>2024-05-16 13:32:22 +0200
commit388179e48a62c65c5de7aff2355dd2bef1c3664f (patch)
tree723b89d30b91b037284cdfaea05e44be18bd5cf9
parent9e13b3122b1c60aa3fc3f60993c18daf2e6f282a (diff)
downloadbinutils-388179e48a62c65c5de7aff2355dd2bef1c3664f.zip
binutils-388179e48a62c65c5de7aff2355dd2bef1c3664f.tar.gz
binutils-388179e48a62c65c5de7aff2355dd2bef1c3664f.tar.bz2
gas: Skip SFrame FDE if .cfi_window_save
CFI opcode DW_CFA_AARCH64_negate_ra_state is multiplexed with DW_CFA_GNU_window_save. Process DW_CFA_AARCH64_negate_ra_state on AArch64. Skip generation of SFrame FDE otherwise. gas/ * gen-sframe.c: Skip SFrame FDE if .cfi_window_save. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
-rw-r--r--gas/gen-sframe.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
index 9fe62c2..8c5a476 100644
--- a/gas/gen-sframe.c
+++ b/gas/gen-sframe.c
@@ -1259,12 +1259,12 @@ sframe_xlate_do_restore (struct sframe_xlate_ctx *xlate_ctx,
return SFRAME_XLATE_OK;
}
-/* Translate DW_CFA_GNU_window_save into SFrame context.
+/* Translate DW_CFA_AARCH64_negate_ra_state into SFrame context.
Return SFRAME_XLATE_OK if success. */
static int
-sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx,
- struct cfi_insn_data *cfi_insn ATTRIBUTE_UNUSED)
+sframe_xlate_do_aarch64_negate_ra_state (struct sframe_xlate_ctx *xlate_ctx,
+ struct cfi_insn_data *cfi_insn ATTRIBUTE_UNUSED)
{
struct sframe_row_entry *cur_fre = xlate_ctx->cur_fre;
@@ -1276,6 +1276,25 @@ sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx,
return SFRAME_XLATE_OK;
}
+/* Translate DW_CFA_GNU_window_save into SFrame context.
+ DW_CFA_AARCH64_negate_ra_state is multiplexed with DW_CFA_GNU_window_save.
+ Return SFRAME_XLATE_OK if success. */
+
+static int
+sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx,
+ struct cfi_insn_data *cfi_insn)
+{
+ unsigned char abi_arch = sframe_get_abi_arch ();
+
+ /* Translate DW_CFA_AARCH64_negate_ra_state into SFrame context. */
+ if (abi_arch == SFRAME_ABI_AARCH64_ENDIAN_BIG
+ || abi_arch == SFRAME_ABI_AARCH64_ENDIAN_LITTLE)
+ return sframe_xlate_do_aarch64_negate_ra_state (xlate_ctx, cfi_insn);
+
+ as_warn (_("skipping SFrame FDE due to .cfi_window_save"));
+ return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
+}
+
/* Returns the DWARF call frame instruction name or fake CFI name for the
specified CFI opcode, or NULL if the value is not recognized. */