2017-08-27 14:46:59 -07:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: yaml2obj < %p/Inputs/hello32.yaml > %t.obj
|
|
|
|
# RUN: lld-link %t.obj %p/Inputs/std32.lib /subsystem:console \
|
|
|
|
# RUN: /entry:main@0 /alternatename:___delayLoadHelper2@8=_main@0 \
|
2018-08-04 14:47:16 -07:00
|
|
|
# RUN: /delayload:std32.dll /out:%t.exe
|
2017-08-27 14:46:59 -07:00
|
|
|
# RUN: llvm-readobj -coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
|
|
|
|
# RUN: llvm-readobj -coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
|
|
|
|
# RUN: llvm-objdump -d %t.exe | FileCheck -check-prefix=DISASM %s
|
|
|
|
|
|
|
|
IMPORT: Format: COFF-i386
|
|
|
|
IMPORT-NEXT: Arch: i386
|
|
|
|
IMPORT-NEXT: AddressSize: 32bit
|
|
|
|
IMPORT-NEXT: DelayImport {
|
|
|
|
IMPORT-NEXT: Name: std32.dll
|
|
|
|
IMPORT-NEXT: Attributes: 0x1
|
2018-08-04 14:47:16 -07:00
|
|
|
IMPORT-NEXT: ModuleHandle: 0x3018
|
|
|
|
IMPORT-NEXT: ImportAddressTable: 0x3020
|
|
|
|
IMPORT-NEXT: ImportNameTable: 0x2040
|
2017-08-27 14:46:59 -07:00
|
|
|
IMPORT-NEXT: BoundDelayImportTable: 0x0
|
|
|
|
IMPORT-NEXT: UnloadDelayImportTable: 0x0
|
|
|
|
IMPORT-NEXT: Import {
|
|
|
|
IMPORT-NEXT: Symbol: ExitProcess (0)
|
2018-08-04 14:47:16 -07:00
|
|
|
IMPORT-NEXT: Address: 0x401029
|
2017-08-27 14:46:59 -07:00
|
|
|
IMPORT-NEXT: }
|
|
|
|
IMPORT-NEXT: Import {
|
|
|
|
IMPORT-NEXT: Symbol: MessageBoxA (0)
|
2018-08-04 14:47:16 -07:00
|
|
|
IMPORT-NEXT: Address: 0x40103E
|
2017-08-27 14:46:59 -07:00
|
|
|
IMPORT-NEXT: }
|
|
|
|
IMPORT-NEXT: }
|
|
|
|
|
|
|
|
BASEREL: BaseReloc [
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x1005
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x100C
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x101F
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x1025
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x102C
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x1031
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x1041
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x1046
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x3020
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: Entry {
|
|
|
|
BASEREL-NEXT: Type: HIGHLOW
|
2018-08-04 14:47:16 -07:00
|
|
|
BASEREL-NEXT: Address: 0x3024
|
2017-08-27 14:46:59 -07:00
|
|
|
BASEREL-NEXT: }
|
|
|
|
BASEREL-NEXT: ]
|
|
|
|
|
2018-08-04 14:47:16 -07:00
|
|
|
DISASM: 102b: 68 20 30 40 00 pushl $4206624
|
|
|
|
DISASM-NEXT: 1030: 68 00 20 40 00 pushl $4202496
|
|
|
|
DISASM-NEXT: 1035: e8 c6 ff ff ff calll -58 <.text>
|
|
|
|
DISASM-NEXT: 103a: 5a popl %edx
|
|
|
|
DISASM-NEXT: 103b: 59 popl %ecx
|
|
|
|
DISASM-NEXT: 103c: ff e0 jmpl *%eax
|
|
|
|
DISASM-NEXT: 103e: 51 pushl %ecx
|
|
|
|
DISASM-NEXT: 103f: 52 pushl %edx
|
|
|
|
DISASM-NEXT: 1040: 68 24 30 40 00 pushl $4206628
|
|
|
|
DISASM-NEXT: 1045: 68 00 20 40 00 pushl $4202496
|
|
|
|
DISASM-NEXT: 104a: e8 b1 ff ff ff calll -79 <.text>
|
|
|
|
DISASM-NEXT: 104f: 5a popl %edx
|
|
|
|
DISASM-NEXT: 1050: 59 popl %ecx
|
|
|
|
DISASM-NEXT: 1051: ff e0 jmpl *%eax
|