aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
authorLogan Chien <loganchien@google.com>2013-11-06 22:22:01 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-03-24 11:53:46 -0700
commit5230452a6bf78fbe77f70132a1e8b67c65df4a74 (patch)
treed17dd50d6fefa3893374b5c1917cf147862304a8 /lib/Target/X86/X86ISelLowering.cpp
parent3722003fb74fdd7e2f8bddeec33af3b6ae1e6e91 (diff)
downloadllvm-5230452a6bf78fbe77f70132a1e8b67c65df4a74.tar.gz
[ndk][x86] Add option to store sp cookie in var.
Add an option to store the stack protector cookie in the global variable.
Diffstat (limited to 'lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index b75842738ee..28475bded65 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -84,6 +84,12 @@ static cl::opt<int> ReciprocalEstimateRefinementSteps(
"result of the hardware reciprocal estimate instruction."),
cl::NotHidden);
+// Force to store the stack protector cookie in the global variable
+static cl::opt<bool> ForceGlobalVarStackProtectorCookie(
+ "x86-force-gv-stack-cookie",
+ cl::init(false),
+ cl::desc("Store the stack protector cookie in the global variable"));
+
// Forward declarations.
static SDValue getMOVL(SelectionDAG &DAG, SDLoc dl, EVT VT, SDValue V1,
SDValue V2);
@@ -1962,6 +1968,9 @@ bool X86TargetLowering::getStackCookieLocation(unsigned &AddressSpace,
if (!Subtarget->isTargetLinux())
return false;
+ if (ForceGlobalVarStackProtectorCookie)
+ return false;
+
if (Subtarget->is64Bit()) {
// %fs:0x28, unless we're using a Kernel code model, in which case it's %gs:
Offset = 0x28;