Merge "bionic: libdl_cfi: Remove PAGE_SIZE usage" into main am: de83440636

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2727078

Change-Id: I1f5bcab12da4efbb7fd3cab2b53a457cc683cbb8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Kalesh Singh 2023-08-28 17:54:03 +00:00 committed by Automerger Merge Worker
commit 256e2a786a

View file

@ -26,15 +26,15 @@ __attribute__((__weak__, visibility("default"))) extern "C" void __loader_cfi_fa
// dlopen/dlclose.
static struct {
uintptr_t v;
char padding[PAGE_SIZE - sizeof(v)];
} shadow_base_storage alignas(PAGE_SIZE);
char padding[max_page_size() - sizeof(v)];
} shadow_base_storage alignas(max_page_size());
// __cfi_init is called by the loader as soon as the shadow is mapped. This may happen very early
// during startup, before libdl.so global constructors, and, on i386, even before __libc_sysinfo is
// initialized. This function should not do any system calls.
extern "C" uintptr_t* __cfi_init(uintptr_t shadow_base) {
shadow_base_storage.v = shadow_base;
static_assert(sizeof(shadow_base_storage) == PAGE_SIZE, "");
static_assert(sizeof(shadow_base_storage) == max_page_size(), "");
return &shadow_base_storage.v;
}