[PATCH] D55423: [LLD][ELF] - A fix for "linker script assignment loses relative nature of section" bug.
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 2 08:09:51 PDT 2019
peter.smith added inline comments.
================
Comment at: ELF/Relocations.cpp:387-388
+ // They always can be computed as a link time constant.
+ if (Sym.ScriptDefined)
+ return true;
+
----------------
grimar wrote:
> nickdesaulniers wrote:
> > @peter.smith suggested that just this part of this patch is what I need in order to link an arm64 Linux kernel with KASLR enabled with LLD (https://bugs.llvm.org/show_bug.cgi?id=39810#c11).
> >
> > I was able to confirm that this change was all that I needed to link a bootable kernel image.
> >
> > Can I please have just this change split out of the patch? Surely this part is less controversial?
> If nobody will so that earlier, I'll take a look at how to extract this part with an appropriate test case tomorrow.
>
> (Though I still think we just need to land D55550, and then this part. Having a different behavior of linker script on different architectures is just weird).
The pr contains an AArch64 version of the test. It should fail with a link error with -pie. FWIW I agree with George that D55550 is worth landing as well. Linker scripts are often generated from a large set of macros and it isn't always easy to hand edit the files to avoid forward references.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55423/new/
https://reviews.llvm.org/D55423
More information about the llvm-commits
mailing list