@@ -158,15 +158,17 @@ class XCOFFObjectWriter : public MCObjectWriter {
158
158
// the sections. Should have one for each set of csects that get mapped into
159
159
// the same section and get handled in a 'similar' way.
160
160
CsectGroup ProgramCodeCsects{CsectGroup::LabelDefSupported, {}};
161
+ CsectGroup DataCsects{CsectGroup::LabelDefSupported, {}};
161
162
CsectGroup BSSCsects{CsectGroup::LabelDefUnsupported, {}};
162
163
163
164
// The Predefined sections.
164
165
Section Text;
166
+ Section Data;
165
167
Section BSS;
166
168
167
169
// All the XCOFF sections, in the order they will appear in the section header
168
170
// table.
169
- std::array<Section *const , 2 > Sections{{&Text, &BSS}};
171
+ std::array<Section *const , 3 > Sections{{&Text, &Data , &BSS}};
170
172
171
173
CsectGroup &getCsectGroup (const MCSectionXCOFF *MCSec);
172
174
@@ -224,6 +226,8 @@ XCOFFObjectWriter::XCOFFObjectWriter(
224
226
Strings(StringTableBuilder::XCOFF),
225
227
Text(" .text" , XCOFF::STYP_TEXT, /* IsVirtual */ false ,
226
228
CsectGroups{&ProgramCodeCsects}),
229
+ Data(" .data" , XCOFF::STYP_DATA, /* IsVirtual */ false ,
230
+ CsectGroups{&DataCsects}),
227
231
BSS(" .bss" , XCOFF::STYP_BSS, /* IsVirtual */ true ,
228
232
CsectGroups{&BSSCsects}) {}
229
233
@@ -251,6 +255,9 @@ CsectGroup &XCOFFObjectWriter::getCsectGroup(const MCSectionXCOFF *MCSec) {
251
255
if (XCOFF::XTY_CM == MCSec->getCSectType ())
252
256
return BSSCsects;
253
257
258
+ if (XCOFF::XTY_SD == MCSec->getCSectType ())
259
+ return DataCsects;
260
+
254
261
report_fatal_error (" Unhandled mapping of read-write csect to section." );
255
262
case XCOFF::XMC_BS:
256
263
assert (XCOFF::XTY_CM == MCSec->getCSectType () &&
0 commit comments