From patchwork Tue Jun 6 17:58:46 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: 104007 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3576062vqr; Tue, 6 Jun 2023 11:01:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WqxTGEc6uUq5Io2K/8P/FndvG7KlZ3Q+FAMuKI0xsfoxYgyY+IIw2CNdyzbzMCkfgBHf+ X-Received: by 2002:a17:907:6da5:b0:971:fa86:27e with SMTP id sb37-20020a1709076da500b00971fa86027emr3223701ejc.16.1686074478114; Tue, 06 Jun 2023 11:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686074478; cv=none; d=google.com; s=arc-20160816; b=TeUblaIehow7VpUl/KErUQeTbnSONwf0OYnicShtuOOlsvYEKfpDk3ADWHzAvJgmcQ P6dibY1nMFAihlw/0v3oAE0ecRmeMteCEfRE4JPy5uXlkadRZJ7yemfpOki2ZVkHToWa i9v8ZQAwP5kePdcYav/8sZ8EYHM3x+tv9wkt1JQOQPuvmkUUxWBZzYJPHmEYHhv8VKpj u2cGvCh+0CTBvvS9cVg+PD3zsLNCNbJgcNEhVujY1X56Pq3spDiBLSsGhjQwhrKg4Fhw oIGIDJVbXtMa1hVb7ankR0ax+Owid3nm6nD2VtZMvK6/IAijQz0HB0dTlXhOPWH5RJdz 2MKg== 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=QRafgL0tip2qbl98Lu0BqZBpOyrQFWVsMgGWTfAajvCTpikg8277OXyGtJi8EgXWGm RolDqoAwPBcWHdLE5IjOXZPWfKO+DW8/TYYN3tlkc2dgXInBAm0NrOmJsVbJC+6wPduF RFb48lwohnXNKMlDHHKuHmyaXxgBsmjdD4sIQB2kcsZzLm/ZijGh0DYjT6Txh3ZrzDDe WjWTyWxqAD8JcEIcLLFwxMXJaMAzAZJ1muS7wFFd7h+o5naKNDDfp+vIYK+T7VZLAUkT lPq4/e4UIo6LpLFaQuL3ftlELqPxklC++spgs4h9t4ClIOienb0rVEQdmvJo1y/GuB1Q UJrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ml3Mw4Eq; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id i21-20020a17090639d500b0096f61c1ac62si6411222eje.76.2023.06.06.11.01.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 11:01:18 -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=ml3Mw4Eq; 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 875D83856DCA for ; Tue, 6 Jun 2023 18:00:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 875D83856DCA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686074401; 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=ml3Mw4EqTGx9Ngt3H4a5fEVVa5FUZxsV0zI4MxtGTOnRpjA9lwxpnxkdmx0ZmQYoo ub+qEnHhcWiAbFJeQBEYJc6qPr1n/+NCd5Nll5BA+I+f4AX0BEhqa0MvjnouleVLXA vDpXeZy1d+t3JhXkPyLSr1CDMsD01G8DsOfeiJvE= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 007F338582BC for ; Tue, 6 Jun 2023 17:58:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 007F338582BC Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-64d24136685so4669076b3a.1 for ; Tue, 06 Jun 2023 10:58:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686074332; x=1688666332; 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=Zhew2z0xtUzAlnQnPX7pq76FlJvqIm9djZasjytQIh/UXz4UHhvs+1/O0okwlIlUhk 0KdnpW2a/tZNqSCUnW7hsT9em/xtE74XasGQQV6Uitui+OtRNy4sT15YJGcwmSMF7/72 67tL82mmNeygqMeh6t8a5ell6jQxzVZwMzMXLTWZlspQTvzU+Js5Ulqj6oy1BLpqRB6S 09NpFqEtiiohH/ZbBlTMdG1/Kr6Q1xn/cjNu7a3ujoPZVT+CxLnEMkEopTVHey9rqXJZ pBXEsS/k2ChiiLKMLDfCH3SIMvqLkK0+k+c3r37y6ySSXI/+MoO9iGe2W37c7wlbS5vz Ek4w== X-Gm-Message-State: AC+VfDxi9+e8QeHh5+fBWW+Z+Y/cgyaleYf6aD7LTd+BkbTWhzde22gz nIQ9Z9MmoTpNuODxdUxaHCI= X-Received: by 2002:a05:6a20:42a9:b0:10c:322:72d5 with SMTP id o41-20020a056a2042a900b0010c032272d5mr449043pzj.23.1686074332012; Tue, 06 Jun 2023 10:58:52 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.160.123]) by smtp.gmail.com with ESMTPSA id x53-20020a056a000bf500b0064d59e194b3sm2545204pfu.113.2023.06.06.10.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 10:58:51 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 5F29674037D; Tue, 6 Jun 2023 10:58:49 -0700 (PDT) To: binutils@sourceware.org Cc: Alan Modra , Florian Weimer , Kaylee Blake Subject: [PATCH v4 7/7] ld: Add -z nosectionheader test to bootstrap.exp Date: Tue, 6 Jun 2023 10:58:46 -0700 Message-Id: <20230606175846.399377-8-hjl.tools@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606175846.399377-1-hjl.tools@gmail.com> References: <20230606175846.399377-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?1767977232083275456?= X-GMAIL-MSGID: =?utf-8?q?1767977232083275456?= 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 "" }