From patchwork Mon Jun 5 15:32:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 103350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2769160vqr; Mon, 5 Jun 2023 08:33:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+yBKEgCwnMtxo1hnQ27f12Q/XtgqVEAtB/3BBnqIVwqu5fzZ+OQAh+LGUPvuN1LiBry53 X-Received: by 2002:a17:907:6096:b0:974:6287:f67f with SMTP id ht22-20020a170907609600b009746287f67fmr6260585ejc.28.1685979196421; Mon, 05 Jun 2023 08:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685979196; cv=none; d=google.com; s=arc-20160816; b=v/Y0MzIsJ9qD/jnzGj0kg5H1cBsEQ1B7AbfiAPgDHwhVs+wdJ+IRpb+vLZRDp8HKgR DM/R3qKX/Esw8Ne6qyCWVW/WJpYoBlOSRusAOqxWJiGf8Yb7/kY0ogWxKFb0cT26zoGP hnEQt9tCtlCQSVAsZMsuggSJBKWngAC733vj5lqCzckE/7Pq8mpo0xUMaIE5IeMndfum vpue096ooVXE9gzTGibhxyqam6wPM9ykkdnhtZSEtgpcbv9TdmakgzQK/YDm4G8IYxvM oKoUFTnG9Gn3DSoc5EJjG4uIwL5hNk2gv45rF7BIPfzRo+wZkVa+y7Rh7BeKVNHqOAzc KKpA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=+w/XFqp1AH7F/ZPtN1MljK1VhBFQbFfGgkzyrv5Cwhs=; b=bKf6i64AWqXO4HRHJ9achWtcz3XrNxn6AqVO59P46JPSZ8sRIKkej0bpiVROjNOg+0 4R6BfCziavvk6rNxHQ5ueH+rOZTJaqsPWFGS8bTIbNQ2oICmUk0fvXeMGU30Oiy+RvAX xuhee6VIwHtj7RBv5DlHWl9yY8u04WdlYX0ACngrRvL1SlAT8zYZO2Ix1Q+s/w1rWdQg ugpLoquk3A+KtQizqFfY6eXTnH+re/+XTR9IJFo7WFL8Wms7jLmSWhgUClzrm6HvDT79 lAFdgEsK1NAWp3CG5E8NnsiClQnC0iZpgW4FPEshwzZ2BiEzvg74xjHMyFo3I8Ux+VM/ OgcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Nf4jMk+b; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 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 ([8.43.85.97]) by mx.google.com with ESMTPS id a5-20020a170906468500b0095ede80a90csi4984361ejr.118.2023.06.05.08.33.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 08:33:16 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Nf4jMk+b; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 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 71B453884597 for ; Mon, 5 Jun 2023 15:32:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71B453884597 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685979172; bh=+w/XFqp1AH7F/ZPtN1MljK1VhBFQbFfGgkzyrv5Cwhs=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Nf4jMk+bHULw6cPaCzk8WMpZQYlbmoVWEdcSPebmce894PpQqmBUDXZBi13XZaGmR S0iNRE9JWufUetxHFgpmI02ne3lIG556yjf53G/e6w+pK8C0xmIyGSpfLAdT37hKV5 HUDVkKH8yBlfeXc6LgdEkSD7fXMzngTZin8uWsMU= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id E844D388267C for ; Mon, 5 Jun 2023 15:32:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E844D388267C Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1b034ca1195so22383775ad.2 for ; Mon, 05 Jun 2023 08:32:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685979149; x=1688571149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+w/XFqp1AH7F/ZPtN1MljK1VhBFQbFfGgkzyrv5Cwhs=; b=AChz4v6s58g1+IfhpHIZcOo6TUqt+OcFGV8DaJRqnbknqNyY5OmNlVgg79j++eL03N 41stRRQicCWIqj84wgh6cPgLbo7olNucNsy5HLRDCvTct6buqK2bCIlLmch4DFkPLhSn /AFkZqt9uY0XOwOcW1+7JFSVlcLiSQBYVeSlBfqyD+y5k0ftaTvnu6TZXT3QtvEwy5iE +QDS97d+slNzkH+tvTun8PgsNkTVuTTb6VoTzB8BxwZisGPJkfUR7Qjy1RIUzUID5Hs5 vKbKjK1gBOpJwmmb0AKyY6R8AMi6kEQIWou0bvBQ4OvUUWueof0WQbG5bZpFBwERFS39 X6Ig== X-Gm-Message-State: AC+VfDzKw2mkpCILaqV9nysVWsMq1447c9ycbAbxc7bdxprFSUxVTrRP sqrZGpoWUaBpui742fNbhlc= X-Received: by 2002:a17:902:a9c6:b0:1ac:7f56:de04 with SMTP id b6-20020a170902a9c600b001ac7f56de04mr2977058plr.45.1685979148864; Mon, 05 Jun 2023 08:32:28 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.160.123]) by smtp.gmail.com with ESMTPSA id w14-20020a170902e88e00b001aaf370b1c7sm6740358plg.278.2023.06.05.08.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 08:32:28 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 8E99874032F; Mon, 5 Jun 2023 08:32:25 -0700 (PDT) To: binutils@sourceware.org Cc: Alan Modra , Kaylee Blake Subject: [PATCH v3 7/7] ld: Add -z nosectionheader test to bootstrap.exp Date: Mon, 5 Jun 2023 08:32:22 -0700 Message-Id: <20230605153222.1728119-8-hjl.tools@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230605153222.1728119-1-hjl.tools@gmail.com> References: <20230605153222.1728119-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3025.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: "H.J. Lu via Binutils" From: "H.J. Lu" Reply-To: "H.J. Lu" 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?1767877321632390588?= X-GMAIL-MSGID: =?utf-8?q?1767877321632390588?= PR ld/25617 * testsuite/ld-bootstrap/bootstrap.exp: Add -z nosectionheader test. --- ld/testsuite/ld-bootstrap/bootstrap.exp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp index b189a0c7098..7b70b9582c0 100644 --- a/ld/testsuite/ld-bootstrap/bootstrap.exp +++ b/ld/testsuite/ld-bootstrap/bootstrap.exp @@ -66,6 +66,9 @@ set test_flags {"" "strip" "--static" "-Wl,--traditional-format" if { [istarget "powerpc-*-*"] } { lappend test_flags "-Wl,--ppc476-workaround" } +if { [is_elf_format] && ![is_bad_symtab] } { + lappend test_flags "-Wl,-z,nosectionheader" +} set gcc_B_opt_save $gcc_B_opt @@ -94,9 +97,12 @@ foreach flags $test_flags { set testname "bootstrap" }} - # --static is meaningless and --relax is incompatible with -r. + # --static is meaningless. --relax and -z nosectionheader are + # incompatible with -r. regsub -- "-Wl," $flags "" partial_flags - if { "$partial_flags" == "--static" || "$partial_flags" == "--relax" } { + if { "$partial_flags" == "--static" \ + || "$partial_flags" == "--relax" \ + || [string match "*nosectionheader*" "$partial_flags"] } { set partial_flags "" }