aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJens Remus <jremus@linux.ibm.com>2024-07-04 10:34:12 +0200
committerJens Remus <jremus@linux.ibm.com>2024-07-04 10:34:12 +0200
commit541b0fbbf27996443a94565503520a600d99e06a (patch)
treed6fd469a0aeebd9b1ba00ec655075fa8cce18177 /gas
parente24992c3341a1f8e69e74b74e7d1a813445dc0b7 (diff)
downloadfsf-binutils-gdb-541b0fbbf27996443a94565503520a600d99e06a.zip
fsf-binutils-gdb-541b0fbbf27996443a94565503520a600d99e06a.tar.gz
fsf-binutils-gdb-541b0fbbf27996443a94565503520a600d99e06a.tar.bz2
gas: Warn if SFrame FDE is skipped due to non-default return column
Print a warning message if SFrame FDE is skipped due to a non-default DWARF return column (i.e. return address (RA) register number). This may be caused by the use of CFI directive .cfi_return_column with a non-default return address (RA) register number in the processed assembler source code. Warning: skipping SFrame FDE due to non-default DWARF return column gas/ * gen-sframe.c: Warn if SFrame FDE is skipped due to non-default DWARF return column. gas/testsuite/ * gas/cfi-sframe/common-empty-3.d: Update test case to expect for new warning message when SFrame FDE is skipped due to a non-default DWARF return column. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Diffstat (limited to 'gas')
-rw-r--r--gas/gen-sframe.c10
-rw-r--r--gas/testsuite/gas/cfi-sframe/common-empty-3.d1
2 files changed, 8 insertions, 3 deletions
diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
index 52c2f3f..fac5b6f 100644
--- a/gas/gen-sframe.c
+++ b/gas/gen-sframe.c
@@ -1345,9 +1345,12 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx,
xlate_ctx->dw_fde = dw_fde;
- /* If the return column is not RIP, SFrame format cannot represent it. */
+ /* SFrame format cannot represent a non-default DWARF return column reg. */
if (xlate_ctx->dw_fde->return_column != DWARF2_DEFAULT_RETURN_COLUMN)
- return SFRAME_XLATE_ERR_NOTREPRESENTED;
+ {
+ as_warn (_("skipping SFrame FDE due to non-default DWARF return column"));
+ return SFRAME_XLATE_ERR_NOTREPRESENTED;
+ }
/* Iterate over the CFIs and create SFrame FREs. */
for (cfi_insn = dw_fde->data; cfi_insn; cfi_insn = cfi_insn->next)
@@ -1357,7 +1360,8 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx,
if (err != SFRAME_XLATE_OK)
{
/* Skip generating SFrame stack trace info for the function if any
- offending CFI is encountered by sframe_do_cfi_insn (). */
+ offending CFI is encountered by sframe_do_cfi_insn (). Warning
+ message already printed by sframe_do_cfi_insn (). */
return err; /* Return the error code. */
}
}
diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-3.d b/gas/testsuite/gas/cfi-sframe/common-empty-3.d
index 5914c62..d17521d 100644
--- a/gas/testsuite/gas/cfi-sframe/common-empty-3.d
+++ b/gas/testsuite/gas/cfi-sframe/common-empty-3.d
@@ -1,4 +1,5 @@
#as: --gsframe
+#warning: skipping SFrame FDE due to non-default DWARF return column
#objdump: --sframe=.sframe
#name: SFrame supports only default return column
#...