Removing global state from LLD
LLD, the LLVM linker, is a mature
and fast linker supporting multiple binary formats (ELF, Mach-O,
PE/COFF, WebAssembly). Designed as a standalone program, the code base
relies heavily on global state, making it less than ideal for library
integration. As outlined in RFC:
Revisiting LLD-as-a-library design, two main hurdles exist:
Fatal errors: they exit the process without returning control to the
caller. This was actually addressed for most scenarios in 2020 by
utilizing llvm::sys::Process::Ex...
Read more at maskray.me