-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[LLD][COFF] Add more variety of CET and hotpatch flags #150761
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 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1082e93
[LLD][COFF] Add more variety of CET flags
kkent030315 884e21f
lint
kkent030315 9e6664e
turn off linting for COFFDumper
kkent030315 539cc6f
fix test
kkent030315 6723a3e
reorder options
kkent030315 c6e5147
Check that hotpatchable image requires at lest 6 bytes of func pad
kkent030315 c2c6aee
remove redundant braces
kkent030315 cefc30e
add test for /hotpatchcompatible func pad requirement
kkent030315 16cc002
fix test
kkent030315 4441644
Merge remote-tracking branch 'upstream/main' into cetvariants
kkent030315 2a68b44
Revert changes in llvm-readobj
kkent030315 9347e53
Merge remote-tracking branch 'upstream/main' into cetvariants
kkent030315 dc065e8
squash tests into the one and cover [:no] tests
kkent030315 c508db0
fix comment
kkent030315 fb91ee6
add test covers `/hotpatchcompatible` without `/functionpadmin`
kkent030315 120c8ed
remove dup tests from options.test
kkent030315 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
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,15 @@ | ||
| RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj | ||
| RUN: lld-link /out:%t.exe /entry:main /cetcompatstrict %t.obj | ||
| RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s | ||
|
|
||
| CHECK: DebugEntry { | ||
| CHECK: Characteristics: 0x0 | ||
| CHECK: Type: ExtendedDLLCharacteristics (0x14) | ||
| CHECK: ExtendedCharacteristics [ (0x2) | ||
| CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE (0x2) | ||
| CHECK: ] | ||
| CHECK: RawData ( | ||
| CHECK: 0000: 02000000 |....| | ||
| CHECK: ) | ||
| CHECK: } | ||
|
|
||
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,15 @@ | ||
| RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj | ||
| RUN: lld-link /out:%t.exe /entry:main /cetdynamicapisinproc %t.obj | ||
| RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s | ||
|
|
||
| CHECK: DebugEntry { | ||
| CHECK: Characteristics: 0x0 | ||
| CHECK: Type: ExtendedDLLCharacteristics (0x14) | ||
| CHECK: ExtendedCharacteristics [ (0x8) | ||
| CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY (0x8) | ||
| CHECK: ] | ||
| CHECK: RawData ( | ||
| CHECK: 0000: 08000000 |....| | ||
| CHECK: ) | ||
| CHECK: } | ||
|
|
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,15 @@ | ||
| RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj | ||
| RUN: lld-link /out:%t.exe /entry:main /cetipvalidationrelaxed %t.obj | ||
| RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s | ||
|
|
||
| CHECK: DebugEntry { | ||
| CHECK: Characteristics: 0x0 | ||
| CHECK: Type: ExtendedDLLCharacteristics (0x14) | ||
| CHECK: ExtendedCharacteristics [ (0x4) | ||
| CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE (0x4) | ||
| CHECK: ] | ||
| CHECK: RawData ( | ||
| CHECK: 0000: 04000000 |....| | ||
| CHECK: ) | ||
| CHECK: } | ||
|
|
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,33 @@ | ||
| RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj | ||
| RUN: lld-link /out:%t.exe /entry:main /hotpatchcompatible /functionpadmin:6 %t.obj | ||
| RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck -check-prefix=CHECK1 %s | ||
|
|
||
| CHECK1: DebugEntry { | ||
| CHECK1: Characteristics: 0x0 | ||
| CHECK1: Type: ExtendedDLLCharacteristics (0x14) | ||
| CHECK1: ExtendedCharacteristics [ (0x80) | ||
| CHECK1: IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE (0x80) | ||
| CHECK1: ] | ||
| CHECK1: RawData ( | ||
| CHECK1: 0000: 80000000 |....| | ||
| CHECK1: ) | ||
| CHECK1: } | ||
|
|
||
| // ---- more than 6 bytes is accepted | ||
| RUN: lld-link /out:%t.exe /entry:main /hotpatchcompatible /functionpadmin:10 %t.obj | ||
| RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck -check-prefix=CHECK2 %s | ||
|
|
||
| CHECK2: DebugEntry { | ||
| CHECK2: Characteristics: 0x0 | ||
| CHECK2: Type: ExtendedDLLCharacteristics (0x14) | ||
| CHECK2: ExtendedCharacteristics [ (0x80) | ||
| CHECK2: IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE (0x80) | ||
| CHECK2: ] | ||
| CHECK2: RawData ( | ||
| CHECK2: 0000: 80000000 |....| | ||
| CHECK2: ) | ||
| CHECK2: } | ||
|
|
||
| // ---- hotpach compatible image requires at least 6 bytes function padding | ||
| RUN: not lld-link /out:%t.exe /entry:main /hotpatchcompatible /functionpadmin:5 %t.obj | ||
kkent030315 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CHECK3: lld-link: error: /hotpatchcompatible: requires at least 6 bytes of /functionpadmin | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.