-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[DirectX] Add boilerplate integration of objcopy for DXContainerObjectFile
#153079
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 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
44f66db
boiler plate to add dxcontainer to objcopy
inbelic 648d0fc
add basic tests
inbelic c4b1096
self-review: recompute offsets instead of storing them
inbelic a3229ee
review: use dxbc instead of dxc
inbelic 7ca8df7
review: account for endianness on non-copy values
inbelic 56cbd57
review: address LLVM/objcopy guideline comments
inbelic c78cc58
review: allow PreserveDates
inbelic 152c383
review: remove symbol related options
inbelic 99e3b41
review: remove partition related options
inbelic dc8e3c2
self-review: correct header filesize
inbelic 364681a
review: fix up comments
inbelic 4fa61af
review: ensure reader errors are surfaced
inbelic 9a60220
review: fix up comments
inbelic 79c043e
review: rename files
inbelic 40d4594
review: rename test
inbelic c0aec7a
review: assert offsets
inbelic b4c17fb
review: add comment
inbelic 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| ## Check that llvm-objcopy reports a suitable error when it | ||
| ## encounters an invalid input during reading. The purpose is not to have | ||
| ## extensive of all read errors, that should be done in DXContainerTest.cpp, | ||
| ## instead this is a sanity check that the error is produced when using the | ||
| ## reader in llvm-objcopy. | ||
|
|
||
| ## We can't have multiple DXIL parts. | ||
| # RUN: yaml2obj %s --docnum=1 -o %t1 | ||
| # RUN: not llvm-objcopy %t1 %t1.out 2>&1 | FileCheck %s -DFILE=%t1 --check-prefix=ERROR1 | ||
|
|
||
| # ERROR1: error: '[[FILE]]': More than one DXIL part is present in the file | ||
|
|
||
| --- !dxcontainer | ||
| Header: | ||
| Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, | ||
| 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] | ||
| Version: | ||
| Major: 1 | ||
| Minor: 0 | ||
| PartCount: 2 | ||
| Parts: | ||
| - Name: DXIL | ||
| Size: 28 | ||
| - Name: DXIL | ||
| Size: 28 | ||
| ... | ||
|
|
||
| ## The first part offset is out of file bound. | ||
inbelic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # RUN: yaml2obj %s --docnum=2 -o %t2 | ||
| # RUN: not llvm-objcopy %t2 %t2.out 2>&1 | FileCheck %s -DFILE=%t2 --check-prefix=ERROR2 | ||
|
|
||
| # ERROR2: error: '[[FILE]]': Reading structure out of file bounds | ||
|
|
||
| --- !dxcontainer | ||
| Header: | ||
| Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, | ||
| 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] | ||
| Version: | ||
| Major: 2 | ||
| Minor: 0 | ||
| PartCount: 1 | ||
| PartOffsets: [ 48 ] | ||
| Parts: | ||
| - Name: DXIL | ||
| Size: 28 | ||
| ... | ||
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
Oops, something went wrong.
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.