Android support for SafeStack.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 23 Sep 2015 18:07:56 +0000 (18:07 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 23 Sep 2015 18:07:56 +0000 (18:07 +0000)
commitd4052cf84cd8d63d9f2501ae49908ec077c6d053
tree193e0c51197c3e0606d8030f29d245e487339329
parent5e2a635f0ed33775909348611b0e3e0cf40329c5
Android support for SafeStack.

Add two new ways of accessing the unsafe stack pointer:

* At a fixed offset from the thread TLS base. This is very similar to
  StackProtector cookies, but we plan to extend it to other backends
  (ARM in particular) soon. Bionic-side implementation here:
  https://android-review.googlesource.com/170988.
* Via a function call, as a fallback for platforms that provide
  neither a fixed TLS slot, nor a reasonable TLS implementation (i.e.
  not emutls).

This is a re-commit of a change in r248357 that was reverted in
r248358.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248405 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/Target/TargetLowering.h
include/llvm/Transforms/Instrumentation.h
lib/CodeGen/Passes.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/X86/X86Subtarget.h
lib/Transforms/Instrumentation/SafeStack.cpp
test/Transforms/SafeStack/AArch64/abi.ll [new file with mode: 0644]
test/Transforms/SafeStack/AArch64/lit.local.cfg [new file with mode: 0644]
test/Transforms/SafeStack/ARM/abi.ll [new file with mode: 0644]
test/Transforms/SafeStack/ARM/lit.local.cfg [new file with mode: 0644]
test/Transforms/SafeStack/X86/abi.ll [new file with mode: 0644]
test/Transforms/SafeStack/X86/lit.local.cfg [new file with mode: 0644]