mirror of
https://github.com/rui314/mold.git
synced 2026-11-07 09:16:04 -10:00
link returned a LinkResult, Result<i32, &str>: an exit status, or the target the inputs are actually for. The status was always 0, as a link that fails exits in the middle, so link now returns Option<&str>, the other target if there is one, and the driver returns nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Architecture crates
Each subdirectory is a small crate that instantiates the generic ELF or
Mach-O linker for one target architecture. Separate crates let Cargo compile
the architectures in parallel. Instantiating all targets in one crate leaves
a long serial compilation step. A directory is named after its crate without
the mold- prefix, e.g. elf-x86_64 holds mold-elf-x86_64.
The ELF linker lives in elf/, with target-specific code in
elf/arch/, and the Mach-O linker in macho/,
with target-specific code in macho/arm64.rs and
macho/x86_64.rs. These crates provide entry points
that the cli/ executable selects for the input files' target.