1 # RUN: yaml2obj %s -o %t
3 ## The binary used in this test can be built (on OSX) as follows:
5 ## __attribute__((used)) static int a[1021];
6 ## __attribute__((used)) static char b = 1;
11 ## clang -fno-exceptions -fno-unwind-tables main.c -o main.exe
12 ## Note, that the variable "b" (whose size is 1) is placed into __DATA,__data section,
13 ## the array "a" (whose size is 4 * 1021 = 4084) is placed into __DATA,__bss and
14 ## __DATA,__bss is 16-byte aligned. In this case the total vmsize narrowly crosses
15 ## the border of one page (4096) and the final value should be equal to 8192.
17 # RUN: llvm-objcopy %t %t.copy
20 ## This additionally verifies that the binary created by llvm-objcopy/yaml2obj is valid.
21 # RUN: llvm-readobj --sections %t.copy
27 cpusubtype: 0x80000003
59 addr: 0x0000000100000FA0
69 content: 554889E531C0C745FC000000005DC3
70 - sectname: __unwind_info
72 addr: 0x0000000100000FB0
82 content: 010000001C000000000000001C000000000000001C00000002000000A00F00003400000034000000B00F00000000000034000000030000000C000100100001000000000000000000
97 addr: 0x0000000100001000
104 reserved1: 0x00000000
105 reserved2: 0x00000000
106 reserved3: 0x00000000
110 addr: 0x0000000100001010
117 reserved1: 0x00000000
118 reserved2: 0x00000000
119 reserved3: 0x00000000
131 - cmd: LC_DYLD_INFO_ONLY
169 - cmd: LC_LOAD_DYLINKER
172 Content: '/usr/lib/dyld'
176 uuid: 11362E8D-D70B-33B3-96F8-A70ADF2583C4
177 - cmd: LC_BUILD_VERSION
186 - cmd: LC_SOURCE_VERSION
198 current_version: 82115073
199 compatibility_version: 65536
200 Content: '/usr/lib/libSystem.B.dylib'
202 - cmd: LC_FUNCTION_STARTS
206 - cmd: LC_DATA_IN_CODE
215 Flags: 0x0000000000000000
216 Address: 0x0000000000000000
217 Other: 0x0000000000000000
223 Flags: 0x0000000000000000
224 Address: 0x0000000000000000
225 Other: 0x0000000000000000
230 Name: _mh_execute_header
231 Flags: 0x0000000000000000
232 Address: 0x0000000000000000
233 Other: 0x0000000000000000
238 Flags: 0x0000000000000000
239 Address: 0x0000000000000FA0
240 Other: 0x0000000000000000
256 - __mh_execute_header