From patchwork Wed Jun 21 10:47:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 110979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4266975vqr; Wed, 21 Jun 2023 03:47:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6El+vav5UmI3Fg779CHoyoeTYEtHhZKfQ+Nzh0RT6vBbn/RVNHH0xRH46eSVKb6qlyzysJ X-Received: by 2002:a17:907:a40a:b0:989:6749:d61 with SMTP id sg10-20020a170907a40a00b0098967490d61mr2234705ejc.19.1687344438265; Wed, 21 Jun 2023 03:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687344438; cv=none; d=google.com; s=arc-20160816; b=hr8ddIYkxOOnWPI1ov/rBMP8Khx9OvTPW48+bjwIH7KU0yqInXMQzLEkucVXSYjgzP d64PK5fT0A04kVU+h+EGZNBvg7IC6LXbXEPrTdHmyIcP9pnHj6LoPpW//+Tay5ZpBEJU ZNYEUJ7k7xKoJ8REcxM9EJ5qPChzRLNeMBLH/cp/2g5N+bdl9ql38aPzQY2hH8W+om8s SvGymirHJQUKwxvXNr0PfcQeueMxt+dtnIGTIexFhZSFDhiQEgW8vrTrrlX32Cu2CEhA N3FgAZJQbvS5r8eUqDIx1vQGxT5R8ZFyfvE2fIBV3ikqRC+d+cJRKkLTZMmZemY2TjRd 9Auw== 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=V9xJxAcPabQ9+abXOapWADwg04TM8ad0+mMnulOu+cM=; b=WaRYcSzMtLCpPCKRyN4tw3JbNpmLSXgOV/j+9cEQGcdiPJiN8ubiCikC/ZB+Iu5As8 dQw3Ntf1j4n6N4+jiDNCsnYvaCNlkDB1pxiBOFixObX+wKuId1+15sxEtpsrsz8h5FS2 gjl45XC/KNzCqxigKpkUE9GCzH53vtAKg2zgwvw+cSvU+1Kk6KRbPYVQAXkyeG8flQ8G qjiP1TUZ00i+CrVxz9A9eQfqhkHz3XwvDjh9TgqK5Df859nIc6kLKbPNZIM+IplW19A6 pNu8aOKNlOKdj2suty+T4zUxH9Ut0EECIJJeN8Je8H7R86aPFk+9M3Hyh7jA8Tvw7nFJ WSHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=MoYRm3+i; 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 g6-20020a170906c18600b009864522956bsi2068762ejz.94.2023.06.21.03.47.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 03:47:18 -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=MoYRm3+i; 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 DC3C3385842A for ; Wed, 21 Jun 2023 10:47:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC3C3385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687344434; bh=V9xJxAcPabQ9+abXOapWADwg04TM8ad0+mMnulOu+cM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MoYRm3+iBiN4athxhkjPAfKyoKu13hso3AMbAw4a2vBYKvIukSalB5DMIRL8fyoj+ QRV/MsegnerrmOqDsqE0ng/2qGFdkJ+Ci6hB8b1fXGJy4jwpE0ynuPs6W5RbnsLT8f KAReUoV3uCRPvo/Srl0CC1TjrRTqJ9lx6/HmjRZ0= 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 6B5423858025 for ; Wed, 21 Jun 2023 10:47:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B5423858025 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-588-_YoawWsUMSqwPn2wD8BrbQ-1; Wed, 21 Jun 2023 06:47:05 -0400 X-MC-Unique: _YoawWsUMSqwPn2wD8BrbQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C98229DD983 for ; Wed, 21 Jun 2023 10:47:05 +0000 (UTC) Received: from prancer.redhat.com (unknown [10.42.28.189]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13EC04087C70 for ; Wed, 21 Jun 2023 10:47:04 +0000 (UTC) To: binutils@sourceware.org Subject: Commit: Fix PR 29072 test with --enable-default-execstack=no Date: Wed, 21 Jun 2023 11:47:03 +0100 Message-ID: <87352l6qjc.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-9.9 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?1769308881309372361?= X-GMAIL-MSGID: =?utf-8?q?1769308881309372361?= Hi Guys, I noticed recently that if the linker is configured with the --enable-default-execstack=no option, then the target_defaults_to_execstack proc in the linker testsuite can return the wrong value for targets that enable executable stacks by default. So I am applying the patch below to add some code to the proc that checks the linker's config.status file for the configure option. I realise that this will not work if the tests are being run on an installed version of the linker, but I could not think of any other way to perform the check. Cheers Nick ld/ChangeLog 2023-06-21 Nick Clifton PR 29072 * testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Always return false for linkers configured with the --enable-default-execstack=no option. diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index cf0e949a966..a367cf41e95 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -180,6 +180,21 @@ if { [check_gc_sections_available] && ![istarget "v850-*-*"] } { } proc target_defaults_to_execstack {} { + global base_dir + + # If the linker has been configured with --enable-default-execstack=no then + # this proc should always return 0. + if { [file exists $base_dir/config.status] } { + set status [remote_exec host grep "enable-default-execstack=no" $base_dir/config.status] + if { [lindex $status 0] == 0 } { + return 0 + } else { + verbose -log "$base_dir/config.status does not contain enable-default-execstack=no" + } + } else { + verbose -log "there is no file $base_dir/config.status" + } + if { [istarget "aarch64*-*-*"] || [istarget "arc*-*-*"] || [istarget "cris*-*-*"]