lkml.org 
[lkml]   [2020]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 0/7] x86/boot: Remove runtime relocations from compressed kernel
On Tue, Jul 14, 2020 at 8:33 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Tue, Jul 14, 2020 at 8:30 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >
> > > I did a full new build...
> > >
> > > ...and it fails with ld.lld-11 as linker:
> > >
> > > ld.lld-11 -m elf_x86_64 -pie --no-dynamic-linker -r -o
> > > arch/x86/boot/compressed/.tmp_misc.o arch/x86/boot/compressed/misc.o
> > > -T arch/x86/boot/compressed/.tmp_misc.ver; mv -f
> > > arch/x86/boot/compressed/.tmp_misc.o arch/x86/boot/compressed/misc.o;
> > > rm -f arch/x86/boot/compressed/.tmp_misc.ver; fi
> > > *** ld.lld-11: error: -r and -pie may not be used together ***
> > > make[5]: *** [scripts/Makefile.build:281:
> > > arch/x86/boot/compressed/misc.o] Error 1
> > >
> > > It's annoying to fail on the last minutes of a build.
> > > Sorry for being very honest.
> > >
> >
> > I applied this diff...
> >
> > $ git diff arch/x86/boot/compressed/Makefile
> > diff --git a/arch/x86/boot/compressed/Makefile
> > b/arch/x86/boot/compressed/Makefile
> > index 789d5d14d8b0..9ba52a656838 100644
> > --- a/arch/x86/boot/compressed/Makefile
> > +++ b/arch/x86/boot/compressed/Makefile
> > @@ -51,7 +51,10 @@ UBSAN_SANITIZE :=n
> > KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
> > # Compressed kernel should be built as PIE since it may be loaded at any
> > # address by the bootloader.
> > +# LLD linker does not allow -r and -pie options to be used together.
> > +ifndef CONFIG_LD_IS_LLD
> > KBUILD_LDFLAGS += -pie $(call ld-option, --no-dynamic-linker)
> > +endif
> > LDFLAGS_vmlinux := -T
> >
> > hostprogs := mkpiggy
> >
> > ...and was able to build, assemble, link arch/x86/boot/compressed/*.
> >
>
> I checked my last succesfull build without your patchset:
>
> $ grep no-dynamic-linker build-log_5.8.0-rc5-1-amd64-llvm11-ias.txt
> [ EMPTY ]
>

I was able to boot on bare metal.

Feel free to add my...

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>

...when you restore "old" behaviour when CONFIG_LD_IS_LLD=y (apply or
fold-in my diff with comment)...

...and use one "runtime" in your subject-line:

$ git log --oneline
v5.8-rc5..for-5.8/x86-boot-compressed-remove-runtime-relocations-nivedita-v4
| egrep 'runtime|run-time'
9547f8f08689 x86/boot: Check that there are no runtime relocations
ede02a307b30 x86/boot: Remove runtime relocations from head_{32,64}.S
525a67ac7ea9 x86/boot: Remove run-time relocations from .head.text code

Thanks.

- Sedat -

\
 
 \ /
  Last update: 2020-07-14 21:22    [W:0.135 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site