diff --git a/libdl/libdl_cfi.cpp b/libdl/libdl_cfi.cpp index 3b68fc7d3..23cd7f53a 100644 --- a/libdl/libdl_cfi.cpp +++ b/libdl/libdl_cfi.cpp @@ -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; }