Petr Hosek | c4df10e | 2017-08-04 21:09:26 +0000 | [diff] [blame] | 1 | # RUN: yaml2obj %s -o %t |
| 2 | # RUN: llvm-objcopy -O binary %t %t2 |
| 3 | # RUN: od -t x2 %t2 | FileCheck %s |
| 4 | # RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE |
| 5 | |
| 6 | !ELF |
| 7 | FileHeader: |
| 8 | Class: ELFCLASS64 |
| 9 | Data: ELFDATA2LSB |
| 10 | Type: ET_EXEC |
| 11 | Machine: EM_X86_64 |
| 12 | Sections: |
| 13 | - Name: .text |
| 14 | Type: SHT_PROGBITS |
| 15 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
Jake Ehrlich | 46814be | 2018-01-22 19:27:30 +0000 | [diff] [blame] | 16 | Address: 0x1000 |
Petr Hosek | c4df10e | 2017-08-04 21:09:26 +0000 | [diff] [blame] | 17 | AddressAlign: 0x0000000000001000 |
| 18 | Content: "c3c3c3c3" |
| 19 | - Name: .data |
| 20 | Type: SHT_PROGBITS |
Jake Ehrlich | 46814be | 2018-01-22 19:27:30 +0000 | [diff] [blame] | 21 | Flags: [ SHF_ALLOC ] |
| 22 | Address: 0x2000 |
Petr Hosek | c4df10e | 2017-08-04 21:09:26 +0000 | [diff] [blame] | 23 | AddressAlign: 0x0000000000001000 |
| 24 | Content: "3232" |
| 25 | ProgramHeaders: |
| 26 | - Type: PT_LOAD |
| 27 | Flags: [ PF_X, PF_R ] |
Jake Ehrlich | 46814be | 2018-01-22 19:27:30 +0000 | [diff] [blame] | 28 | VAddr: 0x1000 |
| 29 | PAddr: 0x1000 |
| 30 | Align: 0x1000 |
Petr Hosek | c4df10e | 2017-08-04 21:09:26 +0000 | [diff] [blame] | 31 | Sections: |
| 32 | - Section: .text |
| 33 | - Type: PT_LOAD |
Jake Ehrlich | 46814be | 2018-01-22 19:27:30 +0000 | [diff] [blame] | 34 | Flags: [ PF_R, PF_W ] |
| 35 | VAddr: 0x2000 |
| 36 | PAddr: 0x4000 |
| 37 | Align: 0x1000 |
Petr Hosek | c4df10e | 2017-08-04 21:09:26 +0000 | [diff] [blame] | 38 | Sections: |
| 39 | - Section: .data |
| 40 | |
| 41 | # CHECK: 0000000 c3c3 c3c3 0000 0000 0000 0000 0000 0000 |
| 42 | # CHECK-NEXT: 0000020 0000 0000 0000 0000 0000 0000 0000 0000 |
| 43 | # CHECK-NEXT: * |
Jake Ehrlich | 46814be | 2018-01-22 19:27:30 +0000 | [diff] [blame] | 44 | # CHECK-NEXT: 0030000 3232 |
| 45 | # SIZE: 12290 |