aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index fbf3c860368a..ca7f28e1386e 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -90,11 +90,11 @@ void MCELFStreamer::mergeFragment(MCDataFragment *DF,
void MCELFStreamer::initSections(bool NoExecStack, const MCSubtargetInfo &STI) {
MCContext &Ctx = getContext();
- SwitchSection(Ctx.getObjectFileInfo()->getTextSection());
+ switchSection(Ctx.getObjectFileInfo()->getTextSection());
emitCodeAlignment(Ctx.getObjectFileInfo()->getTextSectionAlignment(), &STI);
if (NoExecStack)
- SwitchSection(Ctx.getAsmInfo()->getNonexecutableStackSection(Ctx));
+ switchSection(Ctx.getAsmInfo()->getNonexecutableStackSection(Ctx));
}
void MCELFStreamer::emitLabel(MCSymbol *S, SMLoc Loc) {
@@ -215,6 +215,7 @@ bool MCELFStreamer::emitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) {
case MCSA_WeakDefAutoPrivate:
case MCSA_Invalid:
case MCSA_IndirectSymbol:
+ case MCSA_Exported:
return false;
case MCSA_NoDeadStrip:
@@ -317,13 +318,13 @@ void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
MCSection &Section = *getAssembler().getContext().getELFSection(
".bss", ELF::SHT_NOBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC);
MCSectionSubPair P = getCurrentSection();
- SwitchSection(&Section);
+ switchSection(&Section);
emitValueToAlignment(ByteAlignment, 0, 1, 0);
emitLabel(Symbol);
emitZeros(Size);
- SwitchSection(P.first, P.second);
+ switchSection(P.first, P.second);
} else {
if(Symbol->declareCommon(Size, ByteAlignment))
report_fatal_error(Twine("Symbol: ") + Symbol->getName() +
@@ -381,15 +382,15 @@ void MCELFStreamer::emitCGProfileEntry(const MCSymbolRefExpr *From,
void MCELFStreamer::emitIdent(StringRef IdentString) {
MCSection *Comment = getAssembler().getContext().getELFSection(
".comment", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS, 1);
- PushSection();
- SwitchSection(Comment);
+ pushSection();
+ switchSection(Comment);
if (!SeenIdent) {
emitInt8(0);
SeenIdent = true;
}
emitBytes(IdentString);
emitInt8(0);
- PopSection();
+ popSection();
}
void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
@@ -511,8 +512,8 @@ void MCELFStreamer::finalizeCGProfile() {
MCSection *CGProfile = getAssembler().getContext().getELFSection(
".llvm.call-graph-profile", ELF::SHT_LLVM_CALL_GRAPH_PROFILE,
ELF::SHF_EXCLUDE, /*sizeof(Elf_CGProfile_Impl<>)=*/8);
- PushSection();
- SwitchSection(CGProfile);
+ pushSection();
+ switchSection(CGProfile);
uint64_t Offset = 0;
for (MCAssembler::CGProfileEntry &E : Asm.CGProfile) {
finalizeCGProfileEntry(E.From, Offset);
@@ -520,7 +521,7 @@ void MCELFStreamer::finalizeCGProfile() {
emitIntValue(E.Count, sizeof(uint64_t));
Offset += sizeof(uint64_t);
}
- PopSection();
+ popSection();
}
void MCELFStreamer::emitInstToFragment(const MCInst &Inst,
@@ -832,10 +833,10 @@ void MCELFStreamer::createAttributesSection(
// Switch section to AttributeSection or get/create the section.
if (AttributeSection) {
- SwitchSection(AttributeSection);
+ switchSection(AttributeSection);
} else {
AttributeSection = getContext().getELFSection(Section, Type, 0);
- SwitchSection(AttributeSection);
+ switchSection(AttributeSection);
// Format version
emitInt8(0x41);