diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-23 22:49:25 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-23 22:49:25 +0000 |
commit | e308c0cd0d305801f447114e509c8a75bebbd299 (patch) | |
tree | 442a8adb28d371728c62b6f576e742e0a00a9d60 /llvm/lib/MC/WinCOFFStreamer.cpp | |
parent | d32e28c87a91b038cf4d3860e29e741566d7a66f (diff) | |
download | bcm5719-llvm-e308c0cd0d305801f447114e509c8a75bebbd299.tar.gz bcm5719-llvm-e308c0cd0d305801f447114e509c8a75bebbd299.zip |
Remove duplicated info on what .text, .data and .bss look like.
llvm-svn: 199951
Diffstat (limited to 'llvm/lib/MC/WinCOFFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/WinCOFFStreamer.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/llvm/lib/MC/WinCOFFStreamer.cpp b/llvm/lib/MC/WinCOFFStreamer.cpp index cb4e9b1c37b..b7d55741456 100644 --- a/llvm/lib/MC/WinCOFFStreamer.cpp +++ b/llvm/lib/MC/WinCOFFStreamer.cpp @@ -20,6 +20,7 @@ #include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCObjectFileInfo.h" #include "llvm/MC/MCObjectStreamer.h" #include "llvm/MC/MCSection.h" #include "llvm/MC/MCSectionCOFF.h" @@ -95,25 +96,16 @@ private: DF->getContents().append(Code.begin(), Code.end()); } - const MCSectionCOFF *getSectionText() { - return getContext().getCOFFSection( - ".text", COFF::IMAGE_SCN_CNT_CODE | COFF::IMAGE_SCN_MEM_EXECUTE | - COFF::IMAGE_SCN_MEM_READ, - SectionKind::getText()); + const MCSection *getSectionText() { + return getContext().getObjectFileInfo()->getTextSection(); } - const MCSectionCOFF *getSectionData() { - return getContext().getCOFFSection( - ".data", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | - COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_MEM_WRITE, - SectionKind::getDataRel()); + const MCSection *getSectionData() { + return getContext().getObjectFileInfo()->getDataSection(); } - const MCSectionCOFF *getSectionBSS() { - return getContext().getCOFFSection( - ".bss", COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA | - COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_MEM_WRITE, - SectionKind::getBSS()); + const MCSection *getSectionBSS() { + return getContext().getObjectFileInfo()->getBSSSection(); } void SetSectionText() { @@ -141,7 +133,7 @@ void WinCOFFStreamer::AddCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, bool External) { assert(!Symbol->isInSection() && "Symbol must not already have a section!"); - const MCSectionCOFF *Section = getSectionBSS(); + const MCSection *Section = getSectionBSS(); MCSectionData &SectionData = getAssembler().getOrCreateSectionData(*Section); if (SectionData.getAlignment() < ByteAlignment) SectionData.setAlignment(ByteAlignment); |