summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2015-01-14 05:24:11 +0000
committerJF Bastien <jfb@google.com>2015-01-14 05:24:11 +0000
commitc7af264486c3039bfbdcbbc027ba3e3b2b3f37d2 (patch)
tree66fd180774fd88cb9dd2fef19db25a7b291cce89 /clang
parent5ab806129318bf0cc6f9a431c988bca29af3c198 (diff)
downloadbcm5719-llvm-c7af264486c3039bfbdcbbc027ba3e3b2b3f37d2.tar.gz
bcm5719-llvm-c7af264486c3039bfbdcbbc027ba3e3b2b3f37d2.zip
Revert "Insert random noops to increase security against ROP attacks (clang)"
This reverts commit: http://reviews.llvm.org/D3393 llvm-svn: 225947
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Driver/CC1Options.td2
-rw-r--r--clang/include/clang/Driver/Options.td3
-rw-r--r--clang/include/clang/Frontend/CodeGenOptions.def2
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp1
-rw-r--r--clang/lib/Driver/Tools.cpp11
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
6 files changed, 1 insertions, 19 deletions
diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td
index fafd149d478..e0430014105 100644
--- a/clang/include/clang/Driver/CC1Options.td
+++ b/clang/include/clang/Driver/CC1Options.td
@@ -194,8 +194,6 @@ def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
HelpText<"Turn off Type Based Alias Analysis">;
def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">,
HelpText<"Turn off struct-path aware Type Based Alias Analysis">;
-def noop_insertion : Flag<["-"], "noop-insertion">,
- HelpText<"Randomly insert NOOPs">;
def masm_verbose : Flag<["-"], "masm-verbose">,
HelpText<"Generate verbose assembly output">;
def mcode_model : Separate<["-"], "mcode-model">,
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 9a76d2a7b93..4daddba332d 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -469,7 +469,6 @@ def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">
def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">,
Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Print a template comparison tree for differing templates">;
-def fdiversify : Flag<["-"], "fdiversify">, Group<f_clang_Group>;
def fdollars_in_identifiers : Flag<["-"], "fdollars-in-identifiers">, Group<f_Group>,
HelpText<"Allow '$' in identifiers">, Flags<[CC1Option]>;
def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
@@ -858,7 +857,7 @@ def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group<f_Group>;
def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group<f_Group>;
def fprofile_generate : Flag<["-"], "fprofile-generate">, Group<f_Group>;
def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
-def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<f_Group>, Flags<[CC1Option]>;
+def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<clang_ignored_f_Group>;
def freg_struct_return : Flag<["-"], "freg-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Override the default ABI to return small structs in registers">;
def frtti : Flag<["-"], "frtti">, Group<f_Group>;
diff --git a/clang/include/clang/Frontend/CodeGenOptions.def b/clang/include/clang/Frontend/CodeGenOptions.def
index 5a9bfc4360d..b44672d0f5f 100644
--- a/clang/include/clang/Frontend/CodeGenOptions.def
+++ b/clang/include/clang/Frontend/CodeGenOptions.def
@@ -160,8 +160,6 @@ ENUM_CODEGENOPT(Inlining, InliningMethod, 2, NoInlining)
/// The default TLS model to use.
ENUM_CODEGENOPT(DefaultTLSModel, TLSModel, 2, GeneralDynamicTLSModel)
-CODEGENOPT(NoopInsertion, 1, 0) ///< Randomly add NOPs
-
#undef CODEGENOPT
#undef ENUM_CODEGENOPT
#undef VALUE_CODEGENOPT
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index ef857ce7c9f..25ecec58624 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -519,7 +519,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
Options.PositionIndependentExecutable = LangOpts.PIELevel != 0;
Options.FunctionSections = CodeGenOpts.FunctionSections;
Options.DataSections = CodeGenOpts.DataSections;
- Options.NoopInsertion = CodeGenOpts.NoopInsertion;
Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll;
Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels;
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 4aecf22468a..d625c0e3e2f 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3737,17 +3737,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
getToolChain().getTriple().getArch() == llvm::Triple::aarch64_be)
CmdArgs.push_back("-fallow-half-arguments-and-returns");
- // Translate -frandom-seed to seed the LLVM RNG
- if (Args.hasArg(options::OPT_frandom_seed_EQ)) {
- StringRef seed = Args.getLastArgValue(options::OPT_frandom_seed_EQ);
- CmdArgs.push_back("-backend-option");
- CmdArgs.push_back(Args.MakeArgString("-rng-seed=" + seed));
- }
-
- if (Args.hasArg(options::OPT_fdiversify)) {
- CmdArgs.push_back("-noop-insertion");
- }
-
if (Arg *A = Args.getLastArg(options::OPT_mrestrict_it,
options::OPT_mno_restrict_it)) {
if (A->getOption().matches(options::OPT_mrestrict_it)) {
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index ef8b76fa3f4..0f6f01d0a08 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -516,7 +516,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.SSPBufferSize =
getLastArgIntValue(Args, OPT_stack_protector_buffer_size, 8, Diags);
Opts.StackRealignment = Args.hasArg(OPT_mstackrealign);
- Opts.NoopInsertion = Args.hasArg(OPT_noop_insertion);
if (Arg *A = Args.getLastArg(OPT_mstack_alignment)) {
StringRef Val = A->getValue();
unsigned StackAlignment = Opts.StackAlignment;
OpenPOWER on IntegriCloud