Merge "Point to the riscv64 psABI frame pointer documentation." into main
diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md
index 8ffd96f..c78528d 100644
--- a/android-changes-for-ndk-developers.md
+++ b/android-changes-for-ndk-developers.md
@@ -146,8 +146,8 @@
(on a 4096-byte boundary) in the zip file and stored uncompressed.
Current versions of the zipalign tool take care of alignment.
-Note that in API level 23 and above dlopen(3) will open a library from
-any zip file, not just your APK. Just give dlopen(3) a path of the form
+Note that in API level 23 and above dlopen(3) can open a library from
+any zip file, not just an APK. Just give dlopen(3) a path of the form
"my_zip_file.zip!/libs/libstuff.so". As with APKs, the library must be
page-aligned and stored uncompressed for this to work.
diff --git a/libc/include/sys/user.h b/libc/include/sys/user.h
index 432c7cb..0ea0285 100644
--- a/libc/include/sys/user.h
+++ b/libc/include/sys/user.h
@@ -34,8 +34,10 @@
__BEGIN_DECLS
+#if !defined(__BIONIC_NO_PAGE_SIZE_MACRO)
#define PAGE_SIZE 4096
#define PAGE_MASK (~(PAGE_SIZE - 1))
+#endif
#if defined(__i386__)
diff --git a/libc/platform/bionic/page.h b/libc/platform/bionic/page.h
index 5f4bb6f..a75b3ac 100644
--- a/libc/platform/bionic/page.h
+++ b/libc/platform/bionic/page.h
@@ -24,16 +24,11 @@
#include <sys/user.h>
inline size_t page_size() {
- /*
- * PAGE_SIZE defines the maximum supported page size. Since 4096 is the
- * minimum supported page size we can just let it be constant folded if it's
- * also the maximum.
- */
-#if PAGE_SIZE == 4096
+#if defined(PAGE_SIZE)
return PAGE_SIZE;
#else
- static size_t size = getauxval(AT_PAGESZ);
- return size;
+ static const size_t page_size = getauxval(PAGE_SIZE);
+ return page_size;
#endif
}