From patchwork Tue May 30 17:12:50 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: 101022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2335301vqr; Tue, 30 May 2023 10:14:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ubi5O/klOOlpZzNCw7Lhm/bcJylDF55YhUPShyeRRimV3hNakQe94j7JTRLke71CFeaka X-Received: by 2002:a17:907:3e81:b0:974:1eb9:f750 with SMTP id hs1-20020a1709073e8100b009741eb9f750mr3614313ejc.36.1685466878311; Tue, 30 May 2023 10:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685466878; cv=none; d=google.com; s=arc-20160816; b=tdQWbYK699+Q+Tn0kI0yWsHNrdVCThW0gci98EDUZdcunbArBy5Qsjj92fQKLQfp6c dQHNXybotjV4+hEiwx1cxmHjHg8RYNe/ATA/s/ogp78NifVcTPmiVYXN+3416Te3UUFZ Unrdy0ex9I8j3QAvv1pRdgRkQT5ApSwhRCic7yOrHybuutyFH4OKFZ+DDmqw9MFAJuZr Ppm9Cw5Ft9AhtXO9Td7DbRBhiE3oT8rUhwAgb1d/xp/4mr8SoVBiRMNyaOwjDIeTwbWl FKZgTB0zAZo3k5Bsp2i59ORrTwFeYQi1gpH+4w38+PhJI0CCSuhRULodtZjzY5MPjEgM Fh2A== 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=Xaf0X4Kuw3Z5IzzCvb+hJGSCbyiH/+P2KKksCgp6glE=; b=MSXu/pYDQ2tw8jWeCXbS7W4fEhVKzLeW+KpAvzdpl/+H4dnEJpqEBD2vnRFWC4/6VZ lN6+GuH5sgpCL2t+n2TrLU3lDa7URTazokP34ogLCP+Wt7sXxjly0Xs9dKAn7b99He8P fN7E70DN2jfrsLK+m+Vm3va6Q+by7cKqmtaSzrCakF+XFSFfxa2R+UuZ1rdS5a8h6/PN tD7LWsbbTZAb1/nwP9q9kw+J1tt/Bc1rDgUT3swvddcrtPnNbSndEZrES1QuQsInH5mT +AggojKbZ3fIB1rF+zAtaOjvZ1VV0eJXh0SMqgSqWQFWihhQgBZdK3+4VeXHiFPMd49I u1ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="yPu/Ca7z"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gv50-20020a1709072bf200b00969ea55d647si873723ejc.92.2023.05.30.10.14.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 10:14:38 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="yPu/Ca7z"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 A49243856DC2 for ; Tue, 30 May 2023 17:14:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A49243856DC2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685466843; bh=Xaf0X4Kuw3Z5IzzCvb+hJGSCbyiH/+P2KKksCgp6glE=; 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=yPu/Ca7zPBub4MOENKiMVWlZxTB3A7536JyIWnclG8OTpKAJ69h05nERy+d7pAQyU Whr11YTCvRHeFInbw8MWB4xz3aI2XhTXzw7nWog6a3PzCSTx3qze0fml0YJErOcJxL JOl21F2mv1lu3hqPIIcppKcMBcthSoEamX/QAMSA= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 452473856DE6 for ; Tue, 30 May 2023 17:13:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 452473856DE6 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-64d2f99c8c3so3455470b3a.0 for ; Tue, 30 May 2023 10:13:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685466796; x=1688058796; 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=Xaf0X4Kuw3Z5IzzCvb+hJGSCbyiH/+P2KKksCgp6glE=; b=B8fdpkkfcBdljULuPmaj5FFUrVbkrCA2i56MjL9dDlI8jvc7hcUCAQon91Ok7UHk73 xwcBIBUAl2SqwCd7Hsv2qpSDy4/h6cbaWHyFeTJAG56tqir5GApWAdzR/z5lXe4LLs35 X9LQTrit00Cyo3SZn04tA4I/TEgakcVgOb+iK64RwvAwBg6M14T/91wfHMWAP6yNrLnZ 3JSp1JlEJOiXKx9bFV8oYm+C4xn5QwuJwclPGOFjiMRAF6+HrsAVRdDCinrb3sPfFP+b oKb5EHcQOTxd5+UauQRf7GLPbDESqELCKVfJNH8kPORDS+tdrJG+3OWwPy5HVma6+324 nDlQ== X-Gm-Message-State: AC+VfDxYAisQJWhMu23uXL6vl8zROm2OCrIMcODCe0BCA2Sv0c2htx+W rkzbhlLllZTRf+3D8z5HB0I= X-Received: by 2002:a17:902:8503:b0:1ae:4bbb:e958 with SMTP id bj3-20020a170902850300b001ae4bbbe958mr2884377plb.14.1685466796153; Tue, 30 May 2023 10:13:16 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.160.123]) by smtp.gmail.com with ESMTPSA id bf5-20020a170902b90500b001b0772fe3fdsm363726plb.265.2023.05.30.10.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 10:13:15 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id B7E937402E8; Tue, 30 May 2023 10:13:14 -0700 (PDT) To: binutils@sourceware.org Cc: Kaylee Blake Subject: [PATCH 4/6] binutils: Add a --strip-sections test Date: Tue, 30 May 2023 10:12:50 -0700 Message-Id: <20230530171252.269552-5-hjl.tools@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230530171252.269552-1-hjl.tools@gmail.com> References: <20230530171252.269552-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3024.8 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?1767340117428333641?= X-GMAIL-MSGID: =?utf-8?q?1767340117428333641?= PR ld/25617 * testsuite/binutils-all/objcopy.exp: Run strip-sections-1. * testsuite/binutils-all/strip-sections-1.d: New file. --- binutils/testsuite/binutils-all/objcopy.exp | 5 +++++ binutils/testsuite/binutils-all/strip-sections-1.d | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 binutils/testsuite/binutils-all/strip-sections-1.d diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 361e430f119..d39ea141a3a 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-sections + run_dump_test "strip-sections-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-sections-1.d b/binutils/testsuite/binutils-all/strip-sections-1.d new file mode 100644 index 00000000000..76b1dd69c70 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-sections-1.d @@ -0,0 +1,5 @@ +#PROG: strip +#strip: -g --strip-sections +#readelf: -S + +There are no sections in this file.