link-section
Link-time initialized slices for Rust, with full support for Linux, macOS, Windows, WASM and many more platforms.
0.19.3
6.1M downloads/mo
#4114 most downloaded on crates.io
mmastrac/linktime
What this package is like to depend on
Last release 14 days ago
09 Aug 2026
Ships on a steady schedule
a new release about every 1 weeks
Most releases are documented
notes for 19 of 31 stable releases
Nothing withdrawn
no release was ever pulled
4 months old
31 releases · first in 2026
31 releases in the last 12 months
see the full history below
Release timeline
31 releases · Mar 2026 to Aug 2026Releases
latest 31-
0.19.309 Aug 2026Release notes
Open source →What's Changed
- Ensure hashes always compute 64-bit chunks by @mmastrac in #508
- Fix cross-crate section error on Rust versions 1.88-1.94 by @mmastrac in #509
- Fix WASM reference-section const cell layout by @silvanshine in #511
- Document
crate_pathand re-exports by @mmastrac in #514
Full Changelog: link-section-0.19.2...link-section-0.19.3
Release notes
Open source →Changed
- Bump
linktime-proc-macrodependency to 0.2.3 (consistent 64-bit hash chunks and cross-crate section-name fix).
Documentation
- Documented the
crate_pathoverride and surfaced the generated attribute reference (includingcrate_path) in the crate docs and README.
Fixed
- Fix cross-crate section-name error on Rust versions 1.88-1.94 (https://github.com/mmastrac/linktime/pull/509)
- Fix undefined behavior on WASM when a
constitem is submitted to areferencesection: the item's cell lacked the fix-up slot the section-wide layout expects, so materialisation read past the cell and could write through a garbage slot pointer (https://github.com/mmastrac/linktime/pull/511).
-
0.19.229 Jul 2026Release notes
Open source →What's Changed
- Bumped internal proc macro minimum version to pick up PR #495 (should not result in any downstream visible changes)
Full Changelog: link-section-0.19.1...link-section-0.19.2
Release notes
Open source →Changed
- Bump
linktime-proc-macrodependency to 0.2.1 (makes link-section names more stable).
-
0.19.121 Jul 2026Release notes
Open source →Fixed
- Fix for semicolons accidentally inserted in WASM expression macro (generates a warning on nightly).
-
0.19.006 Jul 2026Release notes
Open source →Fixed
- WASM: item counts no longer collapse under fat LTO. Items are gathered through address-significant intrusive list nodes that survive LTO. Fixes #488.
Changed
- WASM: the
read_custom_sectionhost import is no longer required. Sections are gathered in-module via.init_array.0submissions and an.init_array.1finalizer; the#[ctor]priority contract is unchanged. - WASM: each item now lives in a single intrusive
LinkCell<T>static (value plus trailing list metadata) instead of a separate value static and cell.
Removed
Ref::as_ptrandMovableRef::as_ptrare nowpub(crate). They exposed raw pointer plumbing that was never meant to be public API; useDeref(oroffset_offor section-membership checks) instead. This is a breaking change.
-
0.18.323 Jun 2026Release notes
Open source →Fixed
- Windows/COFF: section start/end pointers are now opacified with
black_box, fixing a miscompile where an optimizing (LTO) build could prove a gathered slice (e.g.ScatteredSlice<&'static T>) reads as all-zero and fold it to null values, crashing on use (0xC0000005). Fixes #479.
- Windows/COFF: section start/end pointers are now opacified with
-
0.18.206 Jun 2026Release notes
Open source →Changed
- Empty sections are now automatically supported on all platforms other than AIX.
-
0.18.130 May 2026 -
0.18.028 May 2026Release notes
Open source →Changed
proc_macrofeature is now required for any non-unsafesection.- Non-
unsafesections now generate a unique ID for the submission site which allows multiple sections to share the same identifier.
-
0.17.219 May 2026 -
0.17.117 May 2026Release notes
Open source →Added
MovableRefandRefimplementDebugandDisplayif the referenced type does.
Changed
- Deprecated
referencemodule in favor ofReffrom the crate root.
-
0.17.017 May 2026Release notes
Open source →Added
referencesections support access both as a slice and as a reference at the submission site on all platforms (including WASM).movablesections support reordering and back-reference updates during startup initialization (allowing a "reference" to an item that may move during initialization at the submission site).typedandmutablesections have been split:typedallows forconstandstaticitems, whilemutableallows forconstitems andas_mut_sliceaccess.
Changed
- Bumped MSRV to 1.85.0.
- Significant rewrite to link-section's internal implementation.
- Sections require a type:
#[section(typed)],#[section(untyped)],#[section(mutable)],#[section(movable)], or#[section(reference)]. - When submitting a fn() with a body to a typed link section, the function's body is not placed in any specific section. To restore the previous behavior, manually split function pointers and bodies:
#[section(untyped, aux(main = FN_ARRAY))] pub static FN_BODIES: link_section::Section; #[section(typed)] pub static FN_ARRAY: link_section::TypedSection<fn()>; #[in_section(FN_ARRAY)] const _: fn() = linked_function; #[in_section(FN_BODIES)] pub fn linked_function() { eprintln!("linked_function"); } -
0.16.111 May 2026 -
0.16.009 May 2026Release notes
Open source →Added
- Support for AIX targets. Requires
-C link-arg=-bdbg:namedsects:ss(or a recent Rust version that sets this automatically).
- Support for AIX targets. Requires
-
0.15.006 May 2026Release notes
Open source →Added
- Support for
constitems in link sections. - WASM now requires
constitems, and usesctor-like initialization to copy data to a contiguous section. To access link-section slices in WASM in constructor functions, make sure to usepriority = 1. - Zero-sized types are no longer used in
externs. Windows now uses a non-zero-sized alignment marker to align the start and end of the section. Other LLVM/GCC platforms use au8. link-sectionis nowno_std-compatible.
- Support for
-
0.14.004 May 2026Release notes
Open source →Changed
- WASM targets now use an extern
read_custom_sectionfunction to read custom sections.
- WASM targets now use an extern
-
0.13.102 May 2026 -
0.13.002 May 2026Release notes
Open source →Changed
used_linkerfeature moved to--cfg linktime_used_linkerflag.- On macOS,
fnitems are placed in a__TEXT,__text,regular,pure_instructionssection (fixes a linker warning in nightly).
-
0.12.030 Apr 2026Nothing published for this version
-
0.11.028 Apr 2026 -
0.2.122 Apr 2026Release notes
Open source →Added
- Included licenses in all files.
- Bumped proc-macro dependency versions.
Changed
link-sectioncrate no longer offersconstsection pointers.
-
0.2.013 Apr 2026Nothing published for this version
-
0.0.1209 Apr 2026Nothing published for this version
-
0.0.1008 Apr 2026Nothing published for this version
-
0.0.908 Apr 2026Nothing published for this version
-
0.0.808 Apr 2026Nothing published for this version
-
0.0.707 Apr 2026Nothing published for this version
-
0.0.505 Apr 2026Nothing published for this version
-
0.0.405 Apr 2026Nothing published for this version
-
0.0.305 Apr 2026Nothing published for this version
-
0.0.204 Apr 2026Nothing published for this version
-
0.0.127 Mar 2026Nothing published for this version