aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCSectionMachO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCSectionMachO.cpp')
-rw-r--r--llvm/lib/MC/MCSectionMachO.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCSectionMachO.cpp b/llvm/lib/MC/MCSectionMachO.cpp
index 0fd89dcbe5fa..21a63ce83330 100644
--- a/llvm/lib/MC/MCSectionMachO.cpp
+++ b/llvm/lib/MC/MCSectionMachO.cpp
@@ -83,7 +83,7 @@ ENTRY("" /*FIXME*/, S_ATTR_LOC_RELOC)
MCSectionMachO::MCSectionMachO(StringRef Segment, StringRef Section,
unsigned TAA, unsigned reserved2, SectionKind K,
MCSymbol *Begin)
- : MCSection(SV_MachO, K, Begin), TypeAndAttributes(TAA),
+ : MCSection(SV_MachO, Section, K, Begin), TypeAndAttributes(TAA),
Reserved2(reserved2) {
assert(Segment.size() <= 16 && Section.size() <= 16 &&
"Segment or section string too long");
@@ -92,18 +92,13 @@ MCSectionMachO::MCSectionMachO(StringRef Segment, StringRef Section,
SegmentName[i] = Segment[i];
else
SegmentName[i] = 0;
-
- if (i < Section.size())
- SectionName[i] = Section[i];
- else
- SectionName[i] = 0;
}
}
void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const {
- OS << "\t.section\t" << getSegmentName() << ',' << getSectionName();
+ OS << "\t.section\t" << getSegmentName() << ',' << getName();
// Get the section type and attributes.
unsigned TAA = getTypeAndAttributes();