1 ## This is a basic test to check if we can parse the XCOFF object file correctly.
2 # RUN: yaml2obj %s -DMAGIC=0x01DF -o %t-32
3 # RUN: obj2yaml %t-32 | FileCheck %s --check-prefix=CHECK32
4 # RUN: yaml2obj %s -DMAGIC=0x01F7 -o %t-64
5 # RUN: obj2yaml %t-64 -o %t-64.yaml 2>&1 | count 0
6 # RUN: FileCheck --input-file %t-64.yaml %s --check-prefix=CHECK64
9 # CHECK32-NEXT: FileHeader:
10 # CHECK32-NEXT: MagicNumber: 0x1DF
11 # CHECK32-NEXT: NumberOfSections: 2
12 # CHECK32-NEXT: CreationTime: 0
13 # CHECK32-NEXT: OffsetToSymbolTable: 0x80
14 # CHECK32-NEXT: EntriesInSymbolTable: 4
15 # CHECK32-NEXT: AuxiliaryHeaderSize: 0
16 # CHECK32-NEXT: Flags: 0x0
17 # CHECK32-NEXT: Sections:
18 # CHECK32-NEXT: - Name: .text
19 # CHECK32-NEXT: Address: 0x0
20 # CHECK32-NEXT: Size: 0x4
21 # CHECK32-NEXT: FileOffsetToData: 0x64
22 # CHECK32-NEXT: FileOffsetToRelocations: 0x6C
23 # CHECK32-NEXT: FileOffsetToLineNumbers: 0x0
24 # CHECK32-NEXT: NumberOfRelocations: 0x1
25 # CHECK32-NEXT: NumberOfLineNumbers: 0x0
26 # CHECK32-NEXT: Flags: [ STYP_TEXT ]
27 # CHECK32-NEXT: SectionData: '00007400'
28 # CHECK32-NEXT: Relocations:
29 # CHECK32-NEXT: - Address: 0xE
30 # CHECK32-NEXT: Symbol: 0x12
31 # CHECK32-NEXT: Info: 0xF
32 # CHECK32-NEXT: Type: 0x3
33 # CHECK32-NEXT: - Name: .data
34 # CHECK32-NEXT: Address: 0x0
35 # CHECK32-NEXT: Size: 0x4
36 # CHECK32-NEXT: FileOffsetToData: 0x68
37 # CHECK32-NEXT: FileOffsetToRelocations: 0x76
38 # CHECK32-NEXT: FileOffsetToLineNumbers: 0x0
39 # CHECK32-NEXT: NumberOfRelocations: 0x1
40 # CHECK32-NEXT: NumberOfLineNumbers: 0x0
41 # CHECK32-NEXT: Flags: [ STYP_DATA ]
42 # CHECK32-NEXT: SectionData: '00007700'
43 # CHECK32-NEXT: Relocations:
44 # CHECK32-NEXT: - Address: 0x60
45 # CHECK32-NEXT: Symbol: 0x8
46 # CHECK32-NEXT: Info: 0x1F
47 # CHECK32-NEXT: Type: 0x0
48 # CHECK32-NEXT: Symbols:
49 # CHECK32-NEXT: - Name: TestforXcoff
50 # CHECK32-NEXT: Value: 0x0
51 # CHECK32-NEXT: Section: N_UNDEF
52 # CHECK32-NEXT: Type: 0x0
53 # CHECK32-NEXT: StorageClass: C_EXT
54 # CHECK32-NEXT: NumberOfAuxEntries: 1
55 # CHECK32-NEXT: AuxEntries:
56 # CHECK32-NEXT: - Type: AUX_CSECT
57 # CHECK32-NEXT: ParameterHashIndex: 0
58 # CHECK32-NEXT: TypeChkSectNum: 0
59 # CHECK32-NEXT: SymbolType: XTY_ER
60 # CHECK32-NEXT: SymbolAlignment: 0
61 # CHECK32-NEXT: StorageMappingClass: XMC_PR
62 # CHECK32-NEXT: SectionOrLength: 0
63 # CHECK32-NEXT: StabInfoIndex: 0
64 # CHECK32-NEXT: StabSectNum: 0
65 # CHECK32-NEXT: - Name: .data
66 # CHECK32-NEXT: Value: 0x70
67 # CHECK32-NEXT: Section: .data
68 # CHECK32-NEXT: Type: 0x0
69 # CHECK32-NEXT: StorageClass: C_HIDEXT
70 # CHECK32-NEXT: NumberOfAuxEntries: 1
71 # CHECK32-NEXT: AuxEntries:
72 # CHECK32-NEXT: - Type: AUX_CSECT
73 # CHECK32-NEXT: ParameterHashIndex: 0
74 # CHECK32-NEXT: TypeChkSectNum: 0
75 # CHECK32-NEXT: SymbolType: XTY_ER
76 # CHECK32-NEXT: SymbolAlignment: 0
77 # CHECK32-NEXT: StorageMappingClass: XMC_PR
78 # CHECK32-NEXT: SectionOrLength: 0
79 # CHECK32-NEXT: StabInfoIndex: 0
80 # CHECK32-NEXT: StabSectNum: 0
83 # CHECK64-NEXT: FileHeader:
84 # CHECK64-NEXT: MagicNumber: 0x1F7
85 # CHECK64-NEXT: NumberOfSections: 2
86 # CHECK64-NEXT: CreationTime: 0
87 # CHECK64-NEXT: OffsetToSymbolTable: 0xCC
88 # CHECK64-NEXT: EntriesInSymbolTable: 4
89 # CHECK64-NEXT: AuxiliaryHeaderSize: 0
90 # CHECK64-NEXT: Flags: 0x0
91 # CHECK64-NEXT: Sections:
92 # CHECK64-NEXT: - Name: .text
93 # CHECK64-NEXT: Address: 0x0
94 # CHECK64-NEXT: Size: 0x4
95 # CHECK64-NEXT: FileOffsetToData: 0xA8
96 # CHECK64-NEXT: FileOffsetToRelocations: 0xB0
97 # CHECK64-NEXT: FileOffsetToLineNumbers: 0x0
98 # CHECK64-NEXT: NumberOfRelocations: 0x1
99 # CHECK64-NEXT: NumberOfLineNumbers: 0x0
100 # CHECK64-NEXT: Flags: [ STYP_TEXT ]
101 # CHECK64-NEXT: SectionData: '00007400'
102 # CHECK64-NEXT: Relocations:
103 # CHECK64-NEXT: - Address: 0xE
104 # CHECK64-NEXT: Symbol: 0x12
105 # CHECK64-NEXT: Info: 0xF
106 # CHECK64-NEXT: Type: 0x3
107 # CHECK64-NEXT: - Name: .data
108 # CHECK64-NEXT: Address: 0x0
109 # CHECK64-NEXT: Size: 0x4
110 # CHECK64-NEXT: FileOffsetToData: 0xAC
111 # CHECK64-NEXT: FileOffsetToRelocations: 0xBE
112 # CHECK64-NEXT: FileOffsetToLineNumbers: 0x0
113 # CHECK64-NEXT: NumberOfRelocations: 0x1
114 # CHECK64-NEXT: NumberOfLineNumbers: 0x0
115 # CHECK64-NEXT: Flags: [ STYP_DATA ]
116 # CHECK64-NEXT: SectionData: '00007700'
117 # CHECK64-NEXT: Relocations:
118 # CHECK64-NEXT: - Address: 0x60
119 # CHECK64-NEXT: Symbol: 0x8
120 # CHECK64-NEXT: Info: 0x1F
121 # CHECK64-NEXT: Type: 0x0
122 # CHECK64-NEXT: Symbols:
123 # CHECK64-NEXT: - Name: TestforXcoff
124 # CHECK64-NEXT: Value: 0x0
125 # CHECK64-NEXT: Section: N_UNDEF
126 # CHECK64-NEXT: Type: 0x0
127 # CHECK64-NEXT: StorageClass: C_EXT
128 # CHECK64-NEXT: NumberOfAuxEntries: 1
129 # CHECK64-NEXT: AuxEntries:
130 # CHECK64-NEXT: - Type: AUX_CSECT
131 # CHECK64-NEXT: ParameterHashIndex: 0
132 # CHECK64-NEXT: TypeChkSectNum: 0
133 # CHECK64-NEXT: SymbolType: XTY_ER
134 # CHECK64-NEXT: SymbolAlignment: 0
135 # CHECK64-NEXT: StorageMappingClass: XMC_PR
136 # CHECK64-NEXT: SectionOrLengthLo: 0
137 # CHECK64-NEXT: SectionOrLengthHi: 0
138 # CHECK64-NEXT: - Name: .data
139 # CHECK64-NEXT: Value: 0x70
140 # CHECK64-NEXT: Section: .data
141 # CHECK64-NEXT: Type: 0x0
142 # CHECK64-NEXT: StorageClass: C_HIDEXT
143 # CHECK64-NEXT: NumberOfAuxEntries: 1
144 # CHECK64-NEXT: AuxEntries:
145 # CHECK64-NEXT: - Type: AUX_CSECT
146 # CHECK64-NEXT: ParameterHashIndex: 0
147 # CHECK64-NEXT: TypeChkSectNum: 0
148 # CHECK64-NEXT: SymbolType: XTY_ER
149 # CHECK64-NEXT: SymbolAlignment: 0
150 # CHECK64-NEXT: StorageMappingClass: XMC_PR
151 # CHECK64-NEXT: SectionOrLengthLo: 0
152 # CHECK64-NEXT: SectionOrLengthHi: 0
156 MagicNumber: [[MAGIC]]
160 SectionData: '00007400'
168 SectionData: '00007700'
180 NumberOfAuxEntries: 1
187 StorageClass: C_HIDEXT
188 NumberOfAuxEntries: 1