This pr implements the `only-section` option for a `DXContainer` object in `llvm-objcopy`. It extends the base `removeParts` of the minimal object representation of a `DXContainerObject`. This a pre-requisite step to implement https://github.com/llvm/llvm-project/issues/150286 as a way to strip all other information away.
56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
## Tests that the copied DXContainer correctly retains only the specified
|
|
## headers.
|
|
|
|
# RUN: yaml2obj %s -o %t
|
|
# RUN: llvm-objcopy --only-section=FKE1 --only-section=FKE4 %t %t.out
|
|
# RUN: obj2yaml %t.out | FileCheck %s --implicit-check-not=Name:
|
|
|
|
## FileSize = 32 (header)
|
|
## + 8 (FKE1 content) + 1688 (FKE4 content)
|
|
## + 8 (2 part offsets) + 16 (2 part headers)
|
|
## = 1752
|
|
# CHECK: FileSize: 1752
|
|
# CHECK-NEXT: PartCount: 2
|
|
# CHECK-NEXT: PartOffsets: [ 40, 56 ]
|
|
# CHECK-NEXT: Parts
|
|
# CHECK-NEXT: Name: FKE1
|
|
# CHECK-NEXT: Size: 8
|
|
# CHECK-NEXT: Name: FKE4
|
|
# CHECK-NEXT: Size: 1688
|
|
|
|
--- !dxcontainer
|
|
Header:
|
|
Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ]
|
|
Version:
|
|
Major: 1
|
|
Minor: 0
|
|
FileSize: 1996
|
|
PartCount: 7
|
|
PartOffsets: [ 60, 76, 92, 108, 236, 1932, 1960 ]
|
|
Parts:
|
|
- Name: FKE0
|
|
Size: 8
|
|
- Name: FKE1
|
|
Size: 8
|
|
- Name: FKE2
|
|
Size: 8
|
|
- Name: FKE3
|
|
Size: 120
|
|
- Name: FKE4
|
|
Size: 1688
|
|
- Name: FKE5
|
|
Size: 20
|
|
- Name: DXIL
|
|
Size: 28
|
|
Program:
|
|
MajorVersion: 6
|
|
MinorVersion: 5
|
|
ShaderKind: 5
|
|
Size: 8
|
|
DXILMajorVersion: 1
|
|
DXILMinorVersion: 5
|
|
DXILSize: 4
|
|
DXIL: [ 0x42, 0x43, 0xC0, 0xDE, ]
|
|
...
|