The Wild repository moved to a GitHub org, so is now at https://github.com/wild-linker/wild. The old
URL should redirect to the new one.
A lot of work in this release was related to porting to other platforms. We did a large number of
refactorings to put ELF-specific behaviour behind traits. We've also started work on porting to
Mach-O and WebAssembly. These aren't yet ready for use, but if you'd like to help out with porting,
get in touch.
Wild now supports the linker plugin API that was originally part of the Gold linker, but which is
also supported by GNU ld and Mold. This lets us do linker-plugin LTO (link time optimisation). There
are still a few known issues, but it's already working on a good range of programs. Pure Rust
projects generally don't use linker plugins, since Rust can do LTO within the compiler, so this is
mostly helpful for C, C++ or mixed language projects. Note that when using a linker plugin, link
times will be very slow.
Lots more linker-script features were implemented during this release.
We didn't do any substantial performance work in this release, but at least things didn't get slower. See benchmarks.
๐ Features
- Support
--dependency-file(#1467) - Add built-in symbol __executable_start (#1473)
- Allow specifying library search paths in version scripts and export lists (#1477)
- Add support for
--auxiliaryarg (#1488) - Allow excluding symbols from specific libraries via
--exclude-libs(#1494) - Support
--enable-new-dtagsand--disable-new-dtags(#1507) - Add flag to turn off version in .comment (#1504)
- Support
PROVIDEandPROVIDE_HIDDENlinker script directives (#1525) - Reject conflicting RISC-V ISA extensions (#1526)
- Add support for linker plugins (#1411)
- Add base to track byte reduction due to relaxation (#1527)
- Support RISC-V call relaxation (#1552)
- Define
_etext,__etextand_edataspecial symbols (#1563) - Don't bail on
--use-android-relr-tagsand--pack-dyn-relocs=relr(#1566) - Support RISC-V HI20 relaxation (#1574)
- Support matching based on linker script input filenames (#1596)
- Support lui deletion in RISC-V HI20 relaxation when %hi is zero (#1636)
- Implement PROVIDE semantics for linker-defined symbols (#1534)
- Implement R_X86_64_CODE_* relocations with relaxations (#1632)
- Add ASSERT command parsing support to linker scripts (#1607)
- Support building on Windows (#1629)
- Bail when an input file requests exec stack and it is not allowed (#1675)
- Add support for
--trace(#1699) - Evaluate linker script ASSERT commands (#1695)
- (loongarch64) Add allowed range and alignment by spec (#1734)
- Allow users of libwild to capture all warnings (#1756)
- (AArch64) Support 2 more relocations (#1760)
- Add support for generating static relocatables (#1698)
- Support bitwise, logical, and unary operators in linker script expressions (#1768)
- Implement ALIGNOF linker script function (#1770)
- Support
R_RISCV_ALIGNrelaxation (#1772) - Support LOADADDR in linker scripts (#1780)
- Support K and M suffixes in linker script number literals (#1782)
- Support
-o/path(without the space) (#1785) - Add MEMORY block parsing and LENGTH/ORIGIN expression variants (#1792)
- Support
-z pack-relative-relocswithout actual packing (#1701) - Support
--pack-dynamic-relocs=relr(#1804) - Implement ORIGIN and LENGTH evaluation in linker script expression eval (#1803)
- Generate a .symtab_shndx section when shnum > 65k (#1783)
- Handle output section header start addresses in linker scripts (#1850)
- Support
--use-android-relr-tags(#1805) - Implement range-extension thunks for aarch64 (#1847)
- Select platform based on
-flavor, arg0 then host (#1873) - Add -Ttext/-Tdata/-Tbss segment layout for SEGMENT_START support (#1877)
- Support SEGMENT_START function in Linker Script (#1851)
- Support
--compress-debug-sections(#1881) - Evaluate expressions within PROVIDE with
evaluate_expression(#1925) - Implement symbol resolution within the ASSERT command (#1931)
- Support
--nmagic(#1884) - Support PROVIDE within the SECTIONS toplevel command (#1947)
โก Performance
- Reduce use of starts_with in version script parsing (#1514)
- Add fast path for non-glob version script matchers (#1515)
- Reduce atomic operations for tracking sections with content (#1517)
- Fix performance loss of ctor/dtor ordering (#1522)
- Parallelize section and symbol address computation in relaxation scan (#1575)
- Skip fully-resolved sections in subsequent relaxation iterations (#1580)
- Skip relaxation iteration early when no rescan candidates remain (#1582)
- Change release profile to use codegen-units=1 (#1500)
- Fill padding bytes once instead of 3 times (#1889)
๐ชฒ Bug Fixes
- (benchmarks) Use parent directory of args.tmp for filesystem checking (#1458)
- Delete the file instead of truncating it when updating busy executable (#1466)
- Use version_r when resolving undefined symbols in shared objects (#1469)
- Address equality for exported ifunc symbols (#1452)
- Resolve weak undefined symbols to zero in read-only sections (#1474)
- Properly merge
.ctors/.dtorssections into.init_array/.fini_array(#1479) - Align RELRO segment end to page boundary (#1496)
- Handle symbols with empty versions (#1480)
- Use actual segment alignment in
layout_section_parts(#1501) - Properly handle version script WRT symbols with multiple defs (#1519)
- Make
--versionexit immediately,-vcontinue linking (#1521) - Properly handle entry symbol being weak and overridden (#1530)
- Placed downgraded symbols from version script correctly in .symtab (#1553)
- Do not bail when encountering unsupported SFrame version (#1577)
- Avoid updates to perf-event due to breaking changes (#1591)
- Use correct symbol priority when primary definition is dynamic (#1601)
- Prevent panic when writing to stdout fails in
--versionand--help(#1631) - Don't use nop for calls to undefined functions (#1649)
- Make three more x86_64 relaxations required for static binaries (#1654)
- Print the correct message in
--sym-info(#1673) - Emit error for unterminated block comments in linker scripts (#1674)
- Warn rather than error on
--sort-sectionflag (#1684) - Emit error when shared objects required symbols are not provided (#1666)
- Hide linker-defined symbols in shared libraries (#1686)
- fix: Register linker plugin message callback first (#1697)
- Only emit
__global_pointer$on RISC-V (#1715) - COMMON/ABS symbols are now defined in .dynsym (#1685)
- Emit undefined symbol error even if primary reference is GCed (#1737)
- (AllowedRange) Tweak and add
AllowedRange::from_bit_size(#1742) - Don't report undefined symbols when writing executables with -z undefs (#1741)
- Make our warning format consistent with the other linkers (#1738)
- Don't skip undefined symbol error due to previous weak ref (#1740)
- Write warnings to stderr not stdout (#1752)
- Preserve hidden visibility when merging symbols and localize dynsym exports (#1700)
- Format linker plugin messages via C shim and prints full log messages. (#1774)
- Null-terminate linker identity string in .comment section (#1776)
- Correct
--helpmessages (#1784) - GC of sections referenced from debug info (#1787)
- Clear instruction immediate fields before writing relocations in LoongArch64 (#1791)
- Clear opcode and immediate fields before rewriting MOVZ/MOVN relocations in AArch64 (#1794)
- Correct debug relocation values for local symbols (#1806)
- Symtab symbol version added by .symver (#1811)
- Import just
GLIBC_ABI_DT_RELRversion (#1826) - Don't bypass dynamic symbol lookup due to unused hidden in archive (#1837)
- Copying debug symbols from debug info section (#1820)
- Sync GLOB_DAT allocation and writing conditions (#1845)
- Improve SHT_SYMTAB_SHNDX handling (#1846)
- Always handle elf::SHN_XINDEX when reading (#1852)
- Use correct addend for relocs referencing STT_SECTION (#1854)
- Resolve warning of cargo regarding yanked package (#1859)
- Support merging multiple eh_frame sections (#1867)
- Don't warn if unsupported
--pack-dyn-relocsis overridden (#1874) - Disable SFrame support by default (#1871)
- Emit error if attempting static link of dynamic object (#1886)
- Only keep RELRO_PADDING section when relro is enabled (#1892)
- Make --whole-archive work with linker plugins (#1900)
- (jobserver) ThreadPoolBuilder must use 1 thread with available_threads == 1 (#1904)
- Increase file limit when linker plugin is active (#1901)
- Implement plugin callsbacks required for thin LTO (#1902)
- Set file limit before we open input files (#1911)
- Bad allocation for versioned internal symbol (#1914)
- More robust code to get line numbers from debug info (#1923)
- Do not output SFrame section unless asked (#1916)
- Allow LTO to eliminate dead code (#1942)
- Handle missing version node for synthetic symbols (#1924)
- Fix resolution following linker scripts / synthetic symbols (#1953)
- Prevent GC of linker script symbol aliases (#1956)
- Load archive entries targeted by
--defsymand linker script aliases (#1957) - Emit error on missing resolution for symbol alias (#1961)
๐ Documentation
- Add code of conduct (#1630)
- Write up LLM use policy (#1618)
- Add governance documentation (#1656)
- Update communication options section in
CONTRIBUTING.md(#1676) - Add linker script support matrix and feature tracking (#1827)
- Use icons for implementation status (#1839)
- Simplify usage with GCC 16.1 (-fuse-ld=wild) (#1883)
- (README.md) Adjust what's not supported yet (#1906)
- Add instructions for installing with Brew (#1913)
๐น๏ธ Porting
- (MachO) Copy __text section from input, introduce more output commands (#1810)
- (MachO) Emit code signature (#1919)
- (MachO) Fat binary support (#1910)
- (MachO) Include collected notes (#1812)
- (MachO) Initial scaffolding and input file parsing (#1748)
- (MachO) Introduce feature and smaller refactoring (#1929)
- (MachO) Make __DATA segment optional (#1862)
- (MachO) Make simple executable running on a real system (#1816)
- (MachO) Section/segment mapping and first final output (#1795)
- (MachO) Support relocation handling (#1869)
- (MachO) Support symbol table (#1888)
- (MachO) Unify and refactor segment writer (#1821)
- (MachO) Use args.output for CS identifier (#1949)
- (wasm) Add section and program segment mapping (#1926)
- (wasm) Implement object file section accessors (#1936)
- (wasm) Implement object file symbol accessors and
Symboltrait (#1946) - (wasm) Initial scaffolding for WebAssembly support (#1912)
- (wasm) Parse
linkingandreloc.*custom sections (#1918) - (wasm) Support relocation encoding (#1964)
- Support running on wasi (#1723)
๐จ Styling
- Change C to 100 columns (#1928)
- Format TOML files and use taplo for checking (#1930)
- Add ymlfmt and format existing YAML files (#1652)
๐ ๏ธ Dev tooling
- Support passing a symbol ID to
--sym-info(#1511) - Fix save-dir when input filenames contain '=' (#1833)
- Save-dir now keeps at-files as separate files (#1834)
- Add some colour to
--sym-infooutput (#1844) - Use WILD_LOG environment variable rather than RUST_LOG (#1951)
- Make
--sym-infoshow canonical targets regardless of order (#1952) - Fix save-dir handling of response files (#1858)
โ๏ธ Linker Diff
- Identify some relaxations that LLD does (#1510)
- Support RISC-V attributes (#1535)
- Recognise additional indirections (#1642)
possible_relaxations_doin RISC-V (#1767)
๐งช Testing
- Use a separate subdirectory for each test config (#1495)
- Use wild 0.8.0 in CI (#1503)
- Add local config option to skip specific external tests (#1502)
- Hash input files rather than using timestamps (#1505)
- Allow ExpectError directive to use regular expressions (#1513)
- Enhance symbol expectation and configuration test coverage (#1597)
- Verify that all source files use unix line endings (#1671)
- Don't silently pass section assertion if symbol is undefined (#1683)
- Add test for weak ref to as-needed shared library (#1672)
- Add test for hidden symbol that can only be resolved from a DSO (#1688)
- Disable Go caching (#1696)
- Enable some libc-integration variants for riscv (#1704)
- Add support for cross-testing with clang (#1703)
- Include macOS build (#1733)
- Report file and line number when rejecting test directives (#1743)
- Integration tests can now call dynamic libraries (#1690)
- Remove command hash from object filenames (#1745)
- Use deps files to track gcc/clang inputs (#1747)
- Move integration tests to one dir per test (#1754)
- Switch from rstest to libtest-mimic (#1757)
- Speed up running single arch with nextest (#1758)
- Fix external test CI that was running but ineffective (#1761)
- Allow substring matching in test filters (#1764)
- Fix clang-format formatting check (#1779)
- Allow running external tests with third-party linkers (#1786)
- Support running unit tests on wasi (#1759)
- Remove regex from linker plugin test (#1790)
- Actually run wasm32-wasip1 tests (#1808)
- Move tidy tests to libwild (#1807)
- Add test to check for ELF-specific code in shared locations (#1809)
- Add a test for #1817 (#1819)
- Rebuild object files if command-line changes (#1818)
- Fix colourisation of test output when using nextest (#1843)
- Add an integration test for
--write-gc-stats(#1840) - Get cross tests working in OpenSUSE docker image (#1864)
- Add a test that verifies debug line info (#1878)
- Add basic support for running MachO tests (#1876)
- Check for unexpected warnings (#1885)
- Test handling of empty aligned section (#1894)
- Fix cache step: /bin/tar: unrecognized option: posix (#1896)
- Run tests on Mach-O (skip ELF tests), reorder CI jobs (#1895)
- Include stderr/stdout in failure message when match fails (#1944)
- Don't register plugin tests when plugins feature is disabled (#1954)
- Add test for linker script without
-T(#1955) - Validate that loadable segments don't overlap (#1950)
๐ฒ Sponsors
Thanks to everyone who has sponsored davidlattimore, in particular the following people who have sponsored at least $30 since the last release:
- wasmerio
- repi
- pmarks
- mati865
- marxin
- Urgau
- Tudyx
- flba-eb
- rerun-io
- binarybana
- HadrienG2
- appcove
- ChezBunch
- bes
- twilco
- sourcefrog
- simonlindholm
- petersimonsson
- mstange
- joshtriplett
- belzael
- bcmyers
- +4 anonymous
- +37 others