From patchwork Mon Jun 5 15:32:20 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: 103353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2770320vqr; Mon, 5 Jun 2023 08:35:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Joj+0OXk4NrZRBSnj9c7VyWNMTweLeNVnABAtS9QrD5PJDFrjZjGH5iWOR4J+dhG1cL5q X-Received: by 2002:a17:907:318d:b0:973:cc48:f19d with SMTP id xe13-20020a170907318d00b00973cc48f19dmr5755705ejb.52.1685979317883; Mon, 05 Jun 2023 08:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685979317; cv=none; d=google.com; s=arc-20160816; b=HPqjvGElI4qz4qpXVjLxIzd8QELKzUZnCpouxzmGpucsfXDpDaVldYw90lScsYqc4V 3qbK2pJMGiQTiWLojubdxftw2+DQotDgDNc1wNVTTr6Q6B6tvzip8wjDWbGaLBMV/0oi M9a+F0OTjjonRCwbGSJl/98eYb9QFTHKvroOJvqqLPjQ8RMw8zvv71K9P+CBB6T1UoQ0 7pAUWt8Sds5N4aWfGkrnpozR4hrnoak2vY0uzlb9pDuql38PcEk1fHA6+5gc63UOmxvY 2799Pyhf+Z8zWv+zAgPg0QVsizpHAOD+pJ6+jSl+4ejz41q14aa7VnmeANjedCyx6nCQ +pYQ== 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=3NebJodlTK/aIxR1FEY9wWCkgktAeuE9OS3qU6NmmnY=; b=lhbog4P8kDZziVBXkz5h0LBp4kX1KAnCwAcUdngv6Pqm+LNbNIcNDVSmm8p5eCDGx7 wDzHuD7xnZFH3HsAyXSa6Yc9qT5zCQ1C5YjOon1+VzDMwat+oreCbfEjOJj+5i55mzNE wqI5DnRPz8sYDSmMh9YR+uEmLTMozmVLJp/+igqb6dXbVGbowgXUfDo0sAkszThwtKlS RSdJomrdRV1xLAf4cFbimQgARNfJorGVkZEBX/Quf+1bFFhFNptMncEXeZ0lp6bZfpMJ 0B2S97wCS7tNlf5jTmmdNpCyKAUBy2pbdIBhd9gQNygUHCX69ErLfu6bTvGA9olcBrgg PWTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ywdtnsf0; 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 ds13-20020a170907724d00b00977c582289dsi3697084ejc.244.2023.06.05.08.35.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 08:35:17 -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=ywdtnsf0; 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 D4A4E3894C2E for ; Mon, 5 Jun 2023 15:33:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4A4E3894C2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685979220; bh=3NebJodlTK/aIxR1FEY9wWCkgktAeuE9OS3qU6NmmnY=; 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=ywdtnsf0ae773Lve3firiIAJAuSwghEP24NCW4MS5EaaNt6UAskEF2KWwPg23HVL3 69PiVycwfzTDPgWC/AwcmKUMzRkrGemTaUZaiLX3TS0lHmICG35XSE3NDINMVjLINs Pf7ZxVDp6setSgGo1hOVK6jkcSzTDjA3fCHbqSMM= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 643AD3882654 for ; Mon, 5 Jun 2023 15:32:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 643AD3882654 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-651f2f38634so4434252b3a.0 for ; Mon, 05 Jun 2023 08:32:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685979147; x=1688571147; 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=3NebJodlTK/aIxR1FEY9wWCkgktAeuE9OS3qU6NmmnY=; b=ghk2AoSQHaVfJzqkqMbyViUxJPTDATeCmKt2Tk/QZYM7/prNyB6HdnTYvvpP1q2rJv x2x1XCvdPgwWICd/eRdTcPbDrb8XkuHFvDbezwAc8pURjlIvzV63gBysTVwvBplKflLV +xNaPn2FxbrS60kyeZI3b+UkkKHMnNyYT6fQcTxKegqM0OgTCi7GhuoXrRnXl9RXGaZD 1Unaz26rLOej3OzWCX8yzY7ElgqRJw8YVDdi/HQy8Ncp3tsXtugYcppWlrb7xd0irqfO jg6IX0IAfnBOYuZWIjzp4ZtavmDx9xYJh5qVOHNfbnxImFsadRWrVSSPHhdHBFuaV6qm gHyQ== X-Gm-Message-State: AC+VfDyJR8HEclbnqFJg1cYWpfDS5/g0KdEPva6DI+MxLkAF8GPmQGoS aQlzzrunKmoCESF7gNFGKzujreURyh8= X-Received: by 2002:a05:6a21:2c87:b0:10b:3b0d:b05c with SMTP id ua7-20020a056a212c8700b0010b3b0db05cmr6789272pzb.28.1685979147405; Mon, 05 Jun 2023 08:32:27 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.160.123]) by smtp.gmail.com with ESMTPSA id p13-20020a635b0d000000b0050f93a3586fsm5890430pgb.37.2023.06.05.08.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 08:32:27 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 78AA074032C; Mon, 5 Jun 2023 08:32:25 -0700 (PDT) To: binutils@sourceware.org Cc: Alan Modra , Kaylee Blake Subject: [PATCH v3 5/7] binutils: Add a --strip-section-headers test Date: Mon, 5 Jun 2023 08:32:20 -0700 Message-Id: <20230605153222.1728119-6-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?1767877449104459055?= X-GMAIL-MSGID: =?utf-8?q?1767877449104459055?= 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 361e430f119..41add0fecda 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.