[package]
edition = "2024"
rust-version = "1.93.0"
name = "elf_loader"
version = "0.15.1"
authors = ["wzhao <1207410841@qq.com>"]
build = false
exclude = [
".gitignore",
"ci",
"docs",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A no_std-friendly ELF loader, runtime linker, and JIT linker for Rust."
readme = "README.md"
keywords = [
"elf",
"loader",
"jit",
"linker",
"no-std",
]
categories = [
"no-std",
"os",
"parsing",
"embedded",
"compilers",
]
license = "MIT/Apache-2.0"
repository = "https://github.com/weizhiao/elf_loader"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
default = [
"tls",
"libc",
]
full = [
"tls",
"lazy-binding",
"object",
"libc",
]
lazy-binding = []
libc = ["dep:libc"]
log = ["dep:log"]
object = [
"dep:foldhash",
"dep:hashbrown",
]
portable-atomic = [
"dep:portable-atomic",
"dep:portable-atomic-util",
"spin/portable_atomic",
]
tls = ["dep:spin"]
use-syscall = ["dep:syscalls"]
version = []
[lib]
name = "elf_loader"
path = "src/lib.rs"
[[example]]
name = "build_fixtures"
path = "examples/build_fixtures.rs"
[[example]]
name = "from_memory"
path = "examples/from_memory.rs"
[[example]]
name = "lifecycle"
path = "examples/lifecycle.rs"
[[example]]
name = "linker_load"
path = "examples/linker_load.rs"
[[example]]
name = "linker_scan_first"
path = "examples/linker_scan_first.rs"
[[example]]
name = "load_dylib"
path = "examples/load_dylib.rs"
[[example]]
name = "load_exec"
path = "examples/load_exec.rs"
[[example]]
name = "load_hook"
path = "examples/load_hook.rs"
[[example]]
name = "load_object"
path = "examples/load_object.rs"
required-features = ["object"]
[[example]]
name = "relocation_handler"
path = "examples/relocation_handler.rs"
[[example]]
name = "user_data"
path = "examples/user_data.rs"
[[test]]
name = "borrowed_mapped"
path = "tests/borrowed_mapped.rs"
[[test]]
name = "dynamic_relocation_kinds"
path = "tests/dynamic_relocation_kinds.rs"
[[test]]
name = "eager_binding"
path = "tests/eager_binding.rs"
[[test]]
name = "error_paths"
path = "tests/error_paths.rs"
[[test]]
name = "gen_elf"
path = "tests/gen_elf.rs"
[[test]]
name = "lazy_binding"
path = "tests/lazy_binding.rs"
[[test]]
name = "object"
path = "tests/object.rs"
[[test]]
name = "planned_load"
path = "tests/planned_load.rs"
[[test]]
name = "search_path_resolver"
path = "tests/search_path_resolver.rs"
[[test]]
name = "symbol_resolution"
path = "tests/symbol_resolution.rs"
[[test]]
name = "tls"
path = "tests/tls.rs"
[[bench]]
name = "benchmark"
path = "benches/benchmark.rs"
harness = false
[dependencies.bitflags]
version = "2.9.0"
[dependencies.cfg-if]
version = "1.0"
[dependencies.elf]
version = "0.8"
default-features = false
[dependencies.foldhash]
version = "0.2.0"
optional = true
default-features = false
[dependencies.hashbrown]
version = "0.16.0"
features = ["default-hasher"]
optional = true
default-features = false
[dependencies.log]
version = "0.4.27"
optional = true
default-features = false
[dependencies.portable-atomic]
version = "1.13"
features = ["require-cas"]
optional = true
default-features = false
[dependencies.portable-atomic-util]
version = "0.2.5"
features = ["alloc"]
optional = true
default-features = false
[dependencies.spin]
version = "0.10"
features = [
"mutex",
"rwlock",
"spin_mutex",
]
optional = true
default-features = false
[dependencies.syscalls]
version = "0.8.1"
optional = true
default-features = false
[dev-dependencies.criterion]
version = "0.8.2"
[dev-dependencies.env_logger]
version = "0.11.6"
[dev-dependencies.libloading]
version = "0.9.0"
[dev-dependencies.object]
version = "0.38.1"
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies.libc]
version = "0.2.180"
optional = true
default-features = false
[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",
]
[profile.release]
opt-level = "s"
lto = "thin"
codegen-units = 1
panic = "abort"