1 ## Test the --loader-section-symbols option.
3 # RUN: yaml2obj --docnum=1 -DSYMNUM=2 %s -o %t_xcoff32.o
4 # RUN: yaml2obj --docnum=1 -DSYMNUM=4 %s -o %t_xcoff32_invalid.o
5 # RUN: yaml2obj --docnum=2 %s -o %t_xcoff64.o
7 # RUN: llvm-readobj --loader-section-symbols %t_xcoff32.o |\
8 # RUN: FileCheck %s --check-prefixes=CHECK32
9 # RUN: llvm-readobj --loader-section-symbols %t_xcoff32_invalid.o 2>&1 |\
10 # RUN: FileCheck -DFILE=%t_xcoff32_invalid.o %s --check-prefixes=CHECK32,WARN
11 # RUN: llvm-readobj --loader-section-symbols %t_xcoff64.o |\
12 # RUN: FileCheck %s --check-prefixes=CHECK64
19 Flags: [ STYP_LOADER ]
20 SectionData: "000000010000000[[SYMNUM]]000000050000016D00000001000000A40000000c000000506d79696e74766172200002800002110500000000000000000000000000000002200002840002110a0000000000000000000a66756e63305f5f467600"
21 ## ^------- -Version=1
22 ## ^---------------- -NumberOfSymbolEntries=SYMNUM
23 ## ^------- -NumberOfRelocationEntries=5
24 ## ^------- -LengthOfImportFileIDStringTable=365
25 ## ^------- -NumberOfImportFileIDs=1
26 ## ^------- -OffsetToImportFileIDs=0xA4
27 ## ^------- -LengthOfStringTable=12
28 ## ^------- -OffsetToStringTable=0x050
29 ## ^--------------- SymbolName=myintvar
30 ## ^------- Value=0x20000280
31 ## ^--- sectionNumber = 2
33 ## ^- StorageClass=0x05
34 ## ^------- ImportFileID=0
35 ## ^-------ParameterCheckType=0
36 ## ^-------SymbolZero=0
37 ## ^-------OffsetToSymTbl=2
38 ## ^------- Value=20000284
39 ## ^--- sectionNumber = 2
41 ## ^- StorageClass=0x0a
42 ## ^------- ImportFileID=0
43 ## ^-------ParameterCheckType=0
51 Flags: [ STYP_LOADER ]
52 SectionData: "0000000200000002000000050000016D000000010000001200000000000000D000000000000000680000000000000038000000000000008000000001100003000000000200021105000000000000000000000001100003080000000d0002110a000000000000000000096d79696e7476617200000a5f5a3566756e6330760000"
53 ## ^------- -Version=2
54 ## ^------- -NumberOfSymbolEntries=2
55 ## ^------- -NumberOfRelocationEntries=5
56 ## ^------- -LengthOfImportFileIDStringTable=365
57 ## ^------- -NumberOfImportFileIDs=1
58 ## ^------- --LengthOfStringTable=0x12
59 ## ^--------------- -OffsetToImportFileIDs=0xD0
60 ## ^--------------- -OffsetToStringTable=0x68
61 ## ^--------------- -OffsetToSymbolTable=0x38
62 ## ^--------------- -OffsetToRelocationEntries=0x80
63 ## ^--------------- Value=0x0000000110000300
64 ## ^------- OffsetToStringTbl=2
65 ## ^--- sectionNumber = 2
67 ## ^- StorageClass=0x05
68 ## ^------- ImportFileID=0
69 ## ^-------ParameterCheckType=0
70 ## ^--------------- Value=0x0000000110000308
71 ## ^------- OffsetToStringTbl= 0x0d
72 ## ^--- sectionNumber = 2
74 ## ^- StorageClass=0x0a
75 ## ^------- ImportFileID=0
76 ## ^-------ParameterCheckType=0
79 # CHECK32: Loader Section {
80 # CHECK32-NEXT: Loader Section Symbols {
81 # CHECK32-NEXT: Symbol {
82 # CHECK32-NEXT: Name: myintvar
83 # CHECK32-NEXT: Virtual Address: 0x20000280
84 # CHECK32-NEXT: SectionNum: 2
85 # CHECK32-NEXT: SymbolType: 0x11
86 # CHECK32-NEXT: StorageClass: C_EXTDEF (0x5)
87 # CHECK32-NEXT: ImportFileID: 0x0
88 # CHECK32-NEXT: ParameterTypeCheck: 0
90 # CHECK32-NEXT: Symbol {
91 # CHECK32-NEXT: Name: func0__Fv
92 # CHECK32-NEXT: Virtual Address: 0x20000284
93 # CHECK32-NEXT: SectionNum: 2
94 # CHECK32-NEXT: SymbolType: 0x11
95 # CHECK32-NEXT: StorageClass: C_STRTAG (0xA)
96 # CHECK32-NEXT: ImportFileID: 0x0
97 # CHECK32-NEXT: ParameterTypeCheck: 0
99 # WARN: warning: '[[FILE]]': The end of the file was unexpectedly encountered
103 # CHECK64: Loader Section {
104 # CHECK64-NEXT: Loader Section Symbols {
105 # CHECK64-NEXT: Symbol {
106 # CHECK64-NEXT: Name: myintvar
107 # CHECK64-NEXT: Virtual Address: 0x110000300
108 # CHECK64-NEXT: SectionNum: 2
109 # CHECK64-NEXT: SymbolType: 0x11
110 # CHECK64-NEXT: StorageClass: C_EXTDEF (0x5)
111 # CHECK64-NEXT: ImportFileID: 0x0
112 # CHECK64-NEXT: ParameterTypeCheck: 0
114 # CHECK64-NEXT: Symbol {
115 # CHECK64-NEXT: Name: _Z5func0v
116 # CHECK64-NEXT: Virtual Address: 0x110000308
117 # CHECK64-NEXT: SectionNum: 2
118 # CHECK64-NEXT: SymbolType: 0x11
119 # CHECK64-NEXT: StorageClass: C_STRTAG (0xA)
120 # CHECK64-NEXT: ImportFileID: 0x0
121 # CHECK64-NEXT: ParameterTypeCheck: 0