llvm-project/lld/test/pecoff/trivial.test

85 lines
3.1 KiB
Plaintext

# Checks functionality of PECOFF writer. "nop.obj" is an object that has only
# text section. Other data, including data sections, relocations, symbol
# tables are not present in nop.obj.
#
# RUN: yaml2obj %p/Inputs/nop.obj.yaml > %t.obj
#
# RUN: lld -flavor link /out:%t1.exe /subsystem:console,3.11 /version:1.25 \
# RUN: /entry:start /opt:noref -- %t.obj
# RUN: llvm-readobj -file-headers %t1.exe | FileCheck -check-prefix=FILE %s
#
# RUN: lld -flavor link /out:%t2.exe /subsystem:console /entry:start \
# RUN: /opt:noref -- %t.obj
# RUN: llvm-readobj -sections %t2.exe | FileCheck -check-prefix=SECTIONS %s
FILE: Format: COFF-i386
FILE-NEXT: Arch: i386
FILE-NEXT: AddressSize: 32bit
FILE-NEXT: ImageFileHeader {
FILE-NEXT: Machine: IMAGE_FILE_MACHINE_I386 (0x14C)
FILE-NEXT: SectionCount: 1
FILE-NEXT: TimeDateStamp:
FILE-NEXT: PointerToSymbolTable: 0x0
FILE-NEXT: SymbolCount: 0
FILE-NEXT: OptionalHeaderSize: 224
FILE-NEXT: Characteristics [ (0x102)
FILE-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100)
FILE-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2)
FILE-NEXT: ]
FILE-NEXT: }
FILE-NEXT: ImageOptionalHeader {
FILE-NEXT: MajorLinkerVersion: 0
FILE-NEXT: MinorLinkerVersion: 0
FILE-NEXT: SizeOfCode: 512
FILE-NEXT: SizeOfInitializedData: 0
FILE-NEXT: SizeOfUninitializedData: 0
FILE-NEXT: AddressOfEntryPoint: 0x1000
FILE-NEXT: BaseOfCode: 0x1000
FILE-NEXT: BaseOfData: 0
FILE-NEXT: ImageBase: 0x400000
FILE-NEXT: SectionAlignment: 4096
FILE-NEXT: FileAlignment: 512
FILE-NEXT: MajorOperatingSystemVersion: 3
FILE-NEXT: MinorOperatingSystemVersion: 11
FILE-NEXT: MajorImageVersion: 1
FILE-NEXT: MinorImageVersion: 25
FILE-NEXT: MajorSubsystemVersion: 3
FILE-NEXT: MinorSubsystemVersion: 11
FILE-NEXT: SizeOfImage: 8192
FILE-NEXT: SizeOfHeaders: 512
FILE-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
FILE-NEXT: Subsystem [ (0x8540)
FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_NO_SEH (0x400)
FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
FILE-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
FILE-NEXT: ]
FILE-NEXT: SizeOfStackReserve: 1048576
FILE-NEXT: SizeOfStackCommit: 4096
FILE-NEXT: SizeOfHeapReserve: 1048576
FILE-NEXT: SizeOfHeapCommit: 4096
FILE-NEXT: NumberOfRvaAndSize: 16
SECTIONS: Format: COFF-i386
SECTIONS-NEXT: Arch: i386
SECTIONS-NEXT: AddressSize: 32bit
SECTIONS-NEXT: Sections [
SECTIONS-NEXT: Section {
SECTIONS-NEXT: Number: 1
SECTIONS-NEXT: Name: .text (2E 74 65 78 74 00 00 00)
SECTIONS-NEXT: VirtualSize: 0x6
SECTIONS-NEXT: VirtualAddress: 0x1000
SECTIONS-NEXT: RawDataSize: 512
SECTIONS-NEXT: PointerToRawData: 0x200
SECTIONS-NEXT: PointerToRelocations: 0x0
SECTIONS-NEXT: PointerToLineNumbers: 0x0
SECTIONS-NEXT: RelocationCount: 0
SECTIONS-NEXT: LineNumberCount: 0
SECTIONS-NEXT: Characteristics [
SECTIONS-NEXT: IMAGE_SCN_CNT_CODE
SECTIONS-NEXT: IMAGE_SCN_MEM_EXECUTE
SECTIONS-NEXT: IMAGE_SCN_MEM_READ
SECTIONS-NEXT: ]
SECTIONS-NEXT: }
SECTIONS-NEXT: ]