From a58dc5427f0a6b580e9a37a53399503325956f65 Mon Sep 17 00:00:00 2001 From: Indu Bhagat Date: Mon, 29 Jan 2024 14:22:06 +0000 Subject: x86: testsuite: scfi: adjust COFI testcase and gas: scfi: untraceable control flow should be a hard error --- gas/ginsn.c | 4 ++-- gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.d | 5 ----- gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.l | 3 --- gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.s | 24 ---------------------- .../gas/scfi/x86_64/scfi-unsupported-cfg-1.l | 2 +- gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp | 3 +-- 6 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.d delete mode 100644 gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.l delete mode 100644 gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.s diff --git a/gas/ginsn.c b/gas/ginsn.c index 5f6a67c..661f51d 100644 --- a/gas/ginsn.c +++ b/gas/ginsn.c @@ -1161,8 +1161,8 @@ ginsn_data_end (const symbolS *label) /* Build the cfg of ginsn(s) of the function. */ if (!frchain_now->frch_ginsn_data->gcfg_apt_p) { - as_warn (_("Untraceable control flow for func '%s'; Skipping SCFI"), - S_GET_NAME (func)); + as_bad (_("untraceable control flow for func '%s'"), + S_GET_NAME (func)); goto end; } diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.d b/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.d deleted file mode 100644 index 53cc124..0000000 --- a/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.d +++ /dev/null @@ -1,5 +0,0 @@ -#as: --scfi=experimental -W -#objdump: -Wf -#name: Synthesize CFI for add insn - -#pass diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.l b/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.l deleted file mode 100644 index 61c29da..0000000 --- a/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.l +++ /dev/null @@ -1,3 +0,0 @@ -.*Assembler messages: -.*12: Warning: SCFI ignores most user-specified CFI directives -.*24: Warning: Untraceable control flow for func 'foo'; Skipping SCFI diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.s b/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.s deleted file mode 100644 index 0ea32d4..0000000 --- a/gas/testsuite/gas/scfi/x86_64/scfi-cofi-1.s +++ /dev/null @@ -1,24 +0,0 @@ -# Testcase with a variety of "change of flow instructions" -# -# Must be run with -W so it remains warning free. -# -# This test does not have much going on wrt synthesis of CFI; -# it just aims to ensure x8_64 -> ginsn decoding behaves -# gracefully for these "change of flow instructions" - .text - .globl foo - .type foo, @function -foo: - .cfi_startproc - addq %rdx, %rax - loop foo - notrack jmp *%rax - call *%r8 - jecxz .L179 - jmp *48(%rdi) - jo .L179 -.L179: - ret - .cfi_endproc -.LFE0: - .size foo, .-foo diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-unsupported-cfg-1.l b/gas/testsuite/gas/scfi/x86_64/scfi-unsupported-cfg-1.l index 1e138a1..c59ba93 100644 --- a/gas/testsuite/gas/scfi/x86_64/scfi-unsupported-cfg-1.l +++ b/gas/testsuite/gas/scfi/x86_64/scfi-unsupported-cfg-1.l @@ -1,3 +1,3 @@ .*Assembler messages: .*50: Warning: SCFI ignores most user-specified CFI directives -.*52: Warning: Untraceable control flow for func 'foo'; Skipping SCFI +.*52: Error: untraceable control flow for func 'foo' diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp b/gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp index 2b29180..9005c47 100644 --- a/gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp +++ b/gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp @@ -28,6 +28,7 @@ if { ([istarget "x86_64-*-*"] && ![istarget "x86_64-*-linux*-gnux32"]) } then { run_list_test "ginsn-add-1" "--scfi=experimental -ali" run_list_test "ginsn-pop-1" "--scfi=experimental -ali" run_list_test "ginsn-push-1" "--scfi=experimental -ali" + run_list_test "ginsn-cofi-1" "--scfi=experimental -ali -W" run_dump_test "scfi-cfi-label-1" run_list_test "scfi-cfi-label-1" "--scfi=experimental --warn" @@ -67,8 +68,6 @@ if { ([istarget "x86_64-*-*"] && ![istarget "x86_64-*-linux*-gnux32"]) } then { run_dump_test "scfi-pushsection-2" run_list_test "scfi-pushsection-2" "--scfi=experimental --warn" - run_dump_test "scfi-cofi-1" - run_list_test "scfi-cofi-1" "--scfi=experimental --warn" run_dump_test "scfi-sub-1" run_list_test "scfi-sub-1" "--scfi=experimental --warn" run_dump_test "scfi-sub-2" -- cgit v1.1