Skip to content

Validate MSVC COFF objects and archive members before invoking the linker #614

Closed

Description

@LunaStev

Part of #611. Difficulty: high. Audit baseline: master 3950416e (2026-09-12).

Current evidence

src/link_validation/mod.rs contains ELF/RISC-V/LoongArch validation. The MSVC branch in src/cli.rs prepares outputs and invokes the linker without an equivalent target-input inspection pass.

Scope

Implement bounded, defensive inspection of direct COFF objects and resolved .lib/archive inputs. Diagnose wrong machine types and malformed inputs with the input/member name. Handle ordinary COFF, bigobj and short import-object forms deliberately; distinguish LLVM bitcode or unsupported formats instead of misreading their bytes as machine headers. Do not reject an archive solely because of its suffix or claim every GNU-produced COFF object is incompatible.

Completion criteria

Fixture tests cover x64 versus ARM64, truncated headers and archive offsets, import libraries, index/long-name members, empty and mixed archives, and the documented treatment of bitcode. Rejected inputs never launch the linker or replace existing outputs. Preserve valid object/static/import-library linking and report what cannot be inspected. No new parser dependency is required solely for this task.

Dependencies and boundaries

#498; #613 owns library discovery, this issue owns inspection.

Activity

  1. added
    build
    enhancement
    help wanted
    on Sep 12, 2026
  2. added a commit that references this issue on Sep 16, 2026
    f200370
  3. self-assigned this
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buildenhancementhelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions