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
8 # RUN: lld-link /debug:full,symtab /opt:noref /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
9 # RUN: llvm-readobj --symbols %t.exe | FileCheck %s
11 # RUN: lld-link /debug /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
12 # RUN: llvm-readobj --symbols %t.exe | FileCheck -check-prefix=NO %s
13 # RUN: lld-link /debug:dwarf,nosymtab /out:%t.exe /entry:main %t.obj %p/Inputs/std64.lib
14 # RUN: llvm-readobj --symbols %t.exe | FileCheck -check-prefix=NO %s
17 # CHECK-NEXT: Symbol {
18 # CHECK-NEXT: Name: MessageBoxA
19 # CHECK-NEXT: Value: 80
20 # CHECK-NEXT: Section: .text (1)
21 # CHECK-NEXT: BaseType: Null (0x0)
22 # CHECK-NEXT: ComplexType: Function (0x2)
23 # CHECK-NEXT: StorageClass: External (0x2)
24 # CHECK-NEXT: AuxSymbolCount: 0
26 # CHECK-NEXT: Symbol {
27 # CHECK-NEXT: Name: __imp_MessageBoxA
29 # CHECK-NEXT: Section: .rdata (2)
30 # CHECK-NEXT: BaseType: Null (0x0)
31 # CHECK-NEXT: ComplexType: Null (0x0)
32 # CHECK-NEXT: StorageClass: External (0x2)
33 # CHECK-NEXT: AuxSymbolCount: 0
35 # CHECK-NEXT: Symbol {
36 # CHECK-NEXT: Name: ExitProcess
37 # CHECK-NEXT: Value: 64
38 # CHECK-NEXT: Section: .text (1)
39 # CHECK-NEXT: BaseType: Null (0x0)
40 # CHECK-NEXT: ComplexType: Function (0x2)
41 # CHECK-NEXT: StorageClass: External (0x2)
42 # CHECK-NEXT: AuxSymbolCount: 0
44 # CHECK-NEXT: Symbol {
45 # CHECK-NEXT: Name: __imp_ExitProcess
47 # CHECK-NEXT: Section: .rdata (2)
48 # CHECK-NEXT: BaseType: Null (0x0)
49 # CHECK-NEXT: ComplexType: Null (0x0)
50 # CHECK-NEXT: StorageClass: External (0x2)
51 # CHECK-NEXT: AuxSymbolCount: 0
53 # CHECK-NEXT: Symbol {
54 # CHECK-NEXT: Name: message
55 # CHECK-NEXT: Value: 6
56 # CHECK-NEXT: Section: .text2
57 # CHECK-NEXT: BaseType: Null (0x0)
58 # CHECK-NEXT: ComplexType: Null (0x0)
59 # CHECK-NEXT: StorageClass: Static (0x3)
60 # CHECK-NEXT: AuxSymbolCount: 0
62 # CHECK-NEXT: Symbol {
63 # CHECK-NEXT: Name: main
64 # CHECK-NEXT: Value: 0
65 # CHECK-NEXT: Section: .text (1)
66 # CHECK-NEXT: BaseType: Null (0x0)
67 # CHECK-NEXT: ComplexType: Null (0x0)
68 # CHECK-NEXT: StorageClass: External (0x2)
69 # CHECK-NEXT: AuxSymbolCount: 0
71 # CHECK-NEXT: Symbol {
72 # CHECK-NEXT: Name: caption
73 # CHECK-NEXT: Value: 0
74 # CHECK-NEXT: Section: .text2
75 # CHECK-NEXT: BaseType: Null (0x0)
76 # CHECK-NEXT: ComplexType: Null (0x0)
77 # CHECK-NEXT: StorageClass: Static (0x3)
78 # CHECK-NEXT: AuxSymbolCount: 0
80 # CHECK-NEXT: Symbol {
81 # CHECK-NEXT: Name: abs_symbol
82 # CHECK-NEXT: Value: 3735928559
83 # CHECK-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
84 # CHECK-NEXT: BaseType: Null (0x0)
85 # CHECK-NEXT: ComplexType: Null (0x0)
86 # CHECK-NEXT: StorageClass: External (0x2)
87 # CHECK-NEXT: AuxSymbolCount: 0
89 # CHECK-NEXT: Symbol {
90 # CHECK-NEXT: Name: weak_main
91 # CHECK-NEXT: Value: 0
92 # CHECK-NEXT: Section: .text (1)
93 # CHECK-NEXT: BaseType: Null (0x0)
94 # CHECK-NEXT: ComplexType: Null (0x0)
95 # CHECK-NEXT: StorageClass: External (0x2)
96 # CHECK-NEXT: AuxSymbolCount: 0
105 Machine: IMAGE_FILE_MACHINE_AMD64
109 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
111 SectionData: B800000000000000005068000000000000000068000000000000000050E8000000000000000050E8000000000000000050E80000000000000000
114 SymbolName: abs_symbol
115 Type: IMAGE_REL_AMD64_ADDR64
118 Type: IMAGE_REL_AMD64_ADDR64
121 Type: IMAGE_REL_AMD64_ADDR64
123 SymbolName: MessageBoxA
124 Type: IMAGE_REL_AMD64_REL32
126 SymbolName: ExitProcess
127 Type: IMAGE_REL_AMD64_REL32
129 SymbolName: __ImageBase
130 Type: IMAGE_REL_AMD64_ADDR64
132 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
134 SectionData: B800000000000000005068000000000000000068000000000000000050E8000000000000000050E8000000000000000050E80000000000000000
137 SymbolName: abs_symbol
138 Type: IMAGE_REL_AMD64_ADDR64
141 Type: IMAGE_REL_AMD64_ADDR64
144 Type: IMAGE_REL_AMD64_ADDR64
146 SymbolName: MessageBoxA
147 Type: IMAGE_REL_AMD64_REL32
149 SymbolName: ExitProcess
150 Type: IMAGE_REL_AMD64_REL32
152 SymbolName: __ImageBase
153 Type: IMAGE_REL_AMD64_ADDR64
155 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
157 SectionData: 48656C6C6F0048656C6C6F20576F726C6400
162 SimpleType: IMAGE_SYM_TYPE_NULL
163 ComplexType: IMAGE_SYM_DTYPE_NULL
164 StorageClass: IMAGE_SYM_CLASS_STATIC
168 SimpleType: IMAGE_SYM_TYPE_NULL
169 ComplexType: IMAGE_SYM_DTYPE_NULL
170 StorageClass: IMAGE_SYM_CLASS_STATIC
173 NumberOfRelocations: 6
174 NumberOfLinenumbers: 0
180 SimpleType: IMAGE_SYM_TYPE_NULL
181 ComplexType: IMAGE_SYM_DTYPE_NULL
182 StorageClass: IMAGE_SYM_CLASS_STATIC
185 NumberOfRelocations: 6
186 NumberOfLinenumbers: 0
192 SimpleType: IMAGE_SYM_TYPE_NULL
193 ComplexType: IMAGE_SYM_DTYPE_NULL
194 StorageClass: IMAGE_SYM_CLASS_STATIC
197 NumberOfRelocations: 0
198 NumberOfLinenumbers: 0
204 SimpleType: IMAGE_SYM_TYPE_NULL
205 ComplexType: IMAGE_SYM_DTYPE_NULL
206 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
210 SimpleType: IMAGE_SYM_TYPE_NULL
211 ComplexType: IMAGE_SYM_DTYPE_NULL
212 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
216 SimpleType: IMAGE_SYM_TYPE_NULL
217 ComplexType: IMAGE_SYM_DTYPE_NULL
218 StorageClass: IMAGE_SYM_CLASS_STATIC
222 SimpleType: IMAGE_SYM_TYPE_NULL
223 ComplexType: IMAGE_SYM_DTYPE_NULL
224 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
228 SimpleType: IMAGE_SYM_TYPE_NULL
229 ComplexType: IMAGE_SYM_DTYPE_NULL
230 StorageClass: IMAGE_SYM_CLASS_STATIC
234 SimpleType: IMAGE_SYM_TYPE_NULL
235 ComplexType: IMAGE_SYM_DTYPE_NULL
236 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
240 SimpleType: IMAGE_SYM_TYPE_NULL
241 ComplexType: IMAGE_SYM_DTYPE_NULL
242 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
243 - Name: .Ltemp_symbol
246 SimpleType: IMAGE_SYM_TYPE_NULL
247 ComplexType: IMAGE_SYM_DTYPE_NULL
248 StorageClass: IMAGE_SYM_CLASS_LABEL
252 SimpleType: IMAGE_SYM_TYPE_NULL
253 ComplexType: IMAGE_SYM_DTYPE_NULL
254 StorageClass: IMAGE_SYM_CLASS_WEAK_EXTERNAL
257 Characteristics: IMAGE_WEAK_EXTERN_SEARCH_ALIAS