summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vlad@tsyrklevich.net>2018-07-13 19:48:35 +0000
committerVlad Tsyrklevich <vlad@tsyrklevich.net>2018-07-13 19:48:35 +0000
commit5625d7ef61d8af9bb5eceb979738c88a07fddb24 (patch)
tree5069d57871c60d906f2ff222a6fee3251875d8f0 /lib
parent5291d19fa227cf4dcd8fb2a6d83a0fcb49214c5c (diff)
SafeStack: Add builtins to read unsafe stack top/bottom
Summary: Introduce built-ins to read the unsafe stack top and bottom. The unsafe stack top is required to implement garbage collection scanning for Oilpan. Currently there is already a built-in 'get_unsafe_stack_start' to read the bottom of the unsafe stack, but I chose to duplicate this API because 'start' is ambiguous (e.g. Oilpan uses WTF::GetStackStart to read the safe stack top.) Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D49152 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/safestack/safestack.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/safestack/safestack.cc b/lib/safestack/safestack.cc
index 8b1fdb788..cc6d81b2e 100644
--- a/lib/safestack/safestack.cc
+++ b/lib/safestack/safestack.cc
@@ -257,11 +257,20 @@ __attribute__((section(".preinit_array"),
#endif
extern "C"
- __attribute__((visibility("default"))) void *__get_unsafe_stack_start() {
+ __attribute__((visibility("default"))) void *__get_unsafe_stack_bottom() {
return unsafe_stack_start;
}
extern "C"
+ __attribute__((visibility("default"))) void *__get_unsafe_stack_top() {
+ return (char*)unsafe_stack_start + unsafe_stack_size;
+}
+
+extern "C"
+ __attribute__((visibility("default"), alias("__get_unsafe_stack_bottom")))
+ void *__get_unsafe_stack_start();
+
+extern "C"
__attribute__((visibility("default"))) void *__get_unsafe_stack_ptr() {
return __safestack_unsafe_stack_ptr;
}