Wave icon indicating copy to clipboard operation
Wave copied to clipboard

Include DLL dependencies referenced by PE forwarded exports in package closure

Open LunaStev opened this issue 3 weeks ago • 0 comments

Problem

The PE reader gathers normal/delay imports but not export forwarder dependencies. A package can include the forwarding DLL and omit the DLL that actually implements the imported function.

Reproduction and evidence

Audited canonical master 69a67c6e0fb700f37ee6114f5a66d37ee13771a5 (0.0.1-alpha-dev). Matching checkout-built compiler/std were used for compiler probes on Linux amd64 with Rust 1.89.0 and LLVM 21.1.8. Artifact inspection, mocked/projection checks and foreign-target object emission are identified below and are not native execution on those operating systems.

Built real MSVC-format fixtures with clang/lld-link: root.exe imports value from a.dll; a.def contains LIBRARY a and EXPORTS value=b.value; b.dll implements value. llvm-readobj --coff-exports a.dll reports ForwardedTo: b.value. Executing windows::dependency_closure([root.exe], "x86_64-pc-windows-msvc", [fixture_dir], []) returns only a.dll. b.dll is absent. No native Windows loader execution was performed.

Scope

Inspect forwarded export dependencies as part of PE closure while retaining current import/delay-import, system DLL and provider conflict rules.

Starting points: tools/src/binary.rs:1, tools/src/windows.rs:60.

Completion criteria

  • [ ] The fixture closure includes the required b.dll.
  • [ ] Cover forwarded ordinals, transitive/cyclic forwarding and system/API-set policy.
  • [ ] Keep unresolved/conflicting providers as errors and verify the final fixture natively on Windows.

Related: #622, #621. Related broad trackers or completed implementations are context, not claims that their entire scope is unfinished.

LunaStev avatar Nov 12 '26 12:11 LunaStev