[PATCH] D61201: [LLD][ELF] Full support for -n (--nmagic) and -N (--omagic)

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 07:53:54 PDT 2019


MaskRay added a comment.

https://sourceware.org/bugzilla/show_bug.cgi?id=24505 doesn't get a response, but I researched the users of `CONSTANT(...)`:

`CONSTANT(COMMONPAGESIZE)`: 2 users: edk2, u-boot
`CONSTANT(MAXPAGESIZE)`: 1 user: fuchsia zircon, but they don't use -n or -N

u-boot and fuchsia zircon don't seem to use -n or -N. edk2 is probably the only project that uses both `-n/-N` and `CONSTANT(...)`. It has `DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20`

We probably shouldn't be constrained by ld.bfd's behavior for this single user,
if making `MaxPageSize` and `PageSize` to 1 makes our implementation simpler.

The potential users can make straightforward changes to adapt to lld's behavior: change `CONSTANT(COMMONPAGESIZE)` to a literal constant.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61201/new/

https://reviews.llvm.org/D61201





More information about the llvm-commits mailing list