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
10 # IMPORT: Format: COFF-ARM
11 # IMPORT-NEXT: Arch: thumb
12 # IMPORT-NEXT: AddressSize: 32bit
13 # IMPORT-NEXT: DelayImport {
14 # IMPORT-NEXT: Name: library.dll
15 # IMPORT-NEXT: Attributes: 0x1
16 # IMPORT-NEXT: ModuleHandle: 0x3000
17 # IMPORT-NEXT: ImportAddressTable: 0x3008
18 # IMPORT-NEXT: ImportNameTable: 0x2040
19 # IMPORT-NEXT: BoundDelayImportTable: 0x0
20 # IMPORT-NEXT: UnloadDelayImportTable: 0x0
21 # IMPORT-NEXT: Import {
22 # IMPORT-NEXT: Symbol: function (0)
23 # IMPORT-NEXT: Address: 0x40100D
27 # BASEREL: BaseReloc [
28 # BASEREL-NEXT: Entry {
29 # BASEREL-NEXT: Type: ARM_MOV32(T)
30 # BASEREL-NEXT: Address: 0x1000
32 # BASEREL-NEXT: Entry {
33 # BASEREL-NEXT: Type: ARM_MOV32(T)
34 # BASEREL-NEXT: Address: 0x100C
36 # BASEREL-NEXT: Entry {
37 # BASEREL-NEXT: Type: ARM_MOV32(T)
38 # BASEREL-NEXT: Address: 0x1026
40 # BASEREL-NEXT: Entry {
41 # BASEREL-NEXT: Type: ABSOLUTE
42 # BASEREL-NEXT: Address: 0x1000
44 # BASEREL-NEXT: Entry {
45 # BASEREL-NEXT: Type: HIGHLOW
46 # BASEREL-NEXT: Address: 0x3008
48 # BASEREL-NEXT: Entry {
49 # BASEREL-NEXT: Type: ABSOLUTE
50 # BASEREL-NEXT: Address: 0x3000
54 # DISASM: 00401000 <.text>:
55 # DISASM: 40100c: f243 0c08 movw r12, #12296
56 # DISASM-NEXT: f2c0 0c40 movt r12, #64
57 # DISASM-NEXT: f000 b800 b.w {{.+}} @ imm = #0
58 # DISASM-NEXT: e92d 480f push.w {r0, r1, r2, r3, r11, lr}
59 # DISASM-NEXT: f20d 0b10 addw r11, sp, #16
60 # DISASM-NEXT: ed2d 0b10 vpush {d0, d1, d2, d3, d4, d5, d6, d7}
61 # DISASM-NEXT: 4661 mov r1, r12
62 # DISASM-NEXT: f242 0000 movw r0, #8192
63 # DISASM-NEXT: f2c0 0040 movt r0, #64
64 # DISASM-NEXT: f7ff ffe7 bl 0x401000 <.text>
65 # DISASM-NEXT: 4684 mov r12, r0
66 # DISASM-NEXT: ecbd 0b10 vpop {d0, d1, d2, d3, d4, d5, d6, d7}
67 # DISASM-NEXT: e8bd 480f pop.w {r0, r1, r2, r3, r11, lr}
68 # DISASM-NEXT: 4760 bx r12
72 Machine: IMAGE_FILE_MACHINE_ARMNT
76 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_PURGEABLE, IMAGE_SCN_MEM_16BIT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
78 SectionData: 40F20000C0F2000000680047
81 SymbolName: __imp_function
82 Type: IMAGE_REL_ARM_MOV32T
87 SimpleType: IMAGE_SYM_TYPE_NULL
88 ComplexType: IMAGE_SYM_DTYPE_NULL
89 StorageClass: IMAGE_SYM_CLASS_STATIC
92 NumberOfRelocations: 1
93 NumberOfLinenumbers: 0
96 - Name: mainCRTStartup
99 SimpleType: IMAGE_SYM_TYPE_NULL
100 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
101 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
102 - Name: __imp_function
105 SimpleType: IMAGE_SYM_TYPE_NULL
106 ComplexType: IMAGE_SYM_DTYPE_NULL
107 StorageClass: IMAGE_SYM_CLASS_EXTERNAL