Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Add a new load command LC_BUILD_VERSION. It is a generic version of LC_*_VERSION_MIN load_command used on Apple platforms. Instead of having a seperate load command for each platform, LC_BUILD_VERSION is recording platform info as an enum. It also records SDK version, min_os, and tools that used to build the binary. rdar://problem/29781291 Reviewers: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29044 llvm-svn: 292824
- Loading branch information
1 parent
cddeb75
commit 5b54a42
Showing
14 changed files
with
407 additions
and
1 deletion.
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
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,58 @@ | ||
# RUN: yaml2obj %s | obj2yaml | FileCheck %s | ||
|
||
--- !mach-o | ||
FileHeader: | ||
magic: 0xFEEDFACE | ||
cputype: 0x00000007 | ||
cpusubtype: 0x00000003 | ||
filetype: 0x00000004 | ||
ncmds: 2 | ||
sizeofcmds: 192 | ||
flags: 0x00000000 | ||
LoadCommands: | ||
- cmd: LC_SEGMENT_64 | ||
cmdsize: 152 | ||
segname: __TEXT | ||
vmaddr: 4294967296 | ||
vmsize: 8192 | ||
fileoff: 0 | ||
filesize: 3099 | ||
maxprot: 7 | ||
initprot: 5 | ||
nsects: 1 | ||
flags: 0 | ||
Sections: | ||
- sectname: __text | ||
segname: __TEXT | ||
addr: 0x0000000100001160 | ||
size: 3099 | ||
offset: 0x00001160 | ||
align: 4 | ||
reloff: 0x00000000 | ||
nreloc: 0 | ||
flags: 0x80000400 | ||
reserved1: 0x00000000 | ||
reserved2: 0x00000000 | ||
reserved3: 0x00000000 | ||
- cmd: LC_BUILD_VERSION | ||
cmdsize: 32 | ||
platform: 2 | ||
minos: 0x00080000 | ||
sdk: 0x00090000 | ||
ntools: 1 | ||
Tools: | ||
- tool: 1 | ||
version: 0x00000000 | ||
... | ||
|
||
|
||
CHECK: LoadCommands: | ||
CHECK: - cmd: LC_BUILD_VERSION | ||
CHECK-NEXT: cmdsize: 32 | ||
CHECK-NEXT: platform: 2 | ||
CHECK-NEXT: minos: 524288 | ||
CHECK-NEXT: sdk: 589824 | ||
CHECK-NEXT: ntools: 1 | ||
CHECK-NEXT: Tools: | ||
CHECK-NEXT: - tool: 1 | ||
CHECK-NEXT: version: 0 |
44 changes: 44 additions & 0 deletions
44
llvm/test/tools/llvm-objdump/X86/invalid-macho-build-version.yaml
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,44 @@ | ||
# RUN: yaml2obj %s | not llvm-objdump -macho -private-headers - | ||
|
||
--- !mach-o | ||
FileHeader: | ||
magic: 0xFEEDFACF | ||
cputype: 0x01000007 | ||
cpusubtype: 0x00000003 | ||
filetype: 0x00000004 | ||
ncmds: 2 | ||
sizeofcmds: 192 | ||
flags: 0x00000000 | ||
reserved: 0 | ||
LoadCommands: | ||
- cmd: LC_SEGMENT_64 | ||
cmdsize: 152 | ||
segname: __TEXT | ||
vmaddr: 4294967296 | ||
vmsize: 8192 | ||
fileoff: 0 | ||
filesize: 3099 | ||
maxprot: 7 | ||
initprot: 5 | ||
nsects: 1 | ||
flags: 0 | ||
Sections: | ||
- sectname: __text | ||
segname: __TEXT | ||
addr: 0x0000000100001160 | ||
size: 3099 | ||
offset: 0x00001160 | ||
align: 4 | ||
reloff: 0x00000000 | ||
nreloc: 0 | ||
flags: 0x80000400 | ||
reserved1: 0x00000000 | ||
reserved2: 0x00000000 | ||
reserved3: 0x00000000 | ||
- cmd: LC_BUILD_VERSION | ||
cmdsize: 80 | ||
platform: 2 | ||
minos: 0x00080000 | ||
sdk: 0x00090000 | ||
ntools: 0 | ||
... |
Oops, something went wrong.