2013-06-13 06:19:05 +08:00
|
|
|
# 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.
|
|
|
|
#
|
2013-07-05 18:41:44 +08:00
|
|
|
# RUN: yaml2obj %p/Inputs/nop.obj.yaml > %t.obj
|
|
|
|
#
|
2013-09-19 10:37:36 +08:00
|
|
|
# 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 \
|
2013-08-27 11:18:11 +08:00
|
|
|
# RUN: | FileCheck -check-prefix=FILE %s
|
2013-07-05 18:41:44 +08:00
|
|
|
#
|
2013-11-25 10:00:00 +08:00
|
|
|
# RUN: lld -flavor link /out:%t1 /subsystem:console /entry:start /opt:noref \
|
|
|
|
# RUN: -- %t.obj \
|
2013-07-05 18:41:44 +08:00
|
|
|
# RUN: && llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTIONS %s
|
2013-05-29 02:13:31 +08:00
|
|
|
|
2013-11-27 08:55:45 +08:00
|
|
|
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: 2
|
|
|
|
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
|
2013-12-11 12:06:26 +08:00
|
|
|
FILE-NEXT: SizeOfCode: 6
|
2013-11-27 08:55:45 +08:00
|
|
|
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
|
2013-06-07 09:31:51 +08:00
|
|
|
|
2013-11-27 08:55:45 +08:00
|
|
|
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: .data (2E 64 61 74 61 00 00 00)
|
|
|
|
SECTIONS-NEXT: VirtualSize: 0x0
|
|
|
|
SECTIONS-NEXT: VirtualAddress: 0x1000
|
|
|
|
SECTIONS-NEXT: RawDataSize: 0
|
|
|
|
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_INITIALIZED_DATA
|
|
|
|
SECTIONS-NEXT: IMAGE_SCN_MEM_READ
|
|
|
|
SECTIONS-NEXT: IMAGE_SCN_MEM_WRITE
|
|
|
|
SECTIONS-NEXT: ]
|
|
|
|
SECTIONS-NEXT: }
|
|
|
|
SECTIONS-NEXT: Section {
|
|
|
|
SECTIONS-NEXT: Number: 2
|
|
|
|
SECTIONS-NEXT: Name: .text (2E 74 65 78 74 00 00 00)
|
|
|
|
SECTIONS-NEXT: VirtualSize: 0x6
|
|
|
|
SECTIONS-NEXT: VirtualAddress: 0x1000
|
2013-12-11 12:06:26 +08:00
|
|
|
SECTIONS-NEXT: RawDataSize: 6
|
2013-11-27 08:55:45 +08:00
|
|
|
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: ]
|