Linux: unsupported flag -n in lld

Created on 31 Jan 2019  路  8Comments  路  Source: ClangBuiltLinux/linux

[ARCH] arm64 [BUG] llvm [FIXED][LLVM] 9 [TOOL] lld feature-request

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.

All 8 comments

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.

big thanks @smithp35 : https://reviews.llvm.org/rL360593

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nathanchance picture nathanchance  路  3Comments

nickdesaulniers picture nickdesaulniers  路  4Comments

tpimh picture tpimh  路  4Comments

nathanchance picture nathanchance  路  3Comments

nathanchance picture nathanchance  路  3Comments