Repository navigation
Staticlib rename internal symbols: add COFF support - #160679
Merged
Merged
Conversation
cezarbbb
force-pushed
the
staticlib-rename-coff
branch
from
August 7, 2026 09:25
3a890b2 to
3d2cea7
Compare
This comment has been minimized.
This comment has been minimized.
bjorn3
reviewed
Aug 27, 2026
bjorn3
reviewed
Aug 27, 2026
cezarbbb
force-pushed
the
staticlib-rename-coff
branch
4 times, most recently
from
August 28, 2026 03:44
02dd471 to
e03085d
Compare
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
It has been rebaseed to upstream. |
Member
|
@rustbot ready |
bjorn3
reviewed
Sep 17, 2026
bjorn3
reviewed
Sep 17, 2026
bjorn3
reviewed
Sep 17, 2026
cezarbbb
force-pushed
the
staticlib-rename-coff
branch
from
September 18, 2026 02:33
e03085d to
e69bf11
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
cezarbbb
force-pushed
the
staticlib-rename-coff
branch
from
September 18, 2026 02:52
e69bf11 to
f330047
Compare
Contributor
Author
|
@rustbot ready |
bjorn3
approved these changes
Sep 21, 2026
Member
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 21, 2026
…bjorn3 Staticlib rename internal symbols: add COFF support Follow-up to rust-lang#156950. `-Zstaticlib-rename-internal-symbols` now also works on COFF targets (Windows). Renaming only rewrites symbol names, so unlike hide it needs no visibility concept. COFF objects keep their string table at the end of the file, so renames append the new names there and patch the 4-byte length prefix plus each symbol's name offset in place. Both regular and bigobj objects are handled; on i686 a leading underscore is stripped when matching against the exported set. The archive format differs (GNU ar on windows-gnu, COFF on windows-msvc) but the members are always COFF objects, so the existing archive code is unchanged. Supported on ELF, Apple, and COFF targets. `-Zstaticlib-hide-internal-symbols` remains ELF/Apple-only and still warns on Windows. A run-make test `staticlib-rename-internal-symbols-coff` mirrors the existing ELF and Mach-O tests. r? @bjorn3
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 6 pull requests Successful merges: - #163083 (Remove `G` generic param from `Diag<'_, G>`) - #160679 (Staticlib rename internal symbols: add COFF support) - #162007 (Preserve parentheses in raw borrow suggestions) - #163057 (Use span context for enclosing item(s) of unmet bound) - #163070 (label the path segment that is not an associated item of the trait) - #163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 10 pull requests Successful merges: - #163083 (Remove `G` generic param from `Diag<'_, G>`) - #160679 (Staticlib rename internal symbols: add COFF support) - #160859 (`core::num::f16b` Rust's 16bit Brain Float) - #162007 (Preserve parentheses in raw borrow suggestions) - #162821 (Avoid suggesting closures when captures cross associated item boundaries) - #163057 (Use span context for enclosing item(s) of unmet bound) - #163070 (label the path segment that is not an associated item of the trait) - #163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - #163107 (Implement Allocator for Pin unstably) - #163108 (remove old solver use of `SolverRelating`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 10 pull requests Successful merges: - #163083 (Remove `G` generic param from `Diag<'_, G>`) - #160679 (Staticlib rename internal symbols: add COFF support) - #160859 (`core::num::f16b` Rust's 16bit Brain Float) - #162007 (Preserve parentheses in raw borrow suggestions) - #162821 (Avoid suggesting closures when captures cross associated item boundaries) - #163057 (Use span context for enclosing item(s) of unmet bound) - #163070 (label the path segment that is not an associated item of the trait) - #163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - #163107 (Implement Allocator for Pin unstably) - #163108 (remove old solver use of `SolverRelating`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
Rollup merge of #160679 - cezarbbb:staticlib-rename-coff, r=bjorn3 Staticlib rename internal symbols: add COFF support Follow-up to #156950. `-Zstaticlib-rename-internal-symbols` now also works on COFF targets (Windows). Renaming only rewrites symbol names, so unlike hide it needs no visibility concept. COFF objects keep their string table at the end of the file, so renames append the new names there and patch the 4-byte length prefix plus each symbol's name offset in place. Both regular and bigobj objects are handled; on i686 a leading underscore is stripped when matching against the exported set. The archive format differs (GNU ar on windows-gnu, COFF on windows-msvc) but the members are always COFF objects, so the existing archive code is unchanged. Supported on ELF, Apple, and COFF targets. `-Zstaticlib-hide-internal-symbols` remains ELF/Apple-only and still warns on Windows. A run-make test `staticlib-rename-internal-symbols-coff` mirrors the existing ELF and Mach-O tests. r? @bjorn3
github-actions Bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
bjorn3
pushed a commit
to rust-lang/rustc_codegen_cranelift
that referenced
this pull request
Sep 22, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Sep 22, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 24, 2026
…d,bjorn3 Adjust for Arm64EC name mangling when checking for exported symbols After rust-lang#160679 the Arm64EC nightly validation run internally by Microsoft started failing with: ``` === STDOUT === main.c main.obj : error LNK2019: unresolved external symbol my_add referenced in function #my_add$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol my_hash_lookup referenced in function #my_hash_lookup$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol call_internal referenced in function #call_internal$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol my_safe_div referenced in function #my_safe_div$exit_thunk (EC Symbol) main.exe : fatal error LNK1120: 4 unresolved externals ``` Root cause is that `symbol_edit` wasn't compensating for Arm64EC's name mangling, and so these symbols were missed.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
Rollup merge of #163188 - dpaoliello:arm64ecsymboledit, r=lqd,bjorn3 Adjust for Arm64EC name mangling when checking for exported symbols After #160679 the Arm64EC nightly validation run internally by Microsoft started failing with: ``` === STDOUT === main.c main.obj : error LNK2019: unresolved external symbol my_add referenced in function #my_add$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol my_hash_lookup referenced in function #my_hash_lookup$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol call_internal referenced in function #call_internal$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol my_safe_div referenced in function #my_safe_div$exit_thunk (EC Symbol) main.exe : fatal error LNK1120: 4 unresolved externals ``` Root cause is that `symbol_edit` wasn't compensating for Arm64EC's name mangling, and so these symbols were missed.
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Sep 25, 2026
Adjust for Arm64EC name mangling when checking for exported symbols After rust-lang/rust#160679 the Arm64EC nightly validation run internally by Microsoft started failing with: ``` === STDOUT === main.c main.obj : error LNK2019: unresolved external symbol my_add referenced in function #my_add$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol my_hash_lookup referenced in function #my_hash_lookup$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol call_internal referenced in function #call_internal$exit_thunk (EC Symbol) main.obj : error LNK2019: unresolved external symbol my_safe_div referenced in function #my_safe_div$exit_thunk (EC Symbol) main.exe : fatal error LNK1120: 4 unresolved externals ``` Root cause is that `symbol_edit` wasn't compensating for Arm64EC's name mangling, and so these symbols were missed.
makai410
pushed a commit
to makai410/rust
that referenced
this pull request
Oct 1, 2026
…nathanBrouwer Rollup of 10 pull requests Successful merges: - rust-lang#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang#163070 (label the path segment that is not an associated item of the trait) - rust-lang#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang#163107 (Implement Allocator for Pin unstably) - rust-lang#163108 (remove old solver use of `SolverRelating`)
makai410
pushed a commit
to makai410/rustc_public
that referenced
this pull request
Oct 1, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
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.
View all comments
Follow-up to #156950.
-Zstaticlib-rename-internal-symbolsnow also works on COFF targets (Windows). Renaming only rewrites symbol names, so unlike hide it needs no visibility concept.COFF objects keep their string table at the end of the file, so renames append the new names there and patch the 4-byte length prefix plus each symbol's name offset in place. Both regular and bigobj objects are handled; on i686 a leading underscore is stripped when matching against the exported set. The archive format differs (GNU ar on windows-gnu, COFF on windows-msvc) but the members are always COFF objects, so the existing archive code is unchanged.
Supported on ELF, Apple, and COFF targets.
-Zstaticlib-hide-internal-symbolsremains ELF/Apple-only and still warns on Windows.A run-make test
staticlib-rename-internal-symbols-coffmirrors the existing ELF and Mach-O tests.r? @bjorn3