aboutsummaryrefslogtreecommitdiff
path: root/lib/MC
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@rt-rk.com>2013-10-30 13:16:42 +0100
committerPetar Jovanovic <petar.jovanovic@rt-rk.com>2013-10-30 13:16:42 +0100
commit64ad0b18dc627d913a301088e7e517f28ec05d3f (patch)
tree7f3a558d18070c48128f527db0263489ccfb2e7c /lib/MC
parenta6df9e3ab2ab7b43a6097edec19990b25ccf15b7 (diff)
Move global FlagSfi variables to common module
When built as nexe, llc is configured and built for one arch only. Variables FlagSfiData, FlagSfiLoad, FlagSfiStore, FlagSfiStack, and FlagSfiBranch have to availabe for MIPS as well, so this change moves them from ARM-only code to common code. BUG= building pnacl-llc.nexe for MIPS fails TEST= build sandboxed tools for MIPS R=mseaborn@chromium.org Review URL: https://codereview.chromium.org/46193002
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCNaCl.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/MC/MCNaCl.cpp b/lib/MC/MCNaCl.cpp
index 4a6363d6c0..4385910cf3 100644
--- a/lib/MC/MCNaCl.cpp
+++ b/lib/MC/MCNaCl.cpp
@@ -12,11 +12,28 @@
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ELF.h"
static const char NoteNamespace[] = "NaCl";
namespace llvm {
+
+cl::opt<bool>
+FlagSfiData("sfi-data", cl::desc("use illegal at data bundle beginning"));
+
+cl::opt<bool>
+FlagSfiLoad("sfi-load", cl::desc("enable sandboxing for load"));
+
+cl::opt<bool>
+FlagSfiStore("sfi-store", cl::desc("enable sandboxing for stores"));
+
+cl::opt<bool>
+FlagSfiStack("sfi-stack", cl::desc("enable sandboxing for stack changes"));
+
+cl::opt<bool>
+FlagSfiBranch("sfi-branch", cl::desc("enable sandboxing for branches"));
+
void initializeNaClMCStreamer(MCStreamer &Streamer, MCContext &Ctx,
const Triple &TheTriple) {
assert(TheTriple.isOSNaCl());
@@ -71,4 +88,5 @@ void initializeNaClMCStreamer(MCStreamer &Streamer, MCContext &Ctx,
Streamer.EmitIntValue(0, 1); // NUL terminator
Streamer.EmitValueToAlignment(4);
}
+
} // namespace llvm