From patchwork Wed Jun 21 11:09:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 110983 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4278995vqr; Wed, 21 Jun 2023 04:10:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bDsCx+ApO6UrU3+vpls6sdc3za4w58P7uvC7KV749DZqssDOALexBuEwSm2nh3sFQrkBf X-Received: by 2002:a17:907:748:b0:982:b920:daad with SMTP id xc8-20020a170907074800b00982b920daadmr13633601ejb.71.1687345810811; Wed, 21 Jun 2023 04:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687345810; cv=none; d=google.com; s=arc-20160816; b=vsHOaRPy6GDj42peTeCT4TFgeM2tZFjPqej6MLDxgm+rhsArdzeT/PU4BpwK3Q9lAa zcKsgni+xNic0In0JsDXvXjSGUmznRed75YVMbvsI2vyOE5xtjXXFgY/UtIzumejNsxH /+KoH+rCxitsohNAP08Wd/sbA6S+2nm5MSewonZxiiuLyrRHPwMakcyjK4v5MmDlnB4i rHjs4CJug1kHNSVBSs5g0k9cATkAL2fmU4NeLDjpc0kQDTm3jVVL2Li+AYhzq0/3zS9c zXcKOcB1c3m3LSJQVOVO8o/Qo8DpICM5S74HCXOFSyBSsP96q1xKPgvrRO12QRVKx7Us vwyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=aFIXRS9RbE/Ozg2Pnm6ZKD/vUF+6vBotoR/hBy94900=; b=EyWjaWjpjWl5Qg5v8/A9DdJrfEsG4aVqtkIb8tRwal8NKJPQ3qeemsh8WqSWt7u2O3 lFPHhKD4pE3Zp5B3+xvstYFeXuSBUMHl/XzrVmMkLFYpXp9enKSaSBlc7TyPsccTub6I Uv9ll4YWQ/+XNO0MnG5TZMJO7w1TOKDJ1+8inPgx+uZPUgGWB8r68t/uosjVaNKlb+dN S/QFWxBklQevpsnCsIs69ug7Msg7MM8KgFwCfoLTPTan8nlX0ZpvT5N1MfCQd6mXiH6/ CigH0L/Zh7tzwCgp/KCQ6zwgLqfZSgA5sYcfkukzl/nhxA6bbKYnSKOBxvoaHLTaNIh3 mbxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=CKeqGTLC; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r14-20020a170906350e00b0098648ae2912si2185120eja.812.2023.06.21.04.10.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 04:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=CKeqGTLC; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 767513858C66 for ; Wed, 21 Jun 2023 11:10:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 767513858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687345809; bh=aFIXRS9RbE/Ozg2Pnm6ZKD/vUF+6vBotoR/hBy94900=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CKeqGTLCRzHOxv1OMeVif6UiiI0wE/8sxOhMlMpPX8ameWz3oV+DGa+//BbBySTcD NKJSzjPgQ1H05C7ymXik1ogYeg2VpsjQx5P/7YgMv9qjeBJgGsNxVDW8vprWrzgkOI LjL4fePHisQILwApGaaecVW1zXGa2umOFt5D6a+U= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3A9693858D28 for ; Wed, 21 Jun 2023 11:10:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A9693858D28 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-546-SoyGnIiTP4OFJOw25wg8rg-1; Wed, 21 Jun 2023 07:09:59 -0400 X-MC-Unique: SoyGnIiTP4OFJOw25wg8rg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82C4C88B77D for ; Wed, 21 Jun 2023 11:09:56 +0000 (UTC) Received: from prancer.redhat.com (unknown [10.42.28.189]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 194FA2017DE2 for ; Wed, 21 Jun 2023 11:09:55 +0000 (UTC) To: binutils@sourceware.org Subject: Commit: Prune warnings about -z execstack when --enable-warn-execstack=yes has been used Date: Wed, 21 Jun 2023 12:09:54 +0100 Message-ID: <87zg4t5awt.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nick Clifton via Binutils From: Nick Clifton Reply-To: Nick Clifton Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769310321030628829?= X-GMAIL-MSGID: =?utf-8?q?1769310321030628829?= Hi Guys, Configuring the linker with --enable-warn-execstack=yes will generate warning messages even when an executable stack has been explicitly requested via the "-z execstack" linker option. Since this warning is expected, it can safely be pruned from the linker's output. I am applying the patch below to fix this, and to add some descriptive comments to the prune_warnings_extra proc. Cheers Nick binutils/ChangeLog 2023-06-21 Nick Clifton * testsuite/lib/binutils-common.exp (prune_warnings_extra): Prune warnings about -z execstack creating an executable stack. diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp index 530316e54cd..2293895a614 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -640,20 +640,32 @@ proc regexp_diff { file_1 file_2 args } { # ld: warning: /lib64/ld-linux-x86-64.so.2: unsupported GNU_PROPERTY_TYPE (5) type : 0xc0010001 proc prune_warnings_extra { text } { global experimental - # Warnings are only pruned from non-experimental code (ie code not - # on a release branch). For experimental code we want the warnings + + # Property warnings are only pruned from non-experimental code (ie code + # not on a release branch). For experimental code we want the warnings # as they indicate that the sources need to be updated to recognise # the new properties. if { "$experimental" == "false" } { # The "\\1" is to try to preserve a "\n" but only if necessary. regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*unsupported GNU_PROPERTY_TYPE\[^\n\]*\n?)+" $text "\\1" text } + # PR binutils/23898: It is OK to have gaps in build notes. regsub -all "(^|\n)(\[^\n\]*: Warning: Gap in build notes detected from\[^\n\]*\n?)+" $text "\\1" text + + # Many tests use assembler source files without a .note.GNU-stack section. + # So ignore warnings about it being missing. regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*missing \\.note\\.GNU-stack section\[^\n\]*\n?)+" $text "\\1" text regsub -all "(^|\n)(\[^\n\]*: NOTE: This behaviour is deprecated\[^\n\]*\n?)+" $text "\\1" text + + # Ignore warnings about RWX segments. regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*has a LOAD segment with RWX permissions\[^\n\]*\n?)+" $text "\\1" text regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*has a TLS segment with execute permission\[^\n\]*\n?)+" $text "\\1" text + + # Configuring with --enable-warn-execstack=yes will generate warnings if + # -z execstack is used. + regsub -all "(^|\n)(\[^\n\]*: warning: enabling an executable stack because of -z execstack command line option\[^\n\]*\n?)+" $text "\\1" text + return $text }