[package]
name = "elf_loader"
version = "0.16.0"
edition.workspace = true
authors.workspace = true
repository.workspace = true
license.workspace = true
rust-version.workspace = true
readme = "README.md"
keywords = ["elf", "loader", "jit", "linker", "no-std"]
categories = ["no-std", "os", "parsing", "embedded", "compilers"]
description = "A no_std-friendly ELF loader and runtime linker for Rust."
exclude = [".gitignore", "ci", "docs"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[workspace.package]
authors = ["wzhao <1207410841@qq.com>"]
edition = "2024"
repository = "https://github.com/weizhiao/elf_loader"
license = "MIT/Apache-2.0"
rust-version = "1.93.0"
[workspace]
members = [
"crates/windows-elf-loader",
"crates/mini-loader",
"tools/gen-elf",
"tests/riscv64",
]
[workspace.dependencies]
syscalls = { version = "0.8.1", default-features = false }
elf = { version = "0.8", default-features = false }
cfg-if = '1.0'
elf_loader = { version = "0.16.0", path = ".", default-features = false }
object = "0.39"
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = [
'Win32_Foundation',
'Win32_System_Memory',
'Win32_System_SystemInformation',
"Win32_Security",
"Win32_System_IO",
"Win32_Storage",
"Win32_Storage_FileSystem",
"Win32_System_Threading",
] }
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
libc = { version = "0.2.180", default-features = false, optional = true }
[dependencies.syscalls]
workspace = true
optional = true
[dependencies.elf]
workspace = true
[dependencies.cfg-if]
workspace = true
[dependencies.log]
version = "0.4.27"
default-features = false
optional = true
[dependencies.portable-atomic]
version = "1.13"
default-features = false
optional = true
features = ["require-cas"]
[dependencies.portable-atomic-util]
version = "0.2.5"
default-features = false
optional = true
features = ["alloc"]
[dependencies.spin]
version = "0.10"
default-features = false
features = ["mutex", "rwlock", "spin_mutex"]
optional = true
[dependencies.hashbrown]
version = "0.16.0"
default-features = false
features = ["default-hasher"]
optional = true
[dependencies.foldhash]
version = "0.2.0"
default-features = false
optional = true
[dependencies]
bitflags = "2.9.0"
[dev-dependencies]
criterion = "0.8.2"
libloading = "0.9.0"
env_logger = "0.11.6"
gen-elf = { path = "tools/gen-elf" }
object = { workspace = true, features = ["write"] }
[[bench]]
name = "benchmark"
harness = false
[[example]]
name = "load_object"
required-features = ["object"]
[features]
default = ["full"]
libc = ["dep:libc"]
full = ["tls", "lazy-binding", "object", "libc"]
use-syscall = ["dep:syscalls"]
version = []
tls = ["dep:spin"]
lazy-binding = []
object = ["dep:foldhash", "dep:hashbrown"]
log = ["dep:log"]
portable-atomic = [
"dep:portable-atomic",
"dep:portable-atomic-util",
"spin/portable_atomic",
]
[profile.release]
panic = "abort"
opt-level = "s"
lto = "thin"
codegen-units = 1