-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yaml2obj] Add support for structured COFF section data.
Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D149439
- Loading branch information
Showing
8 changed files
with
161 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,22 @@ | ||
# RUN: not yaml2obj %s -o %t 2>&1 | FileCheck %s | ||
# CHECK: YAML:18:5: error: unknown key 'SizeOfRawData' | ||
|
||
--- !COFF | ||
OptionalHeader: | ||
ImageBase: 0x180000000 | ||
SectionAlignment: 4096 | ||
FileAlignment: 512 | ||
DLLCharacteristics: [ ] | ||
header: | ||
Machine: IMAGE_FILE_MACHINE_AMD64 | ||
Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] | ||
sections: | ||
- Name: .rdata | ||
Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ ] | ||
VirtualAddress: 0x1000 | ||
VirtualSize: 20 | ||
SizeOfRawData: 4 | ||
StructuredData: | ||
- UInt32: 1 | ||
symbols: [] | ||
... |
This file contains 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,22 @@ | ||
# RUN: not yaml2obj %s -o %t 2>&1 | FileCheck %s | ||
# CHECK: error: StructuredData and SectionData can't be used together | ||
|
||
--- !COFF | ||
OptionalHeader: | ||
ImageBase: 0x180000000 | ||
SectionAlignment: 4096 | ||
FileAlignment: 512 | ||
DLLCharacteristics: [ ] | ||
header: | ||
Machine: IMAGE_FILE_MACHINE_AMD64 | ||
Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] | ||
sections: | ||
- Name: .rdata | ||
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] | ||
VirtualAddress: 0x1000 | ||
VirtualSize: 20 | ||
SectionData: 55 | ||
StructuredData: | ||
- UInt32: 1 | ||
symbols: [] | ||
... |
This file contains 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,25 @@ | ||
# RUN: yaml2obj %s -o %t | ||
# RUN: llvm-readobj --hex-dump=.rdata %t | FileCheck %s | ||
# CHECK: 0x180001000 01000000 02000000 11223344 ffffffff | ||
|
||
--- !COFF | ||
OptionalHeader: | ||
ImageBase: 0x180000000 | ||
SectionAlignment: 4096 | ||
FileAlignment: 512 | ||
DLLCharacteristics: [ ] | ||
header: | ||
Machine: IMAGE_FILE_MACHINE_AMD64 | ||
Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] | ||
sections: | ||
- Name: .rdata | ||
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] | ||
VirtualAddress: 0x1000 | ||
VirtualSize: 20 | ||
StructuredData: | ||
- UInt32: 1 | ||
- UInt32: 2 | ||
- Binary: 11223344 | ||
- UInt32: 0xffffffff | ||
symbols: [] | ||
... |