]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: sframe: Add test for signal frame with unsupported CFI
authorJens Remus <jremus@linux.ibm.com>
Wed, 12 Aug 2026 12:39:50 +0000 (14:39 +0200)
committerJens Remus <jremus@linux.ibm.com>
Wed, 12 Aug 2026 12:39:50 +0000 (14:39 +0200)
Usually if the generation of SFrame from CFI directives encounters
unsupported CFI the generation of SFrame FDE is skipped.  For signal
frames (.cfi_signal_frame) an "empty" FDE without any FREs is generated
instead.

This adds a test for the issue fixed with commit fa11363bc9ad ("Ensure
that sframe_xlate_ctx_cleanup() doe snot leave any dangling pointers").

gas/testsuite/
* gas/cfi-sframe/cfi-sframe.exp (cfi-sframe-common-14): Run
new common test.
* gas/cfi-sframe/cfi-sframe-common-14.d: New common test for
signal frame with unsupported CFI.
gas/cfi-sframe/cfi-sframe-common-14.s: Likewise.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
gas/testsuite/gas/cfi-sframe/cfi-sframe-common-14.d [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe-common-14.s [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe.exp

diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-14.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-14.d
new file mode 100644 (file)
index 0000000..dcceab8
--- /dev/null
@@ -0,0 +1,20 @@
+#as: --gsframe
+#objdump: --sframe=.sframe
+#name: Signal Frame with unsupported CFI
+#warning: \.cfi_def_cfa_offset with unsupported offset value
+#...
+Contents of the SFrame section .sframe:
+
+  Header :
+
+    Version: SFRAME_VERSION_3
+    Flags: SFRAME_F_FDE_FUNC_START_PCREL
+#?    CFA fixed FP offset: \-?\d+
+#?    CFA fixed RA offset: \-?\d+
+    Num FDEs: 1
+    Num FREs: 0
+
+  Function Index :
+    func idx \[0\]: pc = 0x0, size = 4 bytes, attr = \"S\"
+    STARTPC + CFA + FP + RA +
+#pass
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-14.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-14.s
new file mode 100644 (file)
index 0000000..9d6cf2a
--- /dev/null
@@ -0,0 +1,5 @@
+       .cfi_startproc
+       .cfi_signal_frame
+       .long 0
+       .cfi_def_cfa_offset 1099511627808
+       .cfi_endproc
index ba6cbc13f72ae44085c612987b3148c016bcb8be..d7418726f274212148872d39dbe5ac34cb03d750 100644 (file)
@@ -50,6 +50,7 @@ if  { ([istarget "x86_64-*-*"] || [istarget "aarch64*-*-*"]
     run_dump_test "cfi-sframe-common-11"
     run_dump_test "cfi-sframe-common-12"
     run_dump_test "cfi-sframe-common-13"
+    run_dump_test "cfi-sframe-common-14"
 
     run_dump_test "common-empty-2"
     run_dump_test "common-empty-3"