[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200222065521.GA11284@zn.tnic>
Date: Sat, 22 Feb 2020 07:55:21 +0100
From: Borislav Petkov <bp@...en8.de>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: Arvind Sankar <nivedita@...m.mit.edu>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com,
Michael Matz <matz@...e.de>
Subject: Re: [PATCH 2/2] x86/boot/compressed: Remove unnecessary sections
from bzImage
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 <nivedita@...m.mit.edu>
> > ---
> > 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?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists