Technical Details About LLD

From RAD Studio

Go Up to C++ Linkers

Attention: This information only applies to 64-bit Windows (Modern) platforms.

Please see the Using LLD on the Command Line page, for information on using LLD on the command line.

LLD

LLD is a linker from the LLVM project that is a drop-in replacement for system linkers such as GNU BFD and gold linkers, running much faster than them. Besides, its features are useful for toolchain developers.

The LLD project supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and WebAssembly in descending order of completeness. But RAD Studio only supports COFF for Windows.

Linker Settings

Please consider the following information about the LLD linker characteristics and behavior.

  • Garbage collects unused sections: maps to --gc-sections, and when disabled --no-gc-sections. This may be very useful for reducing the size of your final binary (EXE or DLL).
  • Data Execution Prevention compatible (on by default). When disabled, it maps to --disable-nxcompat.
  • Delay Load DLL: maps to --delayload=... Allows a list of DLLs to delay-load.
  • File alignment: maps to --file-alignment= with a 0x200 (512) default value.
    Attention: This value must be a multiple of 512 bytes.
  • Object alignment: maps to --section-alignment= with a 0x1000 (4096) default value.
    Attention: This value must be a multiple of 512 bytes.
  • ASLR/High entropy address space layout randomization (on by default): maps to --disable-dynamicbase when disabled.
  • Verbose linking: is useful to diagnose linking issues.
  • Per-object section alignment: LLD honors the alignment requested by each object file's sections, including 16-byte alignment required by newer instruction sets (SSE/AVX). The legacy ilink linker did not honor per-object alignment, which is why newer instruction sets were not enabled by default in the past.
  • Now RAD Studio supports -fdata-sections and -ffunction-sections compilers options.

    See Also