diff options
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index b154c98..5b36361 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -135,6 +135,10 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) { // "__DATA/__datacoal_nt" => section "__DATA/__data" Triple::ArchType ArchTy = T.getArch(); + ConstDataSection // .const_data + = Ctx->getMachOSection("__DATA", "__const", 0, + SectionKind::getReadOnlyWithRel()); + if (ArchTy == Triple::ppc || ArchTy == Triple::ppc64) { TextCoalSection = Ctx->getMachOSection("__TEXT", "__textcoal_nt", @@ -147,15 +151,14 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) { SectionKind::getReadOnly()); DataCoalSection = Ctx->getMachOSection( "__DATA", "__datacoal_nt", MachO::S_COALESCED, SectionKind::getData()); + ConstDataCoalSection = DataCoalSection; } else { TextCoalSection = TextSection; ConstTextCoalSection = ReadOnlySection; DataCoalSection = DataSection; + ConstDataCoalSection = ConstDataSection; } - ConstDataSection // .const_data - = Ctx->getMachOSection("__DATA", "__const", 0, - SectionKind::getReadOnlyWithRel()); DataCommonSection = Ctx->getMachOSection("__DATA","__common", MachO::S_ZEROFILL, |