Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2675603ybv; Fri, 21 Feb 2020 21:09:47 -0800 (PST) X-Google-Smtp-Source: APXvYqyTwngyy8F4TtVQhxO2rxiP6Z2V9bz+TERgG8Rezi1MKHg51m56gFo0cu/P3yWVrDe59o/n X-Received: by 2002:aca:4e02:: with SMTP id c2mr5053497oib.142.1582348187086; Fri, 21 Feb 2020 21:09:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582348187; cv=none; d=google.com; s=arc-20160816; b=wCFqb4G7tPFfoAt3pm6GaXlNZ7iGeB9b+C9UGZKTPSwhKR5PxinmNAeAqOXDcI2OTs X6fpfkB/5VKfvI0ccaF2rmqg3FSV8wK5nSpUZd0qH3uijtOj08+lY2NuOYv31s3m//li QoB9P3dMH0p3iugNwWIxKk8PM2HzKPQc2NvYAW+i5srgqVLlN7AC+dRiwysWFye1BzoQ Z9k52SLsF6mjwpp7Z+i6LD7u81Rs3ccvLoNuCr1D7BW8iss34zKzCFow43NEKvD9C1pP R9MObfewjDMu6kXEGQ71lA2fRCJQy3stQs0wiOLLyI1/ui3UzQQ+fXe3kMDjwNkoQQRv xL6g== 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=uchn7QDHgry7WL4opDjcnm9/ECItWnjFnSq+/FMPcGk=; b=WIzKEuhvp5uE5oNlPWdUkchQYy55njIcOZQ8v4hct6qvBA94WE/IB2oLSScygRl/lx BEX+BZKOlQD498KeAiOSCXnKE8hx5lT8FCq9M5XCVRFqthzUboTGCDB54+1ah8Uxi2qG kp7rNbFtS5cb8AZ2kgZPt1uAM/AKi5MFx3vqlgGt5gRAe32IW8hfr/GTLk7ICybQY+yk ZKfZyqL2OlSSdrDO3yaSMRYFabYbFP2HlmUDBy7EiHg0lWWPC9I2AjGlx1WZ6HJj6MiT oLDPoBghTF4ZkTTVNkc2AsI4m5tDdfEZHpZJFP+IPFckO9nX4BONtluJSUNGFrObgtU7 FQzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ApHzJ6ol; 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 j15si1777560oii.163.2020.02.21.21.09.31; Fri, 21 Feb 2020 21:09:47 -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=ApHzJ6ol; 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 S1726198AbgBVFIu (ORCPT + 99 others); Sat, 22 Feb 2020 00:08:50 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:42773 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgBVFIu (ORCPT ); Sat, 22 Feb 2020 00:08:50 -0500 Received: by mail-ot1-f67.google.com with SMTP id 66so4030870otd.9 for ; Fri, 21 Feb 2020 21:08:48 -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=uchn7QDHgry7WL4opDjcnm9/ECItWnjFnSq+/FMPcGk=; b=ApHzJ6ol0Y2Pfnr+OuMGcc0tVv4k0K0fghnCEdXA3P6Cb2Bw1RSJNEFcRN5j/fYW3I 1f45mAIJcr9HJKRTBFb5FkmHZqq0OEmp5XFZ/TboYBlFU/HrDY5nLM4cMf9XgTdJACw9 Cp59yawIjbFUGK/ou18Tder72NlqeIzCJ0EHjxdxjpfZai1XS9XR84PkZkho+QG/2/ei cN1JiE+TkU1trbPcat0+BN5GsNfNpHF5N3EXEfoInkhthybRDzNN19E3Cb15Fx/eWsgJ FfsaX/qEmhXEzKEf25tViLqGVEHe9qM/I7Qd2W7JI/8On4hgPRQfvlORQUGJwL41yh6X TNsg== 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=uchn7QDHgry7WL4opDjcnm9/ECItWnjFnSq+/FMPcGk=; b=qDL/kQYQ7+yji76ENdphcsadhVypvJsW92ZJ9f7w1sF00vXffm6fob0nKy9wpdoeff zyXkeiBqJmUHLsauJCCDtxFWSqGxQjD+jMqQLIwoyF8g2qWkLryMooVdI/7cCCXmTrEC yYqV/lARUvokY+vmFNTWV9NJ2Wc5Pr8DGnD6+CEnkBrPhXq6ne/NHeb2UtIIB3jHitEI E51K9JUvOh7biL0MusUQVQ5PhU8QCXW4ePuRyikPNH+X39NEOoZiWSKJbr1iH2B/3NZe VQFGy811ND2Ajqpy9HJ7G37+TEPJXhmvZyptrZMCt1YmuHhFbRbZya6ifI3CpEIH9ETj ZD4A== X-Gm-Message-State: APjAAAXS7N+X3JQDnGEzEuhZRM1GnjM0Mpggx0NZtqIT34uqDBT8rsYB h8muTRGR8puw1pJUX0TZmBe2dflbeE4= X-Received: by 2002:a9d:4d17:: with SMTP id n23mr31648465otf.85.1582348127608; Fri, 21 Feb 2020 21:08:47 -0800 (PST) Received: from ubuntu-m2-xlarge-x86 ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id s128sm1700328oia.4.2020.02.21.21.08.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Feb 2020 21:08:46 -0800 (PST) Date: Fri, 21 Feb 2020 22:08:45 -0700 From: Nathan Chancellor To: Arvind Sankar Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 2/2] x86/boot/compressed: Remove unnecessary sections from bzImage Message-ID: <20200222050845.GA19912@ubuntu-m2-xlarge-x86> References: <20200109150218.16544-1-nivedita@alum.mit.edu> <20200109150218.16544-2-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200109150218.16544-2-nivedita@alum.mit.edu> 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 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 ... I am not exactly sure how to keep that section around (or if it is ABSOLUTELY necessary like ld.lld seems to claim) otherwise I would send a patch. It would be nice not to break this tool since it is faster than ld.bfd. Cheers, Nathan