lkml.org 
[lkml]   [2020]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 2/2] x86/boot/compressed: Remove unnecessary sections from bzImage
    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.

    \
     
     \ /
      Last update: 2020-02-22 16:38    [W:4.012 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site