-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLD][COFF] Add support for MinGW auto-export on ARM64X #125862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// REQUIRES: aarch64 | ||
|
||
// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %s -o %t.arm64.obj | ||
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %s -o %t.arm64ec.obj | ||
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o %t-loadconfig-arm64ec.obj | ||
// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s -o %t-loadconfig-arm64.obj | ||
|
||
// Check that all symbols are exported in both EC and native views. | ||
|
||
// RUN: lld-link -machine:arm64x -lldmingw -dll -noentry -out:%t.dll %t.arm64.obj %t.arm64ec.obj %t-loadconfig-arm64.obj %t-loadconfig-arm64ec.obj | ||
|
||
// RUN: llvm-readobj --coff-exports %t.dll | FileCheck --check-prefix=EXP %s | ||
// EXP: Format: COFF-ARM64X | ||
// EXP-NEXT: Arch: aarch64 | ||
// EXP-NEXT: AddressSize: 64bit | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 1 | ||
// EXP-NEXT: Name: _load_config_used | ||
// EXP-NEXT: RVA: | ||
// EXP-NEXT: } | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 2 | ||
// EXP-NEXT: Name: sym | ||
// EXP-NEXT: RVA: 0x2000 | ||
// EXP-NEXT: } | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 3 | ||
// EXP-NEXT: Name: sym2 | ||
// EXP-NEXT: RVA: 0x2004 | ||
// EXP-NEXT: } | ||
// EXP-NEXT: HybridObject { | ||
// EXP-NEXT: Format: COFF-ARM64EC | ||
// EXP-NEXT: Arch: aarch64 | ||
// EXP-NEXT: AddressSize: 64bit | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 1 | ||
// EXP-NEXT: Name: __chpe_metadata | ||
// EXP-NEXT: RVA: | ||
// EXP-NEXT: } | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 2 | ||
// EXP-NEXT: Name: __os_arm64x_dispatch_icall | ||
// EXP-NEXT: RVA: 0x12B0 | ||
// EXP-NEXT: } | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 3 | ||
// EXP-NEXT: Name: __os_arm64x_dispatch_ret | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for all these arm64ec internals - we probably don't want to export them. But that's a difference concern from this PR anyway. |
||
// EXP-NEXT: RVA: | ||
// EXP-NEXT: } | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 4 | ||
// EXP-NEXT: Name: _load_config_used | ||
// EXP-NEXT: RVA: | ||
// EXP-NEXT: } | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 5 | ||
// EXP-NEXT: Name: sym | ||
// EXP-NEXT: RVA: 0x2008 | ||
// EXP-NEXT: } | ||
// EXP-NEXT: Export { | ||
// EXP-NEXT: Ordinal: 6 | ||
// EXP-NEXT: Name: sym2 | ||
// EXP-NEXT: RVA: 0x200C | ||
// EXP-NEXT: } | ||
// EXP-NEXT: } | ||
|
||
// Check that an explicit export in the EC view is respected, preventing symbols from being auto-exported in both EC and native views. | ||
|
||
// RUN: lld-link -machine:arm64x -lldmingw -dll -noentry -out:%t2.dll %t.arm64.obj %t.arm64ec.obj -export:sym \ | ||
// RUN: %t-loadconfig-arm64.obj %t-loadconfig-arm64ec.obj | ||
|
||
// RUN: llvm-readobj --coff-exports %t2.dll | FileCheck --check-prefix=EXP2 %s | ||
// EXP2: Format: COFF-ARM64X | ||
// EXP2-NEXT: Arch: aarch64 | ||
// EXP2-NEXT: AddressSize: 64bit | ||
// EXP2-NEXT: HybridObject { | ||
// EXP2-NEXT: Format: COFF-ARM64EC | ||
// EXP2-NEXT: Arch: aarch64 | ||
// EXP2-NEXT: AddressSize: 64bit | ||
// EXP2-NEXT: Export { | ||
// EXP2-NEXT: Ordinal: 1 | ||
// EXP2-NEXT: Name: sym | ||
// EXP2-NEXT: RVA: 0x2008 | ||
// EXP2-NEXT: } | ||
// EXP2-NEXT: } | ||
|
||
.data | ||
.globl sym | ||
sym: | ||
.word 0 | ||
.globl sym2 | ||
sym2: | ||
.word 0 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note; I guess this is a symbol we could include in
excludeSymbols
, as it doesn't make sense to autoexport this one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will do that in a followup. Thanks!