From patchwork Fri Sep 25 07:30:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam James X-Patchwork-Id: 144626 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 33B1D4BB58FF for ; Fri, 25 Sep 2026 07:33:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33B1D4BB58FF X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id B2EFF4BA2E3E for ; Fri, 25 Sep 2026 07:32:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2EFF4BA2E3E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B2EFF4BA2E3E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790321548; cv=none; b=uJZDme47+5wGUh8/fIMZnMLNEQqcj9PbI9ubLARGeFlJXE2DOBXzJoU0tkcqqwXq8xCwl7AT1Sv0nj1dVQ8yM7xeW3OUD+DyFTeHOAw1WM7ZzJtTQVWW2M0HaP6J6QO1AeIQQvi+N7hq49tQKmUU0ghCCycibZt2CTPd3Naw37E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790321548; c=relaxed/simple; bh=mQG/6yBCwucmUO2ayo3JACOo+yheY+woTpYsnELkTco=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qIN3r5m2YiNQW23hyi+V5SNJm68pWDLvm88vPFyVjGmdsnDrxpAjdRzmR4pH64Ienwrw4SLYXcUtM5zgsnL7W0+6lBGGbEHjb5pM7XrT2n5NCHm+BeHOAjBV31Bxp1YK3ygUFvNe/NpeXQfye8wAbAFSsaIzhk06tMLrZWwOpFQ= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2EFF4BA2E3E Received: from mop (c.1.a.0.0.0.0.0.0.0.0.0.0.0.0.0.a.5.c.d.c.d.9.1.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:19dc:dc5a::a1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sam@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id DF212341EF5; Fri, 25 Sep 2026 07:32:26 +0000 (UTC) From: Sam James To: binutils@sourceware.org Cc: Indu Bhagat , Jan Beulich , Alan Modra , Sam James Subject: [PATCH v2 1/2] binutils, gas, ld: Disable SFrames for some tests Date: Fri, 25 Sep 2026 08:30:25 +0100 Message-ID: <945ac77c9462c3d8b678ce521c978ef1288b2f3a.1790321423.git.sam@gentoo.org> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=11849; i=sam@gentoo.org; h=from:subject:message-id; bh=emQ/YBTrn+ugQoscWcBLCuR1P1KQg9X/O6F/4FvT+So=; b=owGbwMvMwCVW3ML5VeH+xAmMp9WSGLK2KSdMnl6kEDNpGmOS1f1auTDNF457pl8+znHQa9lPp WCf15yWHR9ZGMS4GGaKKbKoLtvdcXd2mU92qOMhmDmsTCBDpEUaGICAhYEvNzGv1EjHSM9U21DP EMjQMYqHyOkxaGQWF5emFummFRQ55OWXJJZk5ucV6+UXpOYVpBfopWWmlWRk5BcVpwKN0MtLLTE ydTRzcrKwcHGxdDI3M3E2czI1NTF0NjI3tjAxsHQzNTJwcbM0tDRg4OIUgLlG6QAjw9GZ79uPVv qzC+qU73mY67dKaPX7Naz5q57NvloU3xH3DKjiRxqjh3SgXO/p6IVO3A1vzNcnPVt+nlvXXVJZW 9NePJYRAA== X-Developer-Key: i=sam@gentoo.org; a=openpgp; fpr=5EF3A41171BB77E6110ED2D01F3D03348DB1A3E2 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org These break with a gas configured to emit SFrames by default. The failures are all harmless, mainly just an unexpected extra section. For the only non-trivial ones, Indu took a look at some of the PLT tests where we get a different address for .plt. She found lang_size_sections_1 () -> bfd_set_section_vma () just gets called with a different offset which makes sense given different alignment requirements/sizes. binutils/ PR binutils/33317 PR gas/33126 * testsuite/binutils-all/x86-64/compressed-1b.d: Pass --gsframe=no. * testsuite/binutils-all/x86-64/compressed-1c.d: Ditto. gas/ PR binutils/33317 PR gas/33126 * testsuite/gas/cfi/cfi.exp: Pass --gsframe=no if supported. * testsuite/gas/i386/ehinterp.d: Ditto. * testsuite/gas/scfi/x86_64/scfi-x86-64.exp: Ditto. * testsuite/gas/scfi/x86_64/scfi-cfi-label-1.d: Pass --gsframe=no. ld/ PR binutils/33317 PR gas/33126 PR ld/34671 * testsuite/ld-elf/eh5.d: Pass --gsframe=no. * testsuite/ld-sframe/sframe-empty.d: Ditto. * testsuite/ld-sframe/no-ld-generated-sframe.d: Ditto. * testsuite/ld-s390/sframe-command-line-2.d: Ditto. * testsuite/ld-x86-64/sframe-command-line-2.d: Ditto. * testsuite/ld-x86-64/x86-64.exp: Pass --gsframe=no if supported. --- v2: pass --gsframe=no in *.exp instead where appropriate to reduce the diff and avoid breaking non-ELF targets. v1: https://inbox.sourceware.org/binutils/4141bd73be6c38e7fc24c12df669398b5bad988b.1755269811.git.sam@gentoo.org/ .../binutils-all/x86-64/compressed-1b.d | 2 +- .../binutils-all/x86-64/compressed-1c.d | 2 +- gas/testsuite/gas/cfi/cfi.exp | 26 +++++++++-------- gas/testsuite/gas/i386/ehinterp.d | 1 + .../gas/scfi/x86_64/scfi-cfi-label-1.d | 3 +- gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp | 6 +++- ld/testsuite/ld-elf/eh5.d | 1 + ld/testsuite/ld-s390/sframe-command-line-2.d | 2 +- .../ld-sframe/no-ld-generated-sframe.d | 2 +- ld/testsuite/ld-sframe/sframe-empty.d | 2 +- ld/testsuite/ld-x86-64/x86-64.exp | 28 +++++++++++-------- 11 files changed, 45 insertions(+), 30 deletions(-) diff --git a/binutils/testsuite/binutils-all/x86-64/compressed-1b.d b/binutils/testsuite/binutils-all/x86-64/compressed-1b.d index 517c8145397..cc84e196973 100644 --- a/binutils/testsuite/binutils-all/x86-64/compressed-1b.d +++ b/binutils/testsuite/binutils-all/x86-64/compressed-1b.d @@ -1,6 +1,6 @@ #PROG: strip #source: compressed-1.s -#as: --64 -mx86-used-note=no --gdwarf-3 +#as: --64 -mx86-used-note=no --gdwarf-3 --gsframe=no #strip: #readelf: -S --wide #name: strip on uncompressed debug sections diff --git a/binutils/testsuite/binutils-all/x86-64/compressed-1c.d b/binutils/testsuite/binutils-all/x86-64/compressed-1c.d index ba692bdb857..6e3b3511223 100644 --- a/binutils/testsuite/binutils-all/x86-64/compressed-1c.d +++ b/binutils/testsuite/binutils-all/x86-64/compressed-1c.d @@ -1,6 +1,6 @@ #PROG: strip #source: compressed-1.s -#as: --64 --compress-debug-sections -mx86-used-note=no --gdwarf-3 +#as: --64 --compress-debug-sections -mx86-used-note=no --gdwarf-3 --gsframe=no #strip: #readelf: -S --wide #name: strip on compressed debug sections diff --git a/gas/testsuite/gas/cfi/cfi.exp b/gas/testsuite/gas/cfi/cfi.exp index de518446a13..ef3c5a70ecd 100644 --- a/gas/testsuite/gas/cfi/cfi.exp +++ b/gas/testsuite/gas/cfi/cfi.exp @@ -34,6 +34,10 @@ proc gas_x86_32_check { } { return [regexp "targets:.*i386" [lindex $status 1]]; } +if { [gas_sframe_check] } then { + set NO_SFRAME_ASFLAGS "--gsframe=no" +} + if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } then { global ASFLAGS @@ -41,7 +45,7 @@ if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } then { if { [gas_x86_64_check] } then { set ASFLAGS "$ASFLAGS --64" - run_dump_test "cfi-x86_64" + run_dump_test "cfi-x86_64" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "cfi-x86_64-2" set ASFLAGS "$old_ASFLAGS" } @@ -54,7 +58,7 @@ if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } then { } if { [is_elf_format] } then { - run_dump_test "cfi-label" + run_dump_test "cfi-label" "{as $NO_SFRAME_ASFLAGS}" } if { [is_pecoff_format] } then { @@ -119,26 +123,26 @@ run_list_test "cfi-diag-1" "" # ARC and HPPA use ';' as comment char rather than as statement separator. if { ![istarget "arc*-*-*"] && ![istarget "hppa*-*"] } then { - run_list_test "listing" "-aln --listing-cont-lines=1" + run_list_test "listing" "-aln --listing-cont-lines=1" "{as $NO_SFRAME_ASFLAGS}" } # HPPA64 uses 64-bit relocations, which results in all of the dump # offset numbers not matching up. if { ![istarget "hppa64*-*"] } then { - run_dump_test "cfi-common-1" - run_dump_test "cfi-common-2" - run_dump_test "cfi-common-3" - run_dump_test "cfi-common-4" + run_dump_test "cfi-common-1" "{as $NO_SFRAME_ASFLAGS}" + run_dump_test "cfi-common-2" "{as $NO_SFRAME_ASFLAGS}" + run_dump_test "cfi-common-3" "{as $NO_SFRAME_ASFLAGS}" + run_dump_test "cfi-common-4" "{as $NO_SFRAME_ASFLAGS}" if { ![is_pecoff_format] } then { # This test uses .subsection/.previous which are elf-specific. - run_dump_test "cfi-common-5" + run_dump_test "cfi-common-5" "{as $NO_SFRAME_ASFLAGS}" } # Some targets don't support PC relative cfi directives if { ![istarget "mips*-*"] } then { - run_dump_test "cfi-common-6" + run_dump_test "cfi-common-6" "{as $NO_SFRAME_ASFLAGS}" } - run_dump_test "cfi-common-7" - run_dump_test "cfi-common-8" + run_dump_test "cfi-common-7" "{as $NO_SFRAME_ASFLAGS}" + run_dump_test "cfi-common-8" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "cfi-common-9" if { [is_elf64 tmpdir/cfi-common-9.o] } { run_dump_test "cfi-common-10" diff --git a/gas/testsuite/gas/i386/ehinterp.d b/gas/testsuite/gas/i386/ehinterp.d index d4988261195..fd0ac9dfdef 100644 --- a/gas/testsuite/gas/i386/ehinterp.d +++ b/gas/testsuite/gas/i386/ehinterp.d @@ -1,3 +1,4 @@ +#as: --gsframe=no #readelf: -wF Contents of the \.eh_frame section: diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-cfi-label-1.d b/gas/testsuite/gas/scfi/x86_64/scfi-cfi-label-1.d index 7a1d1715262..6f59e30306d 100644 --- a/gas/testsuite/gas/scfi/x86_64/scfi-cfi-label-1.d +++ b/gas/testsuite/gas/scfi/x86_64/scfi-cfi-label-1.d @@ -1,5 +1,4 @@ -#as: --scfi=experimental -W -#as: +#as: --scfi=experimental -W --gsframe=no #objdump: -tWf #name: SCFI no ignore .cfi_label #... 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 3589b4feb15..cf5886bc080 100644 --- a/gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp +++ b/gas/testsuite/gas/scfi/x86_64/scfi-x86-64.exp @@ -34,6 +34,10 @@ if { ![is_elf_format] } then { return } +if { [gas_sframe_check] } then { + set NO_SFRAME_ASFLAGS "--gsframe=no" +} + # common tests if { ([istarget "x86_64-*-*"] && ![istarget "x86_64-*-linux*-gnux32"]) } then { @@ -48,7 +52,7 @@ if { ([istarget "x86_64-*-*"] && ![istarget "x86_64-*-linux*-gnux32"]) } then { 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" + run_list_test "scfi-cfi-label-1" "--scfi=experimental --warn $NO_SFRAME_ASFLAGS" run_dump_test "scfi-cfi-sections-1" run_list_test "scfi-cfi-sections-1" "--scfi=experimental --warn" diff --git a/ld/testsuite/ld-elf/eh5.d b/ld/testsuite/ld-elf/eh5.d index 266e6f31621..ad427fcb286 100644 --- a/ld/testsuite/ld-elf/eh5.d +++ b/ld/testsuite/ld-elf/eh5.d @@ -2,6 +2,7 @@ #source: eh5a.s #source: eh5b.s #ld: [alpha_ld_flags] +#as: --gsframe=no #readelf: -wf #target: [check_as_cfi] #xfail: alpha-*-*ecoff tile*-*-* visium-*-* diff --git a/ld/testsuite/ld-s390/sframe-command-line-2.d b/ld/testsuite/ld-s390/sframe-command-line-2.d index 941e845139d..c3cbd914bf5 100644 --- a/ld/testsuite/ld-s390/sframe-command-line-2.d +++ b/ld/testsuite/ld-s390/sframe-command-line-2.d @@ -1,4 +1,4 @@ -#as: +#as: --gsframe=no #source: sframe-foo.s #ld: --no-ld-generated-unwind-info -T no-sframe.ld -e foo #objdump: -hw diff --git a/ld/testsuite/ld-sframe/no-ld-generated-sframe.d b/ld/testsuite/ld-sframe/no-ld-generated-sframe.d index bc9396e6ff4..3b26804b9e3 100644 --- a/ld/testsuite/ld-sframe/no-ld-generated-sframe.d +++ b/ld/testsuite/ld-sframe/no-ld-generated-sframe.d @@ -1,4 +1,4 @@ -#as: +#as: --gsframe=no #source: test.s #ld: -T no-sframe.ld #objdump: -hw diff --git a/ld/testsuite/ld-sframe/sframe-empty.d b/ld/testsuite/ld-sframe/sframe-empty.d index bad08c563d1..06044eb7a1f 100644 --- a/ld/testsuite/ld-sframe/sframe-empty.d +++ b/ld/testsuite/ld-sframe/sframe-empty.d @@ -1,4 +1,4 @@ -#as: +#as: --gsframe=no #source: sframe-empty.s #objdump: -hw #ld: -shared diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 985d96dcfba..2bd75000f01 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -30,6 +30,10 @@ set emul "elf_x86_64" set saved_ASFLAGS "$ASFLAGS" set ASFLAGS "$ASFLAGS -mx86-used-note=no" +if { [gas_sframe_check] } then { + set NO_SFRAME_ASFLAGS "--gsframe=no" +} + # List contains test-items with 3 items followed by 2 lists: # 0:name 1:ld early options 2:ld late options 3:assembler options # 4:filenames of assembler files 5: action and options. 6: name of output file @@ -586,12 +590,14 @@ run_dump_test "tls-le-pic-3" run_dump_test "tls-le-pic-3-x32" if { ![skip_sframe_tests] } { + set NO_SFRAME_ASFLAGS "--gsframe=no" + run_dump_test "sframe-simple-1" run_dump_test "sframe-link-1" # Test --discard-sframe run_dump_test "sframe-command-line-1" # Test --no-ld-generated-unwind-info - run_dump_test "sframe-command-line-2" + run_dump_test "sframe-command-line-2" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "sframe-reloc-1" run_dump_test "sframe-gc-sections-1" run_dump_test "sframe-gc-sections-2a" @@ -873,8 +879,8 @@ run_dump_test "pr22048" run_dump_test "pr22929" run_dump_test "pr26939" run_dump_test "pr26939-x32" -run_dump_test "pr27016a" -run_dump_test "pr27016b" +run_dump_test "pr27016a" "{as $NO_SFRAME_ASFLAGS}" +run_dump_test "pr27016b" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "report-reloc-1" run_dump_test "report-reloc-1-x32" run_dump_test "pr29820" @@ -2405,24 +2411,24 @@ if { "x$LD_CLASS" == "64bit" } then { } run_dump_test "pltgot-1" run_dump_test "pltgot-2" -run_dump_test "pr20830a" +run_dump_test "pr20830a" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "pr20830b" -run_dump_test "pr20830a-now" +run_dump_test "pr20830a-now" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "pr20830b-now" run_dump_test "ibt-plt-1" run_dump_test "ibt-plt-1-x32" -run_dump_test "ibt-plt-2a" -run_dump_test "ibt-plt-2b" +run_dump_test "ibt-plt-2a" "{as $NO_SFRAME_ASFLAGS}" +run_dump_test "ibt-plt-2b" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "ibt-plt-2c" -run_dump_test "ibt-plt-2d" +run_dump_test "ibt-plt-2d" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "ibt-plt-2a-x32" run_dump_test "ibt-plt-2b-x32" run_dump_test "ibt-plt-2c-x32" run_dump_test "ibt-plt-2d-x32" -run_dump_test "ibt-plt-3a" -run_dump_test "ibt-plt-3b" +run_dump_test "ibt-plt-3a" "{as $NO_SFRAME_ASFLAGS}" +run_dump_test "ibt-plt-3b" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "ibt-plt-3c" -run_dump_test "ibt-plt-3d" +run_dump_test "ibt-plt-3d" "{as $NO_SFRAME_ASFLAGS}" run_dump_test "ibt-plt-3a-x32" run_dump_test "ibt-plt-3b-x32" run_dump_test "ibt-plt-3c-x32" From patchwork Fri Sep 25 07:30:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam James X-Patchwork-Id: 144627 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 878444BB58B8 for ; Fri, 25 Sep 2026 07:33:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 878444BB58B8 X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id B51034BB1C24 for ; Fri, 25 Sep 2026 07:32:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B51034BB1C24 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B51034BB1C24 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790321549; cv=none; b=Sf1DkYYsgsxuFj5q5p9a/u+NF8tua4FraEJIsCmrYYfa/wFVQzTJJf10kZCmQIVCB+QbqtQJwjN1Q0PKh2o0wB5ZiGbTFoBi9ykiQk6l3IkFbBPGR9usbO6DuNHd4rgq9HijPD1CRUmzP5jZ+2Wn5d4z9FoCloAgTCvjGbavh6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790321549; c=relaxed/simple; bh=9iiisw/fGPGPTn5Hl4u8cbFH4IYYS2vva+7bzMLdofI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=oF9pglfI+ZMt9IFdbWXvT9CcQO+fqFN3CKCiwyWV26aQzhWPg9mXc0sVT4U9gm+LZ+qxhTqPUM7hJu4sHMWwZK5OhNP3PxsiUMYku4xguU3KHvLQwIBhIsIIiVXsjLDLJg/JcDHebSlsxQoOrzJ3Wq66aYHt96t82vFc+4HWAtw= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B51034BB1C24 Received: from mop (c.1.a.0.0.0.0.0.0.0.0.0.0.0.0.0.a.5.c.d.c.d.9.1.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:19dc:dc5a::a1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sam@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 4D3AA341EF9; Fri, 25 Sep 2026 07:32:28 +0000 (UTC) From: Sam James To: binutils@sourceware.org Cc: Indu Bhagat , Jan Beulich , Alan Modra , Sam James Subject: [PATCH v2 2/2] gas: disable SFrame warnings if default-enabled Date: Fri, 25 Sep 2026 08:30:26 +0100 Message-ID: X-Mailer: git-send-email 2.55.0 In-Reply-To: <945ac77c9462c3d8b678ce521c978ef1288b2f3a.1790321423.git.sam@gentoo.org> References: <945ac77c9462c3d8b678ce521c978ef1288b2f3a.1790321423.git.sam@gentoo.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=10843; i=sam@gentoo.org; h=from:subject:message-id; bh=9iiisw/fGPGPTn5Hl4u8cbFH4IYYS2vva+7bzMLdofI=; b=owGbwMvMwCVW3ML5VeH+xAmMp9WSGLK2KSd08HswC/W07n6uaPj8Yn/At8XHNG92tF7dILP/4 vmU9uqujo8sDGJcDDPFFFlUl+3uuDu7zCc71PEQzBxWJpAh0iINDEDAwsCXm5hXaqRjpGeqbahn CGToGMVD5PQYNDKLi0tTi3TTCooc8vJLEksy8/OK9fILUvMK0gv00jLTSjIy8ouKU4FG6OWllhi ZOpo5OVlYuLhYOpmbmTibOZmamhg6G5kbW5gYWLqZGhm4uFkaWhowcHEKwFzj+JKRYfacBc06jr 2ny1qe6oXe32VpcOuwn8S+ANbYvEsP3FY1z2T4n85vZ/h6VfIv9ovJGpfsO84o6zZkm3t/KLCIX dU1wSiWFwA= X-Developer-Key: i=sam@gentoo.org; a=openpgp; fpr=5EF3A41171BB77E6110ED2D01F3D03348DB1A3E2 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org When bootstrapping Binutils in packaging, I saw: ``` {standard input}: Assembler messages: {standard input}: Warning: no SFrame FDE emitted; non-SP/FP register 10 in .cfi_def_cfa {standard input}: Warning: no SFrame FDE emitted; .cfi_escape with op (0xf) [...] FAIL: bootstrap with strip ``` Disable all the "no SFrame FDE emitted" warnings if SFrames are default-enabled: they will still appear with explicit --gsframe=yes. For distributions to deploy default-enabled SFrames, SFrames need to be opportunistic, which means not creating a lot of noise in build logs or aborting the build when SFrames cannot be generated (unless --gsframe is passed explicitly, of course). Note that this commit does not preclude the possibility of us emitting a warning in the default-enabled case in future if it's merited, just it doesn't seem we ought to in these cases. gas/ PR gas/33126 * gen-sframe.c (sframe_xlate_do_def_cfa): Disable warning. (sframe_xlate_do_def_cfa_register): Ditto. (sframe_xlate_do_def_cfa_offset): Ditto. (sframe_xlate_do_val_offset): Ditto. (sframe_xlate_do_register): Ditto. (sframe_xlate_do_remember_state): Ditto. (sframe_xlate_do_aarch64_negate_ra_state_with_pc): Ditto. (sframe_xlate_do_gnu_window_save): Ditto. (sframe_xlate_do_escape_expr): Ditto. (sframe_xlate_do_cfi_escape): Ditto. (sframe_xlate_do_cfi_undefined): Ditto. (sframe_do_cfi_insn): Ditto. (sframe_do_fde): Ditto. * gen-sframe.h (sframe_as_warn): New macro. --- v2: Same as before, just rebased. I still think this is useful for the distribution case and it makes testing --enable-default-sframe a pain otherwise. If people want the warnings, they can explicitly pass =yes. v1: https://inbox.sourceware.org/binutils/26a00c2fc394797f0863796855900a595f7e9702.1755269811.git.sam@gentoo.org/ gas/gen-sframe.c | 36 ++++++++++++++++++------------------ gas/gen-sframe.h | 8 ++++++++ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 031421d8ab7..d994940e876 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -1269,7 +1269,7 @@ sframe_xlate_do_def_cfa (struct sframe_xlate_ctx *xlate_ctx, bool bound_p = sframe_fre_stack_offset_bound_p (offset, true); if (!bound_p) { - as_warn (_("no SFrame FDE emitted; " + sframe_as_warn (_("no SFrame FDE emitted; " ".cfi_def_cfa with unsupported offset value")); return SFRAME_XLATE_ERR_NOTREPRESENTED; } @@ -1290,7 +1290,7 @@ sframe_xlate_do_def_cfa (struct sframe_xlate_ctx *xlate_ctx, { if (!sframe_support_flex_fde_p ()) { - as_warn (_("no SFrame FDE emitted; " + sframe_as_warn (_("no SFrame FDE emitted; " "non-SP/FP register %u in .cfi_def_cfa"), cfi_insn->u.ri.reg); return SFRAME_XLATE_ERR_NOTREPRESENTED; @@ -1327,7 +1327,7 @@ sframe_xlate_do_def_cfa_register (struct sframe_xlate_ctx *xlate_ctx, { if (!sframe_support_flex_fde_p ()) { - as_warn (_("no SFrame FDE emitted; " + sframe_as_warn (_("no SFrame FDE emitted; " "non-SP/FP register %u in .cfi_def_cfa_register"), cfi_insn->u.ri.reg); return SFRAME_XLATE_ERR_NOTREPRESENTED; @@ -1366,14 +1366,14 @@ sframe_xlate_do_def_cfa_offset (struct sframe_xlate_ctx *xlate_ctx, skip creating SFrame stack trace info for the function. */ if (cur_cfa_reg == SFRAME_FRE_REG_INVALID) { - as_warn (_("no SFrame FDE emitted; " + sframe_as_warn (_("no SFrame FDE emitted; " ".cfi_def_cfa_offset without CFA base register in effect")); return SFRAME_XLATE_ERR_NOTREPRESENTED; } if (!sframe_fre_stack_offset_bound_p (cfi_insn->u.i, true)) { - as_warn (_("no SFrame FDE emitted; " + sframe_as_warn (_("no SFrame FDE emitted; " ".cfi_def_cfa_offset with unsupported offset value")); return SFRAME_XLATE_ERR_NOTREPRESENTED; } @@ -1403,7 +1403,7 @@ sframe_xlate_do_offset (struct sframe_xlate_ctx *xlate_ctx, && cfi_insn->u.ri.reg == SFRAME_CFA_RA_REG && cfi_insn->u.ri.offset != sframe_cfa_ra_offset ()) { - as_warn (_("no SFrame FDE emitted; %s register %u in .cfi_offset"), + sframe_as_warn (_("no SFrame FDE emitted; %s register %u in .cfi_offset"), sframe_register_name (cfi_insn->u.ri.reg), cfi_insn->u.ri.reg); return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ } @@ -1474,7 +1474,7 @@ sframe_xlate_do_val_offset (const struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_U || (sframe_get_abi_arch () == SFRAME_ABI_S390X_ENDIAN_BIG && cfi_insn->u.ri.offset != SFRAME_S390X_SP_VAL_OFFSET)))) { - as_warn (_("no SFrame FDE emitted; %s with %s reg %u"), + sframe_as_warn (_("no SFrame FDE emitted; %s with %s reg %u"), cfi_esc_p ? ".cfi_escape DW_CFA_val_offset" : ".cfi_val_offset", sframe_register_name (cfi_insn->u.ri.reg), cfi_insn->u.ri.reg); return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ @@ -1533,7 +1533,7 @@ sframe_xlate_do_register (struct sframe_xlate_ctx *xlate_ctx, && sframe_get_abi_arch () != SFRAME_ABI_S390X_ENDIAN_BIG) || cfi_insn->u.rr.reg1 == SFRAME_CFA_FP_REG) { - as_warn (_("no SFrame FDE emitted; %s register %u in .cfi_register"), + sframe_as_warn (_("no SFrame FDE emitted; %s register %u in .cfi_register"), sframe_register_name (cfi_insn->u.rr.reg1), cfi_insn->u.rr.reg1); return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ } @@ -1555,7 +1555,7 @@ sframe_xlate_do_remember_state (struct sframe_xlate_ctx *xlate_ctx) info for the function involved. */ if (!cur_fre) { - as_warn (_("no SFrame FDE emitted; " + sframe_as_warn (_("no SFrame FDE emitted; " ".cfi_remember_state without prior SFrame FRE state")); return SFRAME_XLATE_ERR_INVAL; } @@ -1657,7 +1657,7 @@ static int sframe_xlate_do_aarch64_negate_ra_state_with_pc (struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_UNUSED, const struct cfi_insn_data *cfi_insn ATTRIBUTE_UNUSED) { - as_warn (_("no SFrame FDE emitted; .cfi_negate_ra_state_with_pc")); + sframe_as_warn (_("no SFrame FDE emitted; .cfi_negate_ra_state_with_pc")); /* The used signing method should be encoded inside the FDE in SFrame v3. For now, PAuth_LR extension is not supported with SFrame. */ return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ @@ -1684,7 +1684,7 @@ sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx, || abi_arch == SFRAME_ABI_AARCH64_ENDIAN_LITTLE) return sframe_xlate_do_aarch64_negate_ra_state (xlate_ctx, cfi_insn); - as_warn (_("no SFrame FDE emitted; .cfi_window_save")); + sframe_as_warn (_("no SFrame FDE emitted; .cfi_window_save")); return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ } @@ -1917,7 +1917,7 @@ sframe_xlate_do_escape_expr (struct sframe_xlate_ctx *xlate_ctx, || (sframe_ra_tracking_p () && reg == SFRAME_CFA_RA_REG) || reg == sframe_xlate_ctx_get_cur_cfa_reg (xlate_ctx)) { - as_warn (_("no SFrame FDE emitted; " + sframe_as_warn (_("no SFrame FDE emitted; " ".cfi_escape DW_CFA_expression with %s reg %u"), sframe_register_name (reg), reg); err = SFRAME_XLATE_ERR_NOTREPRESENTED; @@ -2143,7 +2143,7 @@ sframe_xlate_do_cfi_escape (struct sframe_xlate_ctx *xlate_ctx, OS-specific CFI opcodes), skip inspecting the DWARF expression. This may impact the asynchronicity due to loss of coverage. Continue to warn the user and bail out. */ - as_warn (_("no SFrame FDE emitted; .cfi_escape with op (%#lx)"), + sframe_as_warn (_("no SFrame FDE emitted; .cfi_escape with op (%#lx)"), (unsigned long)firstop); err = SFRAME_XLATE_ERR_NOTREPRESENTED; } @@ -2173,7 +2173,7 @@ sframe_xlate_do_cfi_undefined (const struct sframe_xlate_ctx *xlate_ctx ATTRIBUT if (cfi_insn->u.r == SFRAME_CFA_FP_REG || cfi_insn->u.r == SFRAME_CFA_SP_REG) { - as_warn (_("no SFrame FDE emitted; %s reg %u in .cfi_undefined"), + sframe_as_warn (_("no SFrame FDE emitted; %s reg %u in .cfi_undefined"), sframe_register_name (cfi_insn->u.r), cfi_insn->u.r); return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ } @@ -2362,7 +2362,7 @@ sframe_do_cfi_insn (struct sframe_xlate_ctx *xlate_ctx, if (!cfi_name) cfi_name = _("(unknown)"); - as_warn (_("no SFrame FDE emitted; CFI insn %s (%#x)"), + sframe_as_warn (_("no SFrame FDE emitted; CFI insn %s (%#x)"), cfi_name, op); err = SFRAME_XLATE_ERR_NOTREPRESENTED; } @@ -2386,7 +2386,7 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx, /* SFrame format cannot represent a non-default DWARF return column reg. */ if (xlate_ctx->dw_fde->return_column != DWARF2_DEFAULT_RETURN_COLUMN) { - as_warn (_("no SFrame FDE emitted; non-default RA register %u"), + sframe_as_warn (_("no SFrame FDE emitted; non-default RA register %u"), xlate_ctx->dw_fde->return_column); return SFRAME_XLATE_ERR_NOTREPRESENTED; } @@ -2428,7 +2428,7 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx, Start PC of a function to a known symbol in the file? */ if (xlate_ctx->num_xlate_fres > UINT16_MAX) { - as_warn (_("no SFrame FDE emitted; Number of FREs exceeds UINT16_MAX")); + sframe_as_warn (_("no SFrame FDE emitted; Number of FREs exceeds UINT16_MAX")); return SFRAME_XLATE_ERR_NOTREPRESENTED; } @@ -2445,7 +2445,7 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx, if (fre->ra_loc != SFRAME_FRE_ELEM_LOC_STACK && fre->fp_loc == SFRAME_FRE_ELEM_LOC_STACK) { - as_warn (_("no SFrame FDE emitted; FP without RA on stack")); + sframe_as_warn (_("no SFrame FDE emitted; FP without RA on stack")); return SFRAME_XLATE_ERR_NOTREPRESENTED; } } diff --git a/gas/gen-sframe.h b/gas/gen-sframe.h index 1a1f887d508..062deaa6e70 100644 --- a/gas/gen-sframe.h +++ b/gas/gen-sframe.h @@ -21,6 +21,14 @@ #ifndef GENSFRAME_H #define GENSFRAME_H +/* Warnings shouldn't be emitted for the default-enabled case, only when + --gsframe is explicitly passed by the user. */ +#define sframe_as_warn(format, ...) \ + do { \ + if (flag_gen_sframe == GEN_SFRAME_ENABLED) \ + as_warn (format, ##__VA_ARGS__); \ + } while (0) + /* Errors shouldn't be emitted either if SFrames are default-enabled, as we interpret default-enabled as "opportunistic SFrames". Users don't want to be bothered by something preventing emission of SFrames in