From patchwork Tue Jun 6 17:58:44 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: 104006 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3575420vqr; Tue, 6 Jun 2023 11:00:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VIX28hNYagJYNtPVlLL/KzfwtaQOerTubN9vipsW2mhkYxlZpttodiMJUpQ/7vxq9nyLf X-Received: by 2002:aa7:d648:0:b0:514:a016:9cd1 with SMTP id v8-20020aa7d648000000b00514a0169cd1mr3469697edr.8.1686074434624; Tue, 06 Jun 2023 11:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686074434; cv=none; d=google.com; s=arc-20160816; b=T7/POpv9Ayfb9+QWnWaMa+8ahcW0umzQaohDfmJGzzmepgoEEwTPsIxrtN/XKc0IYw aZoq4Y3f+LVz9VUhJehjmLBmjUXYNBWIhbw/8Nm2fgCwY6SwsRV6xuri8s3xHv0pf2LQ FnsUWH5WF6mju41wz2MQ2ZrqfdRAuIyPU7rU+ua7533cKFfqd3X3+AVelp6Wi3J+i7J6 78lhzRmmQyfg2Lpl96EQ8bx3H2bco8VhMuY0Al6ZrgY38YX8Hz1H2iHDJ5HSxum28dGu PoIgEpF2LPL+VW42CD8RrCvmhZ1X2PUScqehShMXXAz2OUsqk5pgOalHMG37bUV3+45j bgbQ== 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=WmLeNY+2fK17GwoiBP8NZDydFpI6AJpiF7p5yGbPF40=; b=tQHe4S3zAFHsZJc657Ehlon8DyB3qjd8v6YxQXjV66A2fQ/VJ7HbMYNNgpMQZ+NuqL JGbN/LX7VXF1XrJXu/tKWJfBUyIvJrQcUmOtLUm0UwgBdnEnDgQA7a+gYAQJrVYINvkz QdqZL0+ssKQYLGlQ+Ctq11Rr5BAO2lTQhEpiOxhcSYsTNZJ1aecyimWRTmuehOiYb1Vs ah/nWl3fJ11ANYMLMmCnKjyknirAynJPzku4ixnJRG49pnpZtDK4f+1+AvRv/jW9kaRv xZ/L+InJKMwQf/2oSOUkDh5X3MJPG8Yg6acUe1NxjbjRuhVeRmWWyvqW0/GRQOpx1vDs 3AAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Z3QeNH36; 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 h9-20020aa7c609000000b00514a14a94e5si6915523edq.175.2023.06.06.11.00.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 11:00:34 -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=Z3QeNH36; 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 05DAB385C6E4 for ; Tue, 6 Jun 2023 17:59:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05DAB385C6E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686074385; bh=WmLeNY+2fK17GwoiBP8NZDydFpI6AJpiF7p5yGbPF40=; 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=Z3QeNH36DXryp/h4/3wDMmbrMHXuatn9lT8cs/H8oNtUStDcGP/SpwX41nL3ddRXg yh/mFA538JObYSEl2174OggyKof+JDivNMFxM7GuiUNBlLvjjGWczhImGW+Xn2JAR9 oVCApLJ7iUpO7Ijltm6k2cHaSys1eBmQd7wq27HI= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by sourceware.org (Postfix) with ESMTPS id 263D93857806 for ; Tue, 6 Jun 2023 17:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 263D93857806 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-558565cc58fso4894321eaf.0 for ; Tue, 06 Jun 2023 10:59:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686074339; x=1688666339; 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=WmLeNY+2fK17GwoiBP8NZDydFpI6AJpiF7p5yGbPF40=; b=KpIN1xKfyBlCowTbsF51DlUZeKSIA8eMMpd8BU8O8KC70V5yYko5WylrLLu7o1jAwM Hi9l0CA3FW9fo6cFOiMEjkChV7oGXydD6SODNbA/RsfTDb00n73pM93RJrh1+pMY9RJr 4sTva1YCiTNSbaHLeEMpeLMz3Ay2icDTGeQeRHVfptqHBZLCaWDUsV5qFVXwTQqcgOf7 fSSpNc0qAPTbRSnlDaZPcfa5Kx/MI9aXqfdqusrMCIvbX2dj7IkjluQA18bEOeU3YNHo 1270gswQbk63QCrZNFvQNa6EMuoCaEi9wY+m/qPkHVAC6D6aPVO8fTsjPMHiY5Tq28vd fjFA== X-Gm-Message-State: AC+VfDxXhMpWekW4wELpEz7P5qf/7YRIBxxjTRmxOedZ7QbktswJ5xQO STVabaQ1OafgIFK7QKF6n8g= X-Received: by 2002:a05:6359:2a0:b0:129:c394:ef62 with SMTP id ek32-20020a05635902a000b00129c394ef62mr488835rwb.16.1686074339335; Tue, 06 Jun 2023 10:58:59 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.160.123]) by smtp.gmail.com with ESMTPSA id g13-20020a17090a290d00b00256799877ffsm8411113pjd.47.2023.06.06.10.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 10:58:59 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 48F6674037A; Tue, 6 Jun 2023 10:58:49 -0700 (PDT) To: binutils@sourceware.org Cc: Alan Modra , Florian Weimer , Kaylee Blake Subject: [PATCH v4 5/7] binutils: Add a --strip-section-headers test Date: Tue, 6 Jun 2023 10:58:44 -0700 Message-Id: <20230606175846.399377-6-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?1767977186660842878?= X-GMAIL-MSGID: =?utf-8?q?1767977186660842878?= PR ld/25617 * testsuite/binutils-all/objcopy.exp: Run strip-section-headers-1. * testsuite/binutils-all/strip-section-headers-1.d: New file. --- binutils/testsuite/binutils-all/objcopy.exp | 5 +++++ binutils/testsuite/binutils-all/strip-section-headers-1.d | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 binutils/testsuite/binutils-all/strip-section-headers-1.d diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index f6d4d1b839e..c70a26ca42e 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1357,6 +1357,11 @@ if [is_elf_format] { verbose [file rootname $t] run_dump_test [file rootname $t] } + + # Test --strip-section-headers + run_dump_test "strip-section-headers-1" [list \ + [list source strip-15${reloc_format}.s] \ + [list as "${elf64} --defsym RELOC=${reloc}"]] } run_dump_test "localize-hidden-2" diff --git a/binutils/testsuite/binutils-all/strip-section-headers-1.d b/binutils/testsuite/binutils-all/strip-section-headers-1.d new file mode 100644 index 00000000000..dc249bba779 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-section-headers-1.d @@ -0,0 +1,5 @@ +#PROG: strip +#strip: -g --strip-section-headers +#readelf: -S + +There are no sections in this file.