forked from: https://github.com/ClangBuiltLinux/continuous-integration/issues/122
llvm bug: https://bugs.llvm.org/show_bug.cgi?id=40542
cc @rupprecht @rui314 @smithp35 @GeorgiiR
See commit 40507403485fcb56b83d6ddfc954e9b08305054c for why it was added.
-Wl,-N may suffice but I assume the text section being read only is desirable for the kernel.
-n, --nmagic Do not page align data
-N, --omagic Do not page align data, do not make text readonly
Thanks for the report. For now I've raised https://bugs.llvm.org/show_bug.cgi?id=41522 to make sure it is recorded. My suspicion is that -n can be implemented as an alias -zmax-page-size=1, although that wouldn't work for ld.bfd as there is a subtle difference in behaviour of that option (details in the PR).
Sigh, looks like this was already reported as part of https://bugs.llvm.org/show_bug.cgi?id=40542 I'll close my new one as a duplicate.
Just thinking it might be worth an LLD meta-bug for all the existing LLD linux kernel problems.
I spoke more with @smithp35 about this, sounds like it's feasible to implement. Should be the final arm64+LLD issue.
I've made an attempt at -n with https://reviews.llvm.org/D61201 proved to be a bit more difficult than I thought. It is also worth mentioning that -n will need a linker script (vdso does have one!) to get a sensible output.
New patch: https://reviews.llvm.org/D61688
big thanks @smithp35 : https://reviews.llvm.org/rL360593
Most helpful comment
I've made an attempt at -n with https://reviews.llvm.org/D61201 proved to be a bit more difficult than I thought. It is also worth mentioning that -n will need a linker script (vdso does have one!) to get a sensible output.