[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200222164419.GB3326744@rani.riverdale.lan>
Date: Sat, 22 Feb 2020 11:44:20 -0500
From: Arvind Sankar <nivedita@...m.mit.edu>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: Fangrui Song <maskray@...gle.com>,
Arvind Sankar <nivedita@...m.mit.edu>,
Borislav Petkov <bp@...en8.de>,
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 Sat, Feb 22, 2020 at 10:37:47AM -0500, Arvind Sankar wrote:
> On Sat, Feb 22, 2020 at 12:42:42AM -0700, Nathan Chancellor wrote:
> >
> > Thanks for the clarity. With your suggestion (diff below), I see the
> > following error:
> >
> > arch/x86/boot/compressed/vmlinux: no symbols
> > ld.lld: error: undefined symbol: ZO_input_data
> > >>> referenced by arch/x86/boot/header.o:(.header+0x59)
> >
> > ld.lld: error: undefined symbol: ZO_z_input_len
> > >>> referenced by arch/x86/boot/header.o:(.header+0x5D)
> > make[3]: *** [../arch/x86/boot/Makefile:108: arch/x86/boot/setup.elf]
> >
> > It seems like the section still isn't being added?
> >
> > Cheers,
> > Nathan
>
> It seems like lld also doesn't treat .symtab as special and is
> discarding it, but that one is actually essential to be able to build
> the bzImage.
>
> The sections that GNU ld ends up discarding via that *(*) directive are
> .dynsym, .dynstr, .gnu.hash, .eh_frame, .rela.dyn, .comment and
> .dynamic.
>
> Out of these, only .eh_frame has any significant size, and that's what
> we discard in the other linker scripts (in kernel/vmlinux.lds.S and
> boot/setup.ld).
>
> It looks like it would be safest to just do
> /DISCARD/ : {
> *(.eh_frame)
> }
> instead. If you can double-check that that works with lld, I can send
> out a new version.
>
> Thanks and sorry for the breakage.
Tested with lld and it seems fine with that change.
Boris, should I send the fix as a diff to the current patch in tip, or
as a fresh one that can replace it?
Thanks.
Powered by blists - more mailing lists