Merge "linker: ignore the possibility of page size migration for 32-bit processes." into main am: 10d34555fc
Original change: https://android-review.googlesource.com/c/platform/bionic/+/3390140
Change-Id: I4ad7878cf0a3919fd37e63a2ce7ffb8ddd3ba236
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 14bf208..e5369ac 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -752,9 +752,10 @@
}
/*
- * Returns true if the kernel supports page size migration, else false.
+ * Returns true if the kernel supports page size migration for this process.
*/
bool page_size_migration_supported() {
+#if defined(__LP64__)
static bool pgsize_migration_enabled = []() {
std::string enabled;
if (!android::base::ReadFileToString("/sys/kernel/mm/pgsize_migration/enabled", &enabled)) {
@@ -763,6 +764,9 @@
return enabled.find("1") != std::string::npos;
}();
return pgsize_migration_enabled;
+#else
+ return false;
+#endif
}
// Find the ELF note of type NT_ANDROID_TYPE_PAD_SEGMENT and check that the desc value is 1.