Repository navigation
Relink 0.17.0
Relink 0.17.0
This release redesigns module lifetime management, dependency resolution, and symbol scopes, providing a stronger foundation for safe unloading, cross-runtime loading, and customizable dynamic linking.
Highlights
- Added module unloading and lifetime management through
ModuleLease,acquire,release,pin, and recursive dependency collection. - Expanded
LinkContextwith global symbol scopes, module graph imports, file identity deduplication, runtime domains, and reverse module lookup. - Improved library search with inherited
DT_RPATH,DT_RUNPATH,$ORIGIN,$LIB, and$PLATFORM. - Added GNU unique symbol support, ELF symbol visibility handling, and improved symbol version semantics.
- Redesigned the TLS runtime with registries, per-thread DTV management, and cleaner resolver interfaces.
- Added basic little-endian Xtensa ELF32 dynamic relocation support, including an ESP32 QEMU example and CI coverage. Xtensa lazy binding and TLS relocations are not supported yet.
- Reorganized tests, fixtures, examples, and public API documentation.
Breaking Changes
LinkContext::new()now requires aDomainId.- Loading now uses
Linker::run().load(), with redesigned resolver and request APIs. LoadResult::root()returns aModuleId. Modules are accessed throughLinkContext::module()and must be explicitly released.- Module keys now use the concrete
ModuleKeytype instead of a generic key parameter. - Relocation scopes are represented by
ModuleScope,LocalScope, andGlobalScope. - The
Module,ModuleHandle, observer, TLS, and synthetic module APIs have changed. - The
tlsfeature has been removed. TLS APIs are always available, whilelazy-bindingnow only enables the built-inNativeLazyBinder.
let loaded = Linker::new()
.resolver(resolver)
.run()
.load(&mut context, root)?;
let entry = unsafe {
context
.module(loaded.root())?
.get::<extern "C" fn()>("entry")
.expect("symbol `entry` not found")
};
entry();
// Release the direct acquisition when it is no longer needed.
drop(loaded.release(&mut context)?);