You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The -n option is similar to the -N, --omagic option that is partially supported by LLD (https://reviews.llvm.org/D26888). My understanding is:
-n (turn off page alignment)
-N (turn off page alignment, do not make text readonly)
LLD does not turn off page alignment with -N but it does apply the "do not make text readonly" part.
I suspect that supporting -n may be as simple as aliasing it to -zmax-page-size=1 but I'll need to double check for any other side-effects in ld.bfd first. Note that -zmax-page-size=1 doesn't quite do the same thing in ld.bfd as ld.lld, with ld.bfd the OutputSection alignment is set to whatever -zmax-page-size= is set to, even if there is an InputSection with a greater alignment, this can be overridden by the poorly documented ALIGN_WITH_INPUT optional section attribute. By contrast ld.lld always behaves as if ALIGN_WITH_INPUT is present.
The -n, --nmagic is also frequently used by embedded systems for micro-controllers and other systems that lack a memory management system and thus have no pages.
The text was updated successfully, but these errors were encountered:
Extended Description
LLD doesn't currently support the -n, --nmagic option that is now required to compile the Linux Kernel VDSO shared object (shared object mapped into all user-space programs to provide support for system calls). The patch to enforce it:
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?id=691efbedc60d2a7364a90e38882fc762f06f52c4
The -n option is similar to the -N, --omagic option that is partially supported by LLD (https://reviews.llvm.org/D26888). My understanding is:
-n (turn off page alignment)
-N (turn off page alignment, do not make text readonly)
LLD does not turn off page alignment with -N but it does apply the "do not make text readonly" part.
I suspect that supporting -n may be as simple as aliasing it to -zmax-page-size=1 but I'll need to double check for any other side-effects in ld.bfd first. Note that -zmax-page-size=1 doesn't quite do the same thing in ld.bfd as ld.lld, with ld.bfd the OutputSection alignment is set to whatever -zmax-page-size= is set to, even if there is an InputSection with a greater alignment, this can be overridden by the poorly documented ALIGN_WITH_INPUT optional section attribute. By contrast ld.lld always behaves as if ALIGN_WITH_INPUT is present.
The -n, --nmagic is also frequently used by embedded systems for micro-controllers and other systems that lack a memory management system and thus have no pages.
The text was updated successfully, but these errors were encountered: