2 # RUN: yaml2obj %s -o %t.obj
3 # RUN: lld-link %t.obj %p/Inputs/library.lib /subsystem:console \
4 # RUN: /entry:mainCRTStartup /alternatename:__delayLoadHelper2=mainCRTStartup \
5 # RUN: /delayload:library.dll /out:%t.exe
6 # RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
7 # RUN: llvm-readobj --coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
8 # RUN: llvm-objdump --no-print-imm-hex -d %t.exe | FileCheck --check-prefix=DISASM %s
9 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=DIR %s
11 # IMPORT: Format: COFF-ARM
12 # IMPORT-NEXT: Arch: thumb
13 # IMPORT-NEXT: AddressSize: 32bit
14 # IMPORT-NEXT: DelayImport {
15 # IMPORT-NEXT: Name: library.dll
16 # IMPORT-NEXT: Attributes: 0x1
17 # IMPORT-NEXT: ModuleHandle: 0x3008
18 # IMPORT-NEXT: ImportAddressTable: 0x3010
19 # IMPORT-NEXT: ImportNameTable: 0x2044
20 # IMPORT-NEXT: BoundDelayImportTable: 0x0
21 # IMPORT-NEXT: UnloadDelayImportTable: 0x0
22 # IMPORT-NEXT: Import {
23 # IMPORT-NEXT: Symbol: function (0)
24 # IMPORT-NEXT: Address: 0x40100D
28 # BASEREL: BaseReloc [
29 # BASEREL-NEXT: Entry {
30 # BASEREL-NEXT: Type: ARM_MOV32(T)
31 # BASEREL-NEXT: Address: 0x1000
33 # BASEREL-NEXT: Entry {
34 # BASEREL-NEXT: Type: ARM_MOV32(T)
35 # BASEREL-NEXT: Address: 0x100C
37 # BASEREL-NEXT: Entry {
38 # BASEREL-NEXT: Type: ARM_MOV32(T)
39 # BASEREL-NEXT: Address: 0x1026
41 # BASEREL-NEXT: Entry {
42 # BASEREL-NEXT: Type: ABSOLUTE
43 # BASEREL-NEXT: Address: 0x1000
45 # BASEREL-NEXT: Entry {
46 # BASEREL-NEXT: Type: HIGHLOW
47 # BASEREL-NEXT: Address: 0x3010
49 # BASEREL-NEXT: Entry {
50 # BASEREL-NEXT: Type: ABSOLUTE
51 # BASEREL-NEXT: Address: 0x3000
55 # DISASM: 00401000 <.text>:
56 # DISASM: 40100c: f243 0c10 movw r12, #12304
57 # DISASM-NEXT: f2c0 0c40 movt r12, #64
58 # DISASM-NEXT: f000 b800 b.w {{.+}} @ imm = #0
59 # DISASM-NEXT: e92d 480f push.w {r0, r1, r2, r3, r11, lr}
60 # DISASM-NEXT: f20d 0b10 addw r11, sp, #16
61 # DISASM-NEXT: ed2d 0b10 vpush {d0, d1, d2, d3, d4, d5, d6, d7}
62 # DISASM-NEXT: 4661 mov r1, r12
63 # DISASM-NEXT: f242 0004 movw r0, #8196
64 # DISASM-NEXT: f2c0 0040 movt r0, #64
65 # DISASM-NEXT: f7ff ffe7 bl 0x401000 <.text>
66 # DISASM-NEXT: 4684 mov r12, r0
67 # DISASM-NEXT: ecbd 0b10 vpop {d0, d1, d2, d3, d4, d5, d6, d7}
68 # DISASM-NEXT: e8bd 480f pop.w {r0, r1, r2, r3, r11, lr}
69 # DISASM-NEXT: 4760 bx r12
71 # DIR: DelayImportDescriptorRVA: 0x2004
72 # DIR-NEXT: DelayImportDescriptorSize: 0x40
77 Machine: IMAGE_FILE_MACHINE_ARMNT
81 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_PURGEABLE, IMAGE_SCN_MEM_16BIT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
83 SectionData: 40F20000C0F2000000680047
86 SymbolName: __imp_function
87 Type: IMAGE_REL_ARM_MOV32T
89 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
93 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
100 SimpleType: IMAGE_SYM_TYPE_NULL
101 ComplexType: IMAGE_SYM_DTYPE_NULL
102 StorageClass: IMAGE_SYM_CLASS_STATIC
105 NumberOfRelocations: 1
106 NumberOfLinenumbers: 0
109 - Name: mainCRTStartup
112 SimpleType: IMAGE_SYM_TYPE_NULL
113 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
114 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
115 - Name: __imp_function
118 SimpleType: IMAGE_SYM_TYPE_NULL
119 ComplexType: IMAGE_SYM_DTYPE_NULL
120 StorageClass: IMAGE_SYM_CLASS_EXTERNAL