Index: tools/llvm-mc/llvm-mc.cpp |
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp |
index 96d3206a78316c1cca6bdad27097c095111352f3..049db4ce490093c7a352f9e8b278a1db1eb5242c 100644 |
--- a/tools/llvm-mc/llvm-mc.cpp |
+++ b/tools/llvm-mc/llvm-mc.cpp |
@@ -466,10 +466,21 @@ int main(int argc, char **argv) { |
MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU); |
} |
auto FOut = llvm::make_unique<formatted_raw_ostream>(*OS); |
- Str.reset(TheTarget->createAsmStreamer( |
- Ctx, std::move(FOut), /*asmverbose*/ true, |
- /*useDwarfDirectory*/ true, IP, CE, MAB, ShowInst)); |
+ if (T.isOSNaCl()) { |
+ Str.reset(TheTarget->createNaClAsmStreamer( |
+ Ctx, std::move(FOut), /*asmverbose*/ true, |
+ /*useDwarfDirectory*/ true, IP, CE, MAB, ShowInst)); |
+ if (NoExecStack) |
+ Str->InitSections(true); |
+ |
+ Str->InitSections(NoExecStack); |
+ initializeNaClMCStreamer(*Str.get(), Ctx, T); |
+ } else { |
+ Str.reset(TheTarget->createAsmStreamer( |
+ Ctx, std::move(FOut), /*asmverbose*/ true, |
+ /*useDwarfDirectory*/ true, IP, CE, MAB, ShowInst)); |
+ } |
} else if (FileType == OFT_Null) { |
Str.reset(TheTarget->createNullStreamer(Ctx)); |
} else { |