Add support for the --noexecstack option.

llvm-svn: 124077
This commit is contained in:
Rafael Espindola
2011-01-23 17:55:27 +00:00
parent 8f01420d9d
commit b3eca9bb71
14 changed files with 89 additions and 25 deletions

View File

@@ -68,6 +68,9 @@ OutputAsmVariant("output-asm-variant",
static cl::opt<bool>
RelaxAll("mc-relax-all", cl::desc("Relax all fixups"));
static cl::opt<bool>
NoExecStack("mc-no-exec-stack", cl::desc("File doesn't need an exec stack"));
static cl::opt<bool>
EnableLogging("enable-api-logging", cl::desc("Enable MC API logging"));
@@ -336,6 +339,7 @@ static int AssembleInput(const char *ProgName) {
TM->getTargetLowering()->getObjFileLowering();
const_cast<TargetLoweringObjectFile&>(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) {