lld 14.0.6 Release Notes¶
Introduction¶
This document contains the release notes for the lld linker, release 14.0.6. Here we describe the status of lld, including major improvements from the previous release. All lld releases may be downloaded from the LLVM releases web site.
Non-comprehensive list of changes in this release¶
ELF Improvements¶
--export-dynamic-symbol-listhas been added. (D107317)--why-extracthas been added to query why archive members/lazy object files are extracted. (D109572)If
-Mapis specified,--crefwill be printed to the specified file. (D114663)-z bti-reportand-z cet-reportare now supported. (D113901)--lto-pgo-warn-mismatchhas been added. (D104431)Archives without an index (symbol table) are now supported and work with
--warn-backrefs. One may build such an archive withllvm-ar rcS [--thin]to save space. (D117284) The archive index may be entirely ignored in a future release.No longer deduplicate local symbol names at the default optimization level of
-O1. This results in a larger.strtab(usually less than 1%) but a faster link time. Use optimization level-O2to restore the deduplication. The-O2deduplication may be dropped in the future to help parallel.symtabwrite.In relocatable output, relocations to discarded symbols now use tombstone values. (D116946)
Orphan section placement now picks a more suitable segment. Previously the algorithm might pick a readonly segment for a writable orphan section and make the segment writable. (D111717)
An empty output section moved by an
INSERTcomment now gets appropriate flags. (D118529)Negation in a memory region attribute is now correctly handled. (D113771)
--compress-debug-sections=zlibis now run in parallel.{clang,gcc} -gzlink actions are significantly faster. (D117853)“relocation out of range” diagnostics and a few uncommon diagnostics now report an object file location beside a source file location. (D112518)
The write of
.rela.dynandSHF_MERGE|SHF_STRINGSsections (e.g..debug_str) is now run in parallel.
Architecture specific changes:
The AArch64 port now supports adrp+ldr and adrp+add optimizations.
--no-relaxcan suppress the optimization. (D112063) (D117614)The x86-32 port now supports TLSDESC (
-mtls-dialect=gnu2). (D112582)The x86-64 port now handles non-RAX/non-adjacent
R_X86_64_GOTPC32_TLSDESCandR_X86_64_TLSDESC_CALL(-mtls-dialect=gnu2). (D114416)The x86-32 and x86-64 ports now support mixed TLSDESC and TLS GD, i.e. mixing objects compiled with and without
-mtls-dialect=gnu2referencing the same TLS variable is now supported. (D114416)For x86-64,
--no-relaxnow suppressesR_X86_64_GOTPCRELXandR_X86_64_REX_GOTPCRELXGOT optimization (D113615)R_X86_64_PLTOFF64is now supported. (D112386)R_AARCH64_NONE,R_PPC_NONE, andR_PPC64_NONEin input REL relocation sections are now supported.
Breaking changes¶
e_entryno longer falls back to the address of.textif the entry symbol does not exist. Instead, a value of 0 will be written. (D110014)--lto-pseudo-probe-for-profilinghas been removed. In LTO, the compiler enables this feature automatically. (D110209)Use of
--[no-]define-common,-d,-dc, and-dpwill now get a warning. They will be removed or ignored in 15.0.0. (llvm-project#53660)
COFF Improvements¶
MinGW Improvements¶
--heapis now handled. (D118405)
Mach-O Improvements¶
The
ld64.lld.darwinnewsymlink has been removed. Useld64.lldto invoke the Mach-O backend from now on. Moreover, the symlinkld64.lld.darwinold– and the old Mach-O LLD code that it pointed to – have been removed. (D114842)The “cannot export hidden symbol” error has been downgraded to a warning. (D107011)
Common bitcode symbols are now supported. (D107027)
Weak references in bitcode are now supported. (D115949)
Thunk insertion now works more reliably. (D108897, D108924, D109079, D116705)
-ObjCnow loads archive members before the symbol resolution phase. (D108781)-oso_prefixis now supported. (D112291)Properly encode binaries with zero exported symbols. Tools like
codesign_allocateno longer choke on those binaries. (D112589)We no longer treat architecture mismatches as a fatal error. Use
-arch_errors_fatalif that behavior is still desired. (D113082)Several performance improvements were done to speed LLD up on projects with a lot of framework flags and library lookups. Large Swift-based projects will benefit significantly. (D113073, D113063, D113153, D113235)
Several memory-reduction optimizations were done to reduce LLD’s RSS footprint. (D113813, D113818)
Symbol patterns from
-[un]exported_symbols_listare now processed in parallel. (D113820).weak_def_can_be_hiddensymbols can now be exported. (D113167)-S– to omit debug info – is now handled. (D112594)-vnow writes to stderr instead of stdout. (D113020)Private externs with GOT relocations are now marked as LOCAL in the indirect symbol table. This allows
strip -xto remove more symbols. (D111852)We no longer generate bogus addresses when
__TEXT,__gcc_except_tabis renamed. (D113582)Unreferenced weak dylib symbols no longer trigger fetches from an archive. (D115092)
$ld$hidesymbols are now supported. (D115775)Symbols imported via
-weak_frameworkare now properly marked as weak refs. (D114397)--warn-dylib-install-nameand--no-warn-dylib-install-namewere added to toggle LLD-specific warnings around the use of-install_name. (D113534)Passing both
--icf=alland-no_deduplicateno longer results in a warning. (D110672)ICF now deduplicates functions with (identical) unwind info too. (D109946)
We now support ordering sections based on call graph profile data. (D112164)
Map file output now proceeds in parallel with output of the binary. (D117069)
The map file now contains dead-stripped symbols too. (D114737)
Multiple TLV sections with different alignments are now handled properly. (D116263)
--start-liband--end-libare now supported. (D116913)-noall_loadis now supported. (D117629)-add_empty_sectionis now supported. (D117749)
