Re: [PATCH] x86/boot: Discard .discard.unreachable for arch/x86/boot/compressed/vmlinux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 22 May 2020 at 17:57, Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
>
> On Fri, May 22, 2020 at 5:54 PM Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:
> >
> > On Fri, 22 May 2020 at 08:51, Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
> > >
> > > On Fri, May 22, 2020 at 4:43 AM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> > > >
> > > > On Wed, May 20, 2020 at 11:20:10AM -0700, 'Fangrui Song' via Clang Built Linux wrote:
> > > > > In the latest efi tree, ce5e3f909fc0ed67e58367b9c56a54c20a51080b
> > > > > "efi/printf: Add 64-bit and 8-bit integer support",
> > > > > arch/x86/boot/compressed/vmlinux may have an undesired
> > > > > .discard.unreachable section from drivers/firmware/efi/libstub/vsprintf.stub.o
> > > > >
> > > > > .discard.unreachable contains an R_X86_64_PC32 relocation, which will be
> > > > > warned by LLD: a non-SHF_ALLOC section (.discard.unreachable) is not
> > > > > part of the memory image, thus conceptually the distance between a
> > > > > non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at
> > > > > link time.
> > > > >
> > > > > % ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds ... -o arch/x86/boot/compressed/vmlinux
> > > > > ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> > > > >
> > > > > Reuse the DISCARDS macro which includes .discard.* to drop .discard.unreachable
> > > > >
> > > > > Reported-by: kbuild test robot <lkp@xxxxxxxxx>
> > > > > Signed-off-by: Fangrui Song <maskray@xxxxxxxxxx>
> > > >
> > > > Yay macro usage! :)
> > > >
> > > > Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
> > > >
> > >
> > > Feel free to add...
> > >
> > >    Tested-by: Sedat Dilek <sedat.dilek@xxxxxxxxx> # build and boot on
> > > Linux v5.7-rc6+ with Clang and LLD v10.0.1-rc1
> > >
> > > ...together with one more patches in the x86/boot area:
> > >
> > > x86/boot: Correct relocation destination on old linkers
> > >
> > > Next run will include:
> > >
> > > x86/boot: Add .text.startup to setup.ld (v2)
> > >
> > > - Sedat -
> > >
> > > [1] https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.1-rc1
> >
> > Thanks, I'll queue this up.
>
> Just FYI:
> It's in tip.git#x86/build already.
>
> - Sedat -
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/build&id=d6ee6529436a15a0541aff6e1697989ee7dc2c44

Thanks for the head's up. I'll remove it from my branch again.



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux