Subtitle: Is LLD a drop-in replacement for GNU ld?
Piotr Kubaj said that this is a probably more of a marketing term than a technical term. It tries to lure existing users into thinking.
- The default image base for
-no-pie
is different. For example, on x86-64, GNU ld defaults to 0x400000 while LLD defaults to 0x200000. - Different archive selection semantics. See http://lld.llvm.org/ELF/warn_backrefs.html for details.
- LLD defaults to
-z relro
by default. This is probably not a good default but it is difficult to change now. I have a comment https://bugs.llvm.org/show_bug.cgi?id=48549 - Different orphan section placement. GNU ld has very complex rules and certain section names have special semantics. LLD adopted some of its core ideas but made a lot of simplication:
- output sections are given ranks
- output sections are placed after symbol assignments
At some point we should document it. https://bugs.llvm.org/show_bug.cgi?id=42327 1. Text relocations. * In GNU ld, -z notext
/-z text
/unspecified are a tri-state. For -z notext
/unspecified, the dynamic tags DT_TEXTREL
and DF_TEXTREL
are added on demand. If unspecified and GNU ld is configured with --enable-textrel-check=warning
, a warning will be issued. * LLD has two states and add DT_TEXTREL
and DF_TEXTREL
if -z notext
is specified.