[llvm-dev] Linking Linux kernel with LLD

George Rimar via llvm-dev llvm-dev at lists.llvm.org
Fri Feb 17 03:56:13 PST 2017


>I think you can also get DSO with -pie I think, but I don't see that either. This is quite mysterious. I also did a quick look at the >linker script and didn't see anything at first glance that would cause DSO output (can linker scripts even control EType?). The >bootloader might not even look at the EType though.

>
>-- Sean Silva

Place is:
https://github.com/torvalds/linux/blob/master/arch/x86/boot/compressed/Makefile#L51

It checks if -z noreloc-overflow is available and adds -pie and other flags in that case.

If I comment out this lines:
#LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
# && echo "-z noreloc-overflow -pie --no-dynamic-linker")?

Then as expected bfd linked vmlinux also becomes executable. And it is even still boots for me.

George.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170217/29834207/attachment.html>


More information about the llvm-dev mailing list