[cfi] Export __cfi_shadow_size.
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.
Test: device bionic tests
Bug: 64293803
(cherry picked from commit 97c16f8dca0694abfcdda34f8e01f5e1e989120f)
Change-Id: Ia82152f568e3a80deb902d02fa400e88e3f556bc
diff --git a/tests/cfi_test.cpp b/tests/cfi_test.cpp
index 5e627a7..088dda6 100644
--- a/tests/cfi_test.cpp
+++ b/tests/cfi_test.cpp
@@ -26,6 +26,7 @@
extern "C" {
void __cfi_slowpath(uint64_t CallSiteTypeId, void* Ptr);
void __cfi_slowpath_diag(uint64_t CallSiteTypeId, void* Ptr, void* DiagData);
+size_t __cfi_shadow_size();
}
static void f() {}
@@ -36,6 +37,8 @@
handle = dlopen("libcfi-test.so", RTLD_NOW | RTLD_LOCAL);
ASSERT_TRUE(handle != nullptr) << dlerror();
+ EXPECT_NE(0U, __cfi_shadow_size());
+
#define SYM(type, name) auto name = reinterpret_cast<type>(dlsym(handle, #name))
SYM(int (*)(), get_count);
SYM(uint64_t(*)(), get_last_type_id);