forked from OSchip/llvm-project
238 lines
7.6 KiB
Plaintext
238 lines
7.6 KiB
Plaintext
# This tests verifies functionality of omagic that we create only two segments,
|
|
# PT_LOAD, PT_TLS
|
|
# The data segment should not be aligned to a page boundary
|
|
RUN: lld -flavor old-gnu -target x86_64-linux %p/Inputs/nmagic.o \
|
|
RUN: --noinhibit-exec -o %t --omagic -static
|
|
RUN: llvm-readobj -sections %t | FileCheck -check-prefix=OMAGICSECTIONS %s
|
|
RUN: llvm-readobj -program-headers %t | FileCheck -check-prefix=OMAGICPROGRAMHEADERS %s
|
|
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: (0)
|
|
OMAGICSECTIONS: Type: SHT_NULL (0x0)
|
|
OMAGICSECTIONS: Flags [ (0x0)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x0
|
|
OMAGICSECTIONS: Offset: 0x0
|
|
OMAGICSECTIONS: Size: 0
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 0
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .text
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x6)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: SHF_EXECINSTR (0x4)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x4000E8
|
|
OMAGICSECTIONS: Offset: 0xE8
|
|
OMAGICSECTIONS: Size: 11
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 4
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .eh_frame
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x2)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x4000F8
|
|
OMAGICSECTIONS: Offset: 0xF8
|
|
OMAGICSECTIONS: Size: 56
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 8
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .eh_frame_hdr
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x2)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x400130
|
|
OMAGICSECTIONS: Offset: 0x130
|
|
OMAGICSECTIONS: Size: 8
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 8
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .tdata
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x403)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: SHF_TLS (0x400)
|
|
OMAGICSECTIONS: SHF_WRITE (0x1)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x400138
|
|
OMAGICSECTIONS: Offset: 0x138
|
|
OMAGICSECTIONS: Size: 4
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 4
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .tbss
|
|
OMAGICSECTIONS: Type: SHT_NOBITS (0x8)
|
|
OMAGICSECTIONS: Flags [ (0x403)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: SHF_TLS (0x400)
|
|
OMAGICSECTIONS: SHF_WRITE (0x1)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x40013C
|
|
OMAGICSECTIONS: Offset: 0x13C
|
|
OMAGICSECTIONS: Size: 8
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 4
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .got.plt
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x3)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: SHF_WRITE (0x1)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x400140
|
|
OMAGICSECTIONS: Offset: 0x140
|
|
OMAGICSECTIONS: Size: 0
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 8
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .data
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x3)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: SHF_WRITE (0x1)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x400140
|
|
OMAGICSECTIONS: Offset: 0x140
|
|
OMAGICSECTIONS: Size: 4
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 4
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .bss
|
|
OMAGICSECTIONS: Type: SHT_NOBITS (0x8)
|
|
OMAGICSECTIONS: Flags [ (0x3)
|
|
OMAGICSECTIONS: SHF_ALLOC (0x2)
|
|
OMAGICSECTIONS: SHF_WRITE (0x1)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x400144
|
|
OMAGICSECTIONS: Offset: 0x144
|
|
OMAGICSECTIONS: Size: 0
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 4
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .comment
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x0)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x0
|
|
OMAGICSECTIONS: Offset: 0x144
|
|
OMAGICSECTIONS: Size: 43
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 1
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .note.GNU-stack
|
|
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
|
|
OMAGICSECTIONS: Flags [ (0x0)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x0
|
|
OMAGICSECTIONS: Offset: 0x16F
|
|
OMAGICSECTIONS: Size: 0
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 1
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .shstrtab
|
|
OMAGICSECTIONS: Type: SHT_STRTAB (0x3)
|
|
OMAGICSECTIONS: Flags [ (0x0)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x0
|
|
OMAGICSECTIONS: Offset: 0x16F
|
|
OMAGICSECTIONS: Size: 115
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 1
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .symtab
|
|
OMAGICSECTIONS: Type: SHT_SYMTAB (0x2)
|
|
OMAGICSECTIONS: Flags [ (0x0)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x0
|
|
OMAGICSECTIONS: Offset: 0x1E8
|
|
OMAGICSECTIONS: Size: 504
|
|
OMAGICSECTIONS: Link: 13
|
|
OMAGICSECTIONS: Info: 8
|
|
OMAGICSECTIONS: AddressAlignment: 8
|
|
OMAGICSECTIONS: EntrySize: 24
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: Section {
|
|
OMAGICSECTIONS: Name: .strtab
|
|
OMAGICSECTIONS: Type: SHT_STRTAB (0x3)
|
|
OMAGICSECTIONS: Flags [ (0x0)
|
|
OMAGICSECTIONS: ]
|
|
OMAGICSECTIONS: Address: 0x0
|
|
OMAGICSECTIONS: Offset: 0x3E0
|
|
OMAGICSECTIONS: Size: 231
|
|
OMAGICSECTIONS: Link: 0
|
|
OMAGICSECTIONS: Info: 0
|
|
OMAGICSECTIONS: AddressAlignment: 1
|
|
OMAGICSECTIONS: EntrySize: 0
|
|
OMAGICSECTIONS: }
|
|
OMAGICSECTIONS: ]
|
|
|
|
OMAGICPROGRAMHEADERS: ProgramHeaders [
|
|
OMAGICPROGRAMHEADERS: ProgramHeader {
|
|
OMAGICPROGRAMHEADERS: Type: PT_LOAD (0x1)
|
|
OMAGICPROGRAMHEADERS: Offset: 0x0
|
|
OMAGICPROGRAMHEADERS: VirtualAddress: 0x400000
|
|
OMAGICPROGRAMHEADERS: PhysicalAddress: 0x400000
|
|
OMAGICPROGRAMHEADERS: FileSize: 324
|
|
OMAGICPROGRAMHEADERS: MemSize: 324
|
|
OMAGICPROGRAMHEADERS: Flags [ (0x7)
|
|
OMAGICPROGRAMHEADERS: PF_R (0x4)
|
|
OMAGICPROGRAMHEADERS: PF_W (0x2)
|
|
OMAGICPROGRAMHEADERS: PF_X (0x1)
|
|
OMAGICPROGRAMHEADERS: ]
|
|
OMAGICPROGRAMHEADERS: Alignment: 8
|
|
OMAGICPROGRAMHEADERS: }
|
|
OMAGICPROGRAMHEADERS: ProgramHeader {
|
|
OMAGICPROGRAMHEADERS: Type: PT_TLS (0x7)
|
|
OMAGICPROGRAMHEADERS: Offset: 0x138
|
|
OMAGICPROGRAMHEADERS: VirtualAddress: 0x400138
|
|
OMAGICPROGRAMHEADERS: PhysicalAddress: 0x400138
|
|
OMAGICPROGRAMHEADERS: FileSize: 4
|
|
OMAGICPROGRAMHEADERS: MemSize: 12
|
|
OMAGICPROGRAMHEADERS: Flags [ (0x6)
|
|
OMAGICPROGRAMHEADERS: PF_R (0x4)
|
|
OMAGICPROGRAMHEADERS: PF_W (0x2)
|
|
OMAGICPROGRAMHEADERS: ]
|
|
OMAGICPROGRAMHEADERS: Alignment: 4
|
|
OMAGICPROGRAMHEADERS: }
|
|
OMAGICPROGRAMHEADERS: ]
|