Skip to content

Commit 2730024

Browse files
author
git apple-llvm automerger
committed
Merge commit '8bd0c9781001' from llvm.org/master into apple/master
2 parents a5a4605 + 8bd0c97 commit 2730024

File tree

3 files changed

+468
-225
lines changed

3 files changed

+468
-225
lines changed

llvm/lib/MC/XCOFFObjectWriter.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,17 @@ class XCOFFObjectWriter : public MCObjectWriter {
158158
// the sections. Should have one for each set of csects that get mapped into
159159
// the same section and get handled in a 'similar' way.
160160
CsectGroup ProgramCodeCsects{CsectGroup::LabelDefSupported, {}};
161+
CsectGroup DataCsects{CsectGroup::LabelDefSupported, {}};
161162
CsectGroup BSSCsects{CsectGroup::LabelDefUnsupported, {}};
162163

163164
// The Predefined sections.
164165
Section Text;
166+
Section Data;
165167
Section BSS;
166168

167169
// All the XCOFF sections, in the order they will appear in the section header
168170
// table.
169-
std::array<Section *const, 2> Sections{{&Text, &BSS}};
171+
std::array<Section *const, 3> Sections{{&Text, &Data, &BSS}};
170172

171173
CsectGroup &getCsectGroup(const MCSectionXCOFF *MCSec);
172174

@@ -224,6 +226,8 @@ XCOFFObjectWriter::XCOFFObjectWriter(
224226
Strings(StringTableBuilder::XCOFF),
225227
Text(".text", XCOFF::STYP_TEXT, /* IsVirtual */ false,
226228
CsectGroups{&ProgramCodeCsects}),
229+
Data(".data", XCOFF::STYP_DATA, /* IsVirtual */ false,
230+
CsectGroups{&DataCsects}),
227231
BSS(".bss", XCOFF::STYP_BSS, /* IsVirtual */ true,
228232
CsectGroups{&BSSCsects}) {}
229233

@@ -251,6 +255,9 @@ CsectGroup &XCOFFObjectWriter::getCsectGroup(const MCSectionXCOFF *MCSec) {
251255
if (XCOFF::XTY_CM == MCSec->getCSectType())
252256
return BSSCsects;
253257

258+
if (XCOFF::XTY_SD == MCSec->getCSectType())
259+
return DataCsects;
260+
254261
report_fatal_error("Unhandled mapping of read-write csect to section.");
255262
case XCOFF::XMC_BS:
256263
assert(XCOFF::XTY_CM == MCSec->getCSectType() &&

llvm/test/CodeGen/PowerPC/aix-xcoff-common.ll

Lines changed: 0 additions & 221 deletions
This file was deleted.

0 commit comments

Comments
 (0)