Jake Ehrlich | d49c92b | 2017-11-15 19:13:31 +0000 | [diff] [blame] | 1 | # RUN: yaml2obj %s -o %t |
| 2 | # RUN: llvm-objcopy -R .text3 -O binary %t %t2 |
| 3 | # RUN: od -Ax -v -t x1 %t2 | FileCheck %s |
Jordan Rupprecht | 298ea3f | 2019-01-11 18:06:31 +0000 | [diff] [blame] | 4 | # RUN: wc -c %t2 | FileCheck %s --check-prefix=SIZE |
Jake Ehrlich | d49c92b | 2017-11-15 19:13:31 +0000 | [diff] [blame] | 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 ] |
| 16 | Address: 0x1000 |
| 17 | AddressAlign: 0x1000 |
| 18 | Content: "c3c3c3c3" |
| 19 | Size: 0x1000 |
| 20 | - Name: .text2 |
| 21 | Type: SHT_PROGBITS |
| 22 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| 23 | Address: 0x2000 |
| 24 | AddressAlign: 0x1000 |
| 25 | Content: "DEADBEEF" |
| 26 | Size: 0x1000 |
| 27 | - Name: .text3 |
| 28 | Type: SHT_PROGBITS |
| 29 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| 30 | Address: 0x3000 |
| 31 | AddressAlign: 0x1000 |
| 32 | Content: "32323232" |
| 33 | Size: 0x1000 |
| 34 | - Name: .text4 |
| 35 | Type: SHT_PROGBITS |
| 36 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| 37 | Address: 0x4000 |
| 38 | AddressAlign: 0x1000 |
| 39 | Content: "FFFFFFFF" |
| 40 | Size: 0x1000 |
| 41 | ProgramHeaders: |
| 42 | - Type: PT_LOAD |
| 43 | Flags: [ PF_R ] |
| 44 | VAddr: 0x1000 |
| 45 | PAddr: 0x1000 |
| 46 | Sections: |
| 47 | - Section: .text |
| 48 | - Section: .text2 |
| 49 | - Type: PT_LOAD |
| 50 | Flags: [ PF_R ] |
Jake Ehrlich | 46814be | 2018-01-22 19:27:30 +0000 | [diff] [blame] | 51 | VAddr: 0x3000 |
| 52 | PAddr: 0x3000 |
Jake Ehrlich | d49c92b | 2017-11-15 19:13:31 +0000 | [diff] [blame] | 53 | Sections: |
| 54 | - Section: .text3 |
| 55 | - Section: .text4 |
| 56 | |
| 57 | # CHECK: 000000 c3 c3 c3 c3 |
| 58 | # CHECK: 001000 de ad be ef |
| 59 | # CHECK: 002000 00 00 00 00 |
| 60 | # CHECK: 003000 ff ff ff ff |
| 61 | |
| 62 | # SIZE: 16384 |