From patchwork Wed May 31 20:06:15 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: 101573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3145610vqr; Wed, 31 May 2023 13:06:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6i0G+UmRejHHzCCb1DcIO7UUOce2pTZbE6bwI6JYItHC4SHCHdOv4hGF4vjh49+cOtrOEc X-Received: by 2002:aa7:d3c4:0:b0:514:a6a6:facb with SMTP id o4-20020aa7d3c4000000b00514a6a6facbmr7012504edr.13.1685563608540; Wed, 31 May 2023 13:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685563608; cv=none; d=google.com; s=arc-20160816; b=AAbuFY7V676QaNqAF/J8dDiuciEvlN4i6umIUsXntk5nnWBpi1YnwCw2K5Bp0P+PIz xg6KfMtsKZTBFGHs4w3MxYbXak0IiwNdHm+lMD7Co8dCAvoU97RQuynteGSE/cElcd92 Z+Zg3mrL/f7NCqTy3Fcuyoaw+MZ3bzqhBc/LY/z3nP8siBvawkHnjRzuF4k71dVh96EI H7OknLEuJIhdymvOXXNmFRZUEMMuT+DvYIcq/agYvJWt6LaJsCmLGG4GbVPAQzRtWOH+ ehlGikmXqkq05gvw+yh1V50WrJVW7S2kODVljxXObCHyAeX1yRG8T6lIhb8nBghIIdP+ 9T4w== 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=J2Nxql9fTKJEJZOQvaJvxujAmrSfLPwX52vzzbbqP1QWMHM7K8OWQdQ5OKfxj11zMW ir2p8JAKJUAQtAj4vKhzDVNyEvl12aZQW/cs6Mi6JOSzJz/sMzWR6O1d6ZdC3RUK5J6w qWeKicFpIKBOxn7q99JiePAljYR4rNNgeZQDYrVY6NWQ14l/imDQ/Wv8peKe0aV+kBaT OhBLxmXthF4HbOF5FtpvqdU22+vxvlA3FRmncThM/z83cG2uECsGcIHCxlalYZSwIY1v cF9pMT+ArMttmx51ize8KiRv6btY8t2/u4yR/qRfomvVWnxN4of+E5jL2iYg344+Bof1 dE3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="qda1Us/n"; 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 s20-20020aa7c554000000b00514a0846d15si5308348edr.636.2023.05.31.13.06.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 13:06:48 -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="qda1Us/n"; 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 82AF03857028 for ; Wed, 31 May 2023 20:06:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82AF03857028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685563598; 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=qda1Us/nx0WTtfFq4T/LcY5ks5j+VxYy+bHIyvUXoaK/I3NCDP78OGcuwSuOhjWMw WMB9gsOphgkTDQyhLCkPvK/dR4B3ly0/etMwDuJvHO0DilOBMmxSZHKzPlugS/L1QQ yHWeLYIg0I9Gy8odzgD1kQV3OILOVXKFPSHhv3Go= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 2383D38582BE for ; Wed, 31 May 2023 20:06:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2383D38582BE Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1b0201d9a9eso1452385ad.0 for ; Wed, 31 May 2023 13:06:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685563582; x=1688155582; 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=Z5ETjNzxNOZ4FYjYDzlV0vzlALrOMmWGwgOcYdH8g72iZ72kvxFMZXoj8jjhmxQh7i 9IPM4FOCsRfJivGC3sDbORrKCfvqTrQCs6FFTwyOZ3X4pMrAzzgk917RuUNWx0kTybu5 PwRstAaLAaeE0Wz36SEW6nKg/0gt4GPonICq0dmygHFKrPEgebzysfMlu0XuHwQmo85U FH28uv+4MUWohajN4eZHXimtD0F6N4jxQoGI7oaxeneAl6U6XK/V+dAYqs7UlUk7gIdG ajwy8zMMCg34TaozkPr3e4EW4K4IzssbLWW443F47ycHexeTyOdEVxsLGurzCdVZjFgZ 2KaA== X-Gm-Message-State: AC+VfDwW97w5CAgTaVbRpMdH4ySKsOVZgspseq3C+h73ERnJYIaJ8XY9 ByeYCAhfU5LZn4hdsacO21JOsDDdedQ= X-Received: by 2002:a17:902:d48a:b0:1b1:91f1:a8b3 with SMTP id c10-20020a170902d48a00b001b191f1a8b3mr1174520plg.1.1685563581949; Wed, 31 May 2023 13:06:21 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.160.123]) by smtp.gmail.com with ESMTPSA id p4-20020a170902e74400b001b02162c86bsm1803701plf.80.2023.05.31.13.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 13:06:21 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 24A787402EB; Wed, 31 May 2023 13:06:20 -0700 (PDT) To: binutils@sourceware.org Cc: Kaylee Blake , Alan Modra , Andreas Schwab Subject: [PATCH v2 5/7] binutils: Add a --strip-section-headers test Date: Wed, 31 May 2023 13:06:15 -0700 Message-Id: <20230531200617.951996-6-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.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?1767441546153645336?= X-GMAIL-MSGID: =?utf-8?q?1767441546153645336?= 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.