From patchwork Wed May 31 20:06:17 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: 101574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3145693vqr; Wed, 31 May 2023 13:06:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4V2QH2gYOZw4ydgPNfapHpsG6j7Gom+lMAdV/kUGQlepSo2t1s6QXVlfLDGJM8O+wmi1oM X-Received: by 2002:aa7:dd10:0:b0:50c:9582:e968 with SMTP id i16-20020aa7dd10000000b0050c9582e968mr4164179edv.36.1685563617826; Wed, 31 May 2023 13:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685563617; cv=none; d=google.com; s=arc-20160816; b=SjNqGzIVgfEFCSPPyIj3lsjDBxUaKsL6ByvFGH+5i1uB3XM0+UBMSg5u7kI15Bb6PL E8eD6yqrm/UN5kZP5yM+TUzquSQ/xqbR2lNlGTwIkVX8Hl9h4CshyHIiTb71Rbirxv/O 53ljKeUGJNbzjG55HziuiFUkurpKZupB80rHZNdyyRv3rCOb2qFgwUyFUfxcBMLve839 e3XKeey00Q2H5ZUdW/gC/Yk3cX4jyY09LFptlkLOic0/x9IA8LxBhJkexEuxpXgtJ/PN qOZYgxeqz0vwqhcwEz8HsbR9RsJ6RMnm0Zv1bwRrzo6kWj2BC3gRz6S6rqCOZom2+qyK 3HwA== 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=qUosCGmCaR0+9hWQyEIfVyJLzTcAkOx6XPziPzS6XWv4OUYJ5Y4jKFx0v/YTowlPOC jzgpttQ31fSCdI4ScObV3Y4e7wI/OUKyAil867Fkv3+Rf+GqtZp38DviQdta7dH2dNBJ diMcp994VeoeVOdmVtJDWQFgPVVU5a2rCxOFXfgTsxmHc5iKChsAdl1Z27FcAUKzvA8P p3YdHgo2BIm4hpP2fVAiQxM4pCGkb3F2IK55xVxnFl3Pzk0P3qE+A6gFXJoPHrpP9GKn 8qfBGLdK2GA45FGc4+siZ4K4y1bpTsLvza5kbWCmlrdLLD9oMEapzLsuveBDYL9gI4EL mIiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Ek7mmHb1; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g17-20020aa7d1d1000000b00514a461c3a5si1152514edp.519.2023.05.31.13.06.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 13:06:57 -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=Ek7mmHb1; 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 8107A3857714 for ; Wed, 31 May 2023 20:06:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8107A3857714 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685563602; 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=Ek7mmHb1d0XgPN/GFPzYKP4AS8KzNk/Ozrwk1ZtAg68UACfehvO7PhVl5hZZtDuWs kWw2zuwF0kmxFMk+Fk8lFCDcrbrTAtmhLQSwLrgPnWMQD8xsvrpiYHxDO1nS30gZzd zK8QvUHlHVYuFrNtiws2nNrsAA0b1uAf9KHdX8Ao= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 2F8D23857B8E for ; Wed, 31 May 2023 20:06:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F8D23857B8E Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b034ca1195so407125ad.2 for ; Wed, 31 May 2023 13:06:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685563583; x=1688155583; 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=iuaNntmS4CcArAcD5TCfcinhJ/8CJSMj8RGEORFz1pZ3uT92vs0hs6yuIlRljYCrFA a4zItN8S2jRhEwr2I3UMkIxYeUFLxfrtuAdwUDwVh3nu8XJbQxjsdy1/D37GhIwKdYxB vCY/rUBYrmcLe7vOtLhl9mN/f5hLv8QLX8OAuwpCZOFkl+EVT+qAD+r7NrY6/e3XAjt3 OVSZKm1YuPULppHkXZOsde5I3Vb37Flp3h87oNF0omayuUZm7ekHSyONEMftVtKKnnA9 o9PwsvqLUCMbJbmNPSQEJgEPMSgCzrb9AdRpWqDMqreBI642ajzwO/5RPKFGP4S7lAeH 7qGg== X-Gm-Message-State: AC+VfDxm3+OipySBhp3vt0OochJrvW73Ub01Yy5jgmTyJL/zgUm5Cro8 H/cFsVcNTpIrmQ3WjnE7Ubc= X-Received: by 2002:a17:902:dac3:b0:1ac:8837:de9 with SMTP id q3-20020a170902dac300b001ac88370de9mr5548746plx.3.1685563582935; Wed, 31 May 2023 13:06:22 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.160.123]) by smtp.gmail.com with ESMTPSA id f2-20020a170902ce8200b001ac896ff65fsm1803840plg.129.2023.05.31.13.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 13:06:22 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 3AFA87402EF; Wed, 31 May 2023 13:06:20 -0700 (PDT) To: binutils@sourceware.org Cc: Kaylee Blake , Alan Modra , Andreas Schwab Subject: [PATCH v2 7/7] ld: Add -z nosectionheader test to bootstrap.exp Date: Wed, 31 May 2023 13:06:17 -0700 Message-Id: <20230531200617.951996-8-hjl.tools@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230531200617.951996-1-hjl.tools@gmail.com> References: <20230531200617.951996-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3025.3 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?1767441556478003465?= X-GMAIL-MSGID: =?utf-8?q?1767441556478003465?= 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 "" }