Changeset View
Changeset View
Standalone View
Standalone View
test/tools/llvm-objcopy/binary-segment-layout.test
- This file was moved from test/tools/llvm-objcopy/basic-align-copy.test.
# RUN: yaml2obj %s -o %t | # RUN: yaml2obj %s -o %t | ||||
jakehehrlich: Can you rename this file to "binary-segment-layout" or something that that relates to what the… | |||||
# RUN: llvm-objcopy -O binary %t %t2 | # RUN: llvm-objcopy -O binary %t %t2 | ||||
# RUN: od -t x2 %t2 | FileCheck %s | # RUN: od -t x2 %t2 | FileCheck %s | ||||
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE | # RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE | ||||
!ELF | !ELF | ||||
FileHeader: | FileHeader: | ||||
Class: ELFCLASS64 | Class: ELFCLASS64 | ||||
Data: ELFDATA2LSB | Data: ELFDATA2LSB | ||||
Type: ET_EXEC | Type: ET_EXEC | ||||
Machine: EM_X86_64 | Machine: EM_X86_64 | ||||
Sections: | Sections: | ||||
- Name: .text | - Name: .text | ||||
Type: SHT_PROGBITS | Type: SHT_PROGBITS | ||||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||||
AddressAlign: 0x0000000000001000 | AddressAlign: 0x0000000000001000 | ||||
Address: 0x00 | |||||
Content: "c3c3c3c3" | Content: "c3c3c3c3" | ||||
- Name: .data | - Name: .data | ||||
Type: SHT_PROGBITS | Type: SHT_PROGBITS | ||||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||||
AddressAlign: 0x0000000000001000 | AddressAlign: 0x0000000000000008 | ||||
Address: 0x08 | |||||
Content: "3232" | Content: "3232" | ||||
ProgramHeaders: | ProgramHeaders: | ||||
- Type: PT_LOAD | - Type: PT_LOAD | ||||
Flags: [ PF_X, PF_R ] | Flags: [ PF_X, PF_R ] | ||||
VAddr: 0x00 | |||||
Sections: | Sections: | ||||
- Section: .text | - Section: .text | ||||
- Type: PT_LOAD | - Type: PT_LOAD | ||||
Flags: [ PF_R ] | Flags: [ PF_R ] | ||||
VAddr: 0x08 | |||||
Not Done ReplyInline ActionsThis will violate the p_addr == p_offset (MOD p_align) requirement as is. If you don't want these to be on seperate pages change the Address Align of the sections. Ideally we would have small AddressAlign's and large ProgramHeader alignment but unfortunately I haven't updated the layout strategy of yaml2obj to make that work properly yet so I've been getting by with this. jakehehrlich: This will violate the p_addr == p_offset (MOD p_align) requirement as is. If you don't want… | |||||
Sections: | Sections: | ||||
- Section: .data | - Section: .data | ||||
# CHECK: 0000000 c3c3 c3c3 0000 0000 0000 0000 0000 0000 | # CHECK: 0000000 c3c3 c3c3 0000 0000 3232 | ||||
# CHECK-NEXT: 0000020 0000 0000 0000 0000 0000 0000 0000 0000 | # SIZE: 10 | ||||
# CHECK-NEXT: * | |||||
# CHECK-NEXT: 0010000 3232 | |||||
# SIZE: 4098 |
Can you rename this file to "binary-segment-layout" or something that that relates to what the test now actually tests since it no longer tests that alignment is respected.