Add API to set page size compat mode
Adding APIs in libdl to set linker global which will be used to set the page size compat mode for particular app.
Test: atest bionic-unit-tests
Test: atest CtsBionicTestCases
Bug: 371049373
Change-Id: I20f0fe9ece5db833568edf27ec268edf999f1741
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 7691031..4cbaa2e 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -183,7 +183,8 @@
// It cannot be cached since the developer may toggle app compat on/off.
// This check will be removed once app compat is made the default on 16KiB devices.
should_use_16kib_app_compat_ =
- ::android::base::GetBoolProperty("bionic.linker.16kb.app_compat.enabled", false);
+ ::android::base::GetBoolProperty("bionic.linker.16kb.app_compat.enabled", false) ||
+ get_16kb_appcompat_mode();
}
return did_read_;