Repository navigation
coff split: let the linker regenerate a PE export table - #11
Merged
Merged
Conversation
A module with `generate_exports: true` gets its export directory from the linker instead of carrying the original's bytes: - Each split object carries a `-export:` directive for every symbol it defines that the image exports by that name (`,DATA` for data). An incrementally linked image exports through its `@ILT+n_` thunks, so those become `-export:name=@ilt+n_name`. - args.rsp names the original DLL through a generated exports.def (LIBRARY) and stamps the link with the directory's timestamp. - `coff fold` keeps a recompiled unit's own export directives for such a module. The splits must leave the original export table out of the linked units.
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
generate_exportsmodule option: the linker builds the image's export directory instead of the split objects carrying the original's bytes. Needs openblack/llvm-project#4 for the vc6 layout.What changes
-export:directive for every symbol it defines that the image exports under that name.,DATA.@ILT+n_jump thunks, which become-export:name=@ILT+n_name.alias, for example for functions folded by link.exe's/OPT:ICF.args.rspgains/DEF:exports.def, whoseLIBRARYline carries the original DLL name, and/TIMESTAMP:with the original directory's link time.coff foldkeeps a recompiled unit's-export:directives for such a module. Without the option it still drops them, as in v0.0.33..edataregion and holds that unit back.Testing
cargo test: 32 pass, including new tests for the directives (plain, C name,@ILTthunk,,DATA, a missing export), the.drectvethatwrite_coffemits, and fold keeping exports.build.sha1hashes match.🤖 Generated with Claude Code