qld 0.1.0

A fast, parallel linker compatible with GNU ld, gold, lld and mold
Documentation
//! Output file writing and post-write steps.
//!
//! **Workstream W5.** Responsibilities:
//!
//! - Create the output next to its final path and set its length. Contents
//!   are written with positional writes by default ([`Backing::Written`]);
//!   mapping the file ([`Backing::Mapped`]) and an in-memory buffer
//!   ([`Backing::Memory`], also used for pipes, devices and library callers
//!   who want bytes back) are the alternatives.
//!   [`LinkOptions::output_backing`](crate::args::LinkOptions::output_backing)
//!   overrides the choice for benchmarking; the `qld` binary sets it from
//!   `QLD_OUTPUT_BACKING`.
//! - Hand out disjoint `&mut [u8]` chunks so sections can be copied and
//!   relocated in parallel.
//! - Post-write steps: build-id (hash blocks in parallel, then combine),
//!   Mach-O code signature, fat header.
//! - Set the executable bit, and replace the old file atomically.
//!
//! This module and [`crate::input`] are the only places allowed to use
//! `unsafe`, for mapping. Every block needs a `SAFETY` comment.
//! See `docs/architecture.md` ("Output writing").
//!
//! # Overview
//!
//! | Item | Role |
//! | --- | --- |
//! | [`OutputFile`] | Creates, maps, fills and commits the output; its docs cover how an old file is replaced |
//! | [`split_chunks`], [`write_chunks`] | Disjoint `&mut [u8]` per layout chunk, for rayon |
//! | [`build_id`] | Parallel tree-hashed build-ids: `fast`, `md5`, `sha1`, `uuid`, hex |
//! | [`hash`] | In-crate MD5, SHA-1 and xxHash64 |
//! | [`WriteStats`] | Bytes written and time per [`WritePhase`] |
//!
//! Mapping lives in a private submodule that is the only code here allowed to
//! use `unsafe`.
//!
//! Not implemented yet: the Mach-O code signature and the fat header
//! (roadmap M8).

pub mod build_id;
mod chunks;
mod file;
pub mod hash;
mod mmap;
mod positional;
mod random;
mod stats;
mod written;

pub use chunks::{ChunkRange, LayoutError, split_chunks, validate_layout, write_chunks};
pub use file::{BackingPolicy, FileMode, Finished, OutputFile, OutputOptions, ReplaceStrategy};
pub use stats::{Backing, WritePhase, WriteStats};