Files
Rui UeyamaandClaude Opus 5.5 65665ee122 Return just the target name from the ELF linker's link functions
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]>
2026-10-11 13:40:30 +09:00
..
2026-10-09 19:41:52 +09:00

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.