From 96aa78c8c5ef1a5f268539c9edc86569b436d573 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 23 Jan 2011 17:55:27 +0000 Subject: Add support for the --noexecstack option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124077 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-mc/llvm-mc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 8708204..2c22bed 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -69,6 +69,9 @@ static cl::opt RelaxAll("mc-relax-all", cl::desc("Relax all fixups")); static cl::opt +NoExecStack("mc-no-exec-stack", cl::desc("File doesn't need an exec stack")); + +static cl::opt EnableLogging("enable-api-logging", cl::desc("Enable MC API logging")); enum OutputFileType { @@ -336,6 +339,7 @@ static int AssembleInput(const char *ProgName) { TM->getTargetLowering()->getObjFileLowering(); const_cast(TLOF).Initialize(Ctx, *TM); + // FIXME: There is a bit of code duplication with addPassesToEmitFile. if (FileType == OFT_AssemblyFile) { MCInstPrinter *IP = TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI); @@ -355,7 +359,8 @@ static int AssembleInput(const char *ProgName) { MCCodeEmitter *CE = TheTarget->createCodeEmitter(*TM, Ctx); TargetAsmBackend *TAB = TheTarget->createAsmBackend(TripleName); Str.reset(TheTarget->createObjectStreamer(TripleName, Ctx, *TAB, - FOS, CE, RelaxAll)); + FOS, CE, RelaxAll, + NoExecStack)); } if (EnableLogging) { -- cgit v1.1