1 # RUN: yaml2obj %s -o %t.obj
2 # RUN: lld-link /debug:dwarf /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
3 # RUN: llvm-readobj --symbols %t.exe | FileCheck %s
4 # RUN: lld-link /debug:dwarf /opt:noref /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
5 # RUN: llvm-readobj --symbols %t.exe | FileCheck %s
6 # RUN: lld-link /debug:symtab /opt:noref /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
7 # RUN: llvm-readobj --symbols %t.exe | FileCheck %s
9 # RUN: lld-link /debug /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
10 # RUN: llvm-readobj --symbols %t.exe | FileCheck -check-prefix=NO %s
13 # CHECK-NEXT: Symbol {
14 # CHECK-NEXT: Name: MessageBoxA
15 # CHECK-NEXT: Value: 80
16 # CHECK-NEXT: Section: .text (1)
17 # CHECK-NEXT: BaseType: Null (0x0)
18 # CHECK-NEXT: ComplexType: Function (0x2)
19 # CHECK-NEXT: StorageClass: External (0x2)
20 # CHECK-NEXT: AuxSymbolCount: 0
22 # CHECK-NEXT: Symbol {
23 # CHECK-NEXT: Name: __imp_MessageBoxA
25 # CHECK-NEXT: Section: .rdata (2)
26 # CHECK-NEXT: BaseType: Null (0x0)
27 # CHECK-NEXT: ComplexType: Null (0x0)
28 # CHECK-NEXT: StorageClass: External (0x2)
29 # CHECK-NEXT: AuxSymbolCount: 0
31 # CHECK-NEXT: Symbol {
32 # CHECK-NEXT: Name: ExitProcess
33 # CHECK-NEXT: Value: 64
34 # CHECK-NEXT: Section: .text (1)
35 # CHECK-NEXT: BaseType: Null (0x0)
36 # CHECK-NEXT: ComplexType: Function (0x2)
37 # CHECK-NEXT: StorageClass: External (0x2)
38 # CHECK-NEXT: AuxSymbolCount: 0
40 # CHECK-NEXT: Symbol {
41 # CHECK-NEXT: Name: __imp_ExitProcess
43 # CHECK-NEXT: Section: .rdata (2)
44 # CHECK-NEXT: BaseType: Null (0x0)
45 # CHECK-NEXT: ComplexType: Null (0x0)
46 # CHECK-NEXT: StorageClass: External (0x2)
47 # CHECK-NEXT: AuxSymbolCount: 0
49 # CHECK-NEXT: Symbol {
50 # CHECK-NEXT: Name: message
51 # CHECK-NEXT: Value: 6
52 # CHECK-NEXT: Section: .text2
53 # CHECK-NEXT: BaseType: Null (0x0)
54 # CHECK-NEXT: ComplexType: Null (0x0)
55 # CHECK-NEXT: StorageClass: Static (0x3)
56 # CHECK-NEXT: AuxSymbolCount: 0
58 # CHECK-NEXT: Symbol {
59 # CHECK-NEXT: Name: main
60 # CHECK-NEXT: Value: 0
61 # CHECK-NEXT: Section: .text (1)
62 # CHECK-NEXT: BaseType: Null (0x0)
63 # CHECK-NEXT: ComplexType: Null (0x0)
64 # CHECK-NEXT: StorageClass: External (0x2)
65 # CHECK-NEXT: AuxSymbolCount: 0
67 # CHECK-NEXT: Symbol {
68 # CHECK-NEXT: Name: caption
69 # CHECK-NEXT: Value: 0
70 # CHECK-NEXT: Section: .text2
71 # CHECK-NEXT: BaseType: Null (0x0)
72 # CHECK-NEXT: ComplexType: Null (0x0)
73 # CHECK-NEXT: StorageClass: Static (0x3)
74 # CHECK-NEXT: AuxSymbolCount: 0
76 # CHECK-NEXT: Symbol {
77 # CHECK-NEXT: Name: abs_symbol
78 # CHECK-NEXT: Value: 3735928559
79 # CHECK-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
80 # CHECK-NEXT: BaseType: Null (0x0)
81 # CHECK-NEXT: ComplexType: Null (0x0)
82 # CHECK-NEXT: StorageClass: External (0x2)
83 # CHECK-NEXT: AuxSymbolCount: 0
92 Machine: IMAGE_FILE_MACHINE_AMD64
96 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
98 SectionData: B800000000000000005068000000000000000068000000000000000050E8000000000000000050E8000000000000000050E80000000000000000
101 SymbolName: abs_symbol
102 Type: IMAGE_REL_AMD64_ADDR64
105 Type: IMAGE_REL_AMD64_ADDR64
108 Type: IMAGE_REL_AMD64_ADDR64
110 SymbolName: MessageBoxA
111 Type: IMAGE_REL_AMD64_REL32
113 SymbolName: ExitProcess
114 Type: IMAGE_REL_AMD64_REL32
116 SymbolName: __ImageBase
117 Type: IMAGE_REL_AMD64_ADDR64
119 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
121 SectionData: B800000000000000005068000000000000000068000000000000000050E8000000000000000050E8000000000000000050E80000000000000000
124 SymbolName: abs_symbol
125 Type: IMAGE_REL_AMD64_ADDR64
128 Type: IMAGE_REL_AMD64_ADDR64
131 Type: IMAGE_REL_AMD64_ADDR64
133 SymbolName: MessageBoxA
134 Type: IMAGE_REL_AMD64_REL32
136 SymbolName: ExitProcess
137 Type: IMAGE_REL_AMD64_REL32
139 SymbolName: __ImageBase
140 Type: IMAGE_REL_AMD64_ADDR64
142 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
144 SectionData: 48656C6C6F0048656C6C6F20576F726C6400
149 SimpleType: IMAGE_SYM_TYPE_NULL
150 ComplexType: IMAGE_SYM_DTYPE_NULL
151 StorageClass: IMAGE_SYM_CLASS_STATIC
155 SimpleType: IMAGE_SYM_TYPE_NULL
156 ComplexType: IMAGE_SYM_DTYPE_NULL
157 StorageClass: IMAGE_SYM_CLASS_STATIC
160 NumberOfRelocations: 6
161 NumberOfLinenumbers: 0
167 SimpleType: IMAGE_SYM_TYPE_NULL
168 ComplexType: IMAGE_SYM_DTYPE_NULL
169 StorageClass: IMAGE_SYM_CLASS_STATIC
172 NumberOfRelocations: 6
173 NumberOfLinenumbers: 0
179 SimpleType: IMAGE_SYM_TYPE_NULL
180 ComplexType: IMAGE_SYM_DTYPE_NULL
181 StorageClass: IMAGE_SYM_CLASS_STATIC
184 NumberOfRelocations: 0
185 NumberOfLinenumbers: 0
191 SimpleType: IMAGE_SYM_TYPE_NULL
192 ComplexType: IMAGE_SYM_DTYPE_NULL
193 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
197 SimpleType: IMAGE_SYM_TYPE_NULL
198 ComplexType: IMAGE_SYM_DTYPE_NULL
199 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
203 SimpleType: IMAGE_SYM_TYPE_NULL
204 ComplexType: IMAGE_SYM_DTYPE_NULL
205 StorageClass: IMAGE_SYM_CLASS_STATIC
209 SimpleType: IMAGE_SYM_TYPE_NULL
210 ComplexType: IMAGE_SYM_DTYPE_NULL
211 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
215 SimpleType: IMAGE_SYM_TYPE_NULL
216 ComplexType: IMAGE_SYM_DTYPE_NULL
217 StorageClass: IMAGE_SYM_CLASS_STATIC
221 SimpleType: IMAGE_SYM_TYPE_NULL
222 ComplexType: IMAGE_SYM_DTYPE_NULL
223 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
227 SimpleType: IMAGE_SYM_TYPE_NULL
228 ComplexType: IMAGE_SYM_DTYPE_NULL
229 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
230 - Name: .Ltemp_symbol
233 SimpleType: IMAGE_SYM_TYPE_NULL
234 ComplexType: IMAGE_SYM_DTYPE_NULL
235 StorageClass: IMAGE_SYM_CLASS_LABEL