summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 07b1d924e2b..3f7b873ccec 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -996,7 +996,7 @@ void ELFObjectWriter::writeSectionData(const MCAssembler &Asm, MCSection &Sec,
MAI->compressDebugSections() != DebugCompressionType::None;
if (!CompressionEnabled || !SectionName.startswith(".debug_") ||
SectionName == ".debug_frame") {
- Asm.writeSectionData(&Section, Layout);
+ Asm.writeSectionData(getStream(), &Section, Layout);
return;
}
@@ -1006,10 +1006,7 @@ void ELFObjectWriter::writeSectionData(const MCAssembler &Asm, MCSection &Sec,
SmallVector<char, 128> UncompressedData;
raw_svector_ostream VecOS(UncompressedData);
- raw_pwrite_stream &OldStream = getStream();
- setStream(VecOS);
- Asm.writeSectionData(&Section, Layout);
- setStream(OldStream);
+ Asm.writeSectionData(VecOS, &Section, Layout);
SmallVector<char, 128> CompressedContents;
if (Error E = zlib::compress(
OpenPOWER on IntegriCloud