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

85 lines
2.7 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 /subsystem:console,3.11 /version:1.25 \
# RUN: /entry:start /opt:noref -- %t.obj && llvm-readobj -file-headers %t1 \
# RUN: | FileCheck -check-prefix=FILE %s
#
# RUN: lld -flavor link /out:%t1 /entry:start /opt:noref -- %t.obj \
# RUN: && llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTIONS %s
FILE: Format: COFF-i386
FILE: Arch: i386
FILE: AddressSize: 32bit
FILE: ImageFileHeader {
FILE: Machine: IMAGE_FILE_MACHINE_I386 (0x14C)
FILE: SectionCount: 1
FILE: TimeDateStamp:
FILE: PointerToSymbolTable: 0x0
FILE: SymbolCount: 0
FILE: OptionalHeaderSize: 224
FILE: Characteristics [ (0x102)
FILE: IMAGE_FILE_32BIT_MACHINE (0x100)
FILE: IMAGE_FILE_EXECUTABLE_IMAGE (0x2)
FILE: ]
FILE: }
FILE: ImageOptionalHeader {
FILE: MajorLinkerVersion: 0
FILE: MinorLinkerVersion: 0
FILE: SizeOfCode: 512
FILE: SizeOfInitializedData: 0
FILE: SizeOfUninitializedData: 0
FILE: AddressOfEntryPoint: 0x1000
FILE: BaseOfCode: 0x1000
FILE: BaseOfData: 0
FILE: ImageBase: 0x400000
FILE: SectionAlignment: 4096
FILE: FileAlignment: 512
FILE: MajorOperatingSystemVersion: 3
FILE: MinorOperatingSystemVersion: 11
FILE: MajorImageVersion: 1
FILE: MinorImageVersion: 25
FILE: MajorSubsystemVersion: 3
FILE: MinorSubsystemVersion: 11
FILE: SizeOfImage: 8192
FILE: SizeOfHeaders: 512
FILE: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
FILE: Subsystem [ (0x8540)
FILE: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
FILE: IMAGE_DLL_CHARACTERISTICS_NO_SEH (0x400)
FILE: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
FILE: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
FILE: ]
FILE: SizeOfStackReserve: 1048576
FILE: SizeOfStackCommit: 4096
FILE: SizeOfHeapReserve: 1048576
FILE: SizeOfHeapCommit: 4096
FILE: NumberOfRvaAndSize: 16
FILE: }
SECTIONS: Format: COFF-i386
SECTIONS: Arch: i386
SECTIONS: AddressSize: 32bit
SECTIONS: Sections [
SECTIONS: Section {
SECTIONS: Number: 1
SECTIONS: Name: .text (2E 74 65 78 74 00 00 00)
SECTIONS: VirtualSize: 0x6
SECTIONS: VirtualAddress: 0x1000
SECTIONS: RawDataSize: 512
SECTIONS: PointerToRawData: 0x200
SECTIONS: PointerToRelocations: 0x0
SECTIONS: PointerToLineNumbers: 0x0
SECTIONS: RelocationCount: 0
SECTIONS: LineNumberCount: 0
SECTIONS: Characteristics [ (0x60000020)
SECTIONS: IMAGE_SCN_CNT_CODE (0x20)
SECTIONS: IMAGE_SCN_MEM_EXECUTE (0x20000000)
SECTIONS: IMAGE_SCN_MEM_READ (0x40000000)
SECTIONS: ]
SECTIONS: }
SECTIONS: ]