Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp57179ybv; Fri, 21 Feb 2020 23:02:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyD3g3lyE31Npw5777/18ulbynsziPg7XJMGm4Y0Ha+uD7wfSiRsgYrgwLcSF45dcjFXKEN X-Received: by 2002:a05:6830:1e72:: with SMTP id m18mr29727000otr.226.1582354971981; Fri, 21 Feb 2020 23:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582354971; cv=none; d=google.com; s=arc-20160816; b=QghdR7cUmxHcSvfSGV1WXN1RXNwenOThkndBb/3yYleY/bYXtOf/nM1u6XWlwbA1b1 rptp8Alji70Eypv6P13p0KyV86oykuJvquXGBlc4af21XI691prks7n5JrVbETrcNJwx lxG79QchtcK5ex2dUrTGsoO6CuCvryU68juyyWraa94SdeTu2QQITG023O0BWWTgpsSb GBL9J0v0Lp+ueAcLK0N/dp4FWIvREvbYdAip7l/Hz9SYsxGijcTkNauIMPNH+B2QaZe2 3qLW56DZA+HegMv26ilUT0WjyBR/ZdhvWG+Xot9TI6F1cjIhOc1f/FaHQ0VaVlagQQ6X 0nWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wp8VhtMOgSbmaayvgbvSF3iGsyK4mtaSOsHdOnwnL5c=; b=mL3EmMNATysUIOLOrva+WLKlgNLXjDuOus7NzQy4BFIqpeMaHcOA7zgaiZBzo4uM0v HPeOZXRUIrAv/a3Aq8IIlpudV9tlzTyi8Wx38xnIDY20QeUAYF9Rr3jbwNWZQjThcMvG li5wa6Qx1XqTaNnKDKRBCAqPIbTF6Y9FSgiMzH4JBOR0NJMkUJc2cUQxoan4+WhuEtP0 fyYNNj//iJftjb3qhsnHgYs37VjfVhw1hFEK20w6U4lagyY1xP4dSFxdWRdcCxcPJeqy k2BJixE9mPCRwb820ZSFrxdd4H/jpa4buqUvHHEcnzfs48qwrVa9NhHrpJC+1HSqNts2 2qyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cdNs98hU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o15si2767061otp.314.2020.02.21.23.02.38; Fri, 21 Feb 2020 23:02:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cdNs98hU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727093AbgBVHCX (ORCPT + 99 others); Sat, 22 Feb 2020 02:02:23 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:33102 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgBVHCX (ORCPT ); Sat, 22 Feb 2020 02:02:23 -0500 Received: by mail-oi1-f194.google.com with SMTP id q81so4026376oig.0 for ; Fri, 21 Feb 2020 23:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wp8VhtMOgSbmaayvgbvSF3iGsyK4mtaSOsHdOnwnL5c=; b=cdNs98hUFMWKQv+dkcrjJVcyz6Jrh7Fa4M+rs/3ujLEjcYxm4Pt6YxKRRZKOTh99uR ul+OKf7FzlidVyjBcfPtCBEk7c1MERz+tNqiGCsn3xLZIFFXYHZ9665is2WpOzxzHPuE cdyPHW5wzDvaMDcARa7L/FQOign/yosAi5L47iVU44S/DUKVorHSOG+mA7w7y1ZkZ6md pzvfE4NPDYrczj4/gOoV/ew1CQcRGIzIRvXv9gq+Vz8BzWgTnEf2VB7SRr/6eiNhAzAK JFEPzWLeeD3IkwJGthrM7hTsb8MnnbL6KgSvhnOHpgFQ5p5iPHptC/kzYb47aV4fDN/4 KkkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wp8VhtMOgSbmaayvgbvSF3iGsyK4mtaSOsHdOnwnL5c=; b=MZzlovc4JFC/8V3tQfbdH14rbBOypZS20S/9NW6Q+Z8ZAotI3rpjRO1vqm0mAOf7vg wuPext/L7b0b2vENf6q2EZAqHcmdeKTuwgZb75B5xy48vb7Bw7RF1ByopShZGzJoxgcc cjW3GW/4r/PGUhQheyMTTUwZnLm5hcAwJoGmJWsVWAqd6v04HPfvlyeaXSg7Ki4wPu5i S4Jz//OPTyNmHr4eXkav03BaStaJPN3sgdTwiLMD3Baz7wEYER0HK2cOg+8e+si1fShD JN7urb8gYjKg+qrMnoLmutQJvY+zboDQnpYB+V57Qol8qabMGu9q3Zl5VOAMMHcMxPoh XBFQ== X-Gm-Message-State: APjAAAWVfIfStetq9TDEIKND8YSuhFf+Dpc6AH93G0UoKshbF4rSqhrr V+AdVRcWLHeChFLLNrvGl2U= X-Received: by 2002:a05:6808:3ae:: with SMTP id n14mr5256926oie.63.1582354940912; Fri, 21 Feb 2020 23:02:20 -0800 (PST) Received: from ubuntu-m2-xlarge-x86 ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id j13sm1743835oij.56.2020.02.21.23.02.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Feb 2020 23:02:20 -0800 (PST) Date: Sat, 22 Feb 2020 00:02:18 -0700 From: Nathan Chancellor To: Borislav Petkov Cc: Arvind Sankar , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Michael Matz , Fangrui Song Subject: Re: [PATCH 2/2] x86/boot/compressed: Remove unnecessary sections from bzImage Message-ID: <20200222070218.GA27571@ubuntu-m2-xlarge-x86> References: <20200109150218.16544-1-nivedita@alum.mit.edu> <20200109150218.16544-2-nivedita@alum.mit.edu> <20200222050845.GA19912@ubuntu-m2-xlarge-x86> <20200222065521.GA11284@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200222065521.GA11284@zn.tnic> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 22, 2020 at 07:55:21AM +0100, Borislav Petkov wrote: > On Fri, Feb 21, 2020 at 10:08:45PM -0700, Nathan Chancellor wrote: > > On Thu, Jan 09, 2020 at 10:02:18AM -0500, Arvind Sankar wrote: > > > Discarding the sections that are unused in the compressed kernel saves > > > about 10 KiB on 32-bit and 6 KiB on 64-bit, mostly from .eh_frame. > > > > > > Signed-off-by: Arvind Sankar > > > --- > > > arch/x86/boot/compressed/vmlinux.lds.S | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S > > > index 508cfa6828c5..12a20603d92e 100644 > > > --- a/arch/x86/boot/compressed/vmlinux.lds.S > > > +++ b/arch/x86/boot/compressed/vmlinux.lds.S > > > @@ -73,4 +73,9 @@ SECTIONS > > > #endif > > > . = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */ > > > _end = .; > > > + > > > + /* Discard all remaining sections */ > > > + /DISCARD/ : { > > > + *(*) > > > + } > > > } > > > -- > > > 2.24.1 > > > > > > > This patch breaks linking with ld.lld: > > > > $ make -j$(nproc) -s CC=clang LD=ld.lld O=out.x86_64 distclean defconfig bzImage > > ld.lld: error: discarding .shstrtab section is not allowed > > Well, why is it not allowed? And why isn't the GNU linker complaining? No idea, unfortunately I am not a linker expert and the patch that changes this in lld does not really explain why it adds this restriction: https://github.com/llvm/llvm-project/commit/1e799942b37d04f30b73f6a9e792d551dadafeea CC'ing Fangrui as I don't know George's email and he is usually responsive to ld.lld issues/questions. Cheers, Nathan