summaryrefslogtreecommitdiff
path: root/linker/linker_main.cpp
diff options
context:
space:
mode:
authorCollin Fijalkovich <cfijalkovich@google.com>2021-03-24 10:17:39 -0700
committerCollin Fijalkovich <cfijalkovich@google.com>2021-05-06 13:15:11 -0700
commit47d27aa79cc58600c8b500d3d3e3377e643676c3 (patch)
treeb1a5f7ea80747d90a71daec0e255739911481784 /linker/linker_main.cpp
parentc551fc7e7a154847e7ca1d7dfbabd0b03028e4f3 (diff)
Bionic: Mark PMD aligned text segments huge page eligible
To take advantage of file-backed huge pages for the text segments of key shared libraries (go/android-hugepages), the dynamic linker must load candidate ELF files at an appropriately aligned address and mark executable segments with MADV_HUGEPAGE. This patches uses segments' p_align values to determine when a file is PMD aligned (2MB alignment), and performs load operations accordingly. Bug: 158135888 Test: Verified PMD aligned libraries are backed with huge pages on supporting kernel versions. Change-Id: Ia2367fd5652f663d50103e18f7695c59dc31c7b9
Diffstat (limited to 'linker/linker_main.cpp')
-rw-r--r--linker/linker_main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp
index 0b501a7b1..2a690e9a0 100644
--- a/linker/linker_main.cpp
+++ b/linker/linker_main.cpp
@@ -31,9 +31,10 @@
#include <link.h>
#include <sys/auxv.h>
+#include "linker.h"
+#include "linker_cfi.h"
#include "linker_debug.h"
#include "linker_debuggerd.h"
-#include "linker_cfi.h"
#include "linker_gdb_support.h"
#include "linker_globals.h"
#include "linker_phdr.h"