summaryrefslogtreecommitdiff
path: root/0002-elf-ld.so-keep-compatible-with-the-original-policy-o.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
commitd20db0561a6a36f914fde030512503b114ef9a0c (patch)
treed4e5e3494d95c269a1cee6195f11bf3201bcadbf /0002-elf-ld.so-keep-compatible-with-the-original-policy-o.patch
parent016343d99b1b269d7246ef1e143d4b54914433d4 (diff)
Diffstat (limited to '0002-elf-ld.so-keep-compatible-with-the-original-policy-o.patch')
-rw-r--r--0002-elf-ld.so-keep-compatible-with-the-original-policy-o.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/0002-elf-ld.so-keep-compatible-with-the-original-policy-o.patch b/0002-elf-ld.so-keep-compatible-with-the-original-policy-o.patch
new file mode 100644
index 0000000..ea95478
--- /dev/null
+++ b/0002-elf-ld.so-keep-compatible-with-the-original-policy-o.patch
@@ -0,0 +1,34 @@
+From 2ace2eddbd6a0cda2006e632444cd19a360d12d4 Mon Sep 17 00:00:00 2001
+From: Lv Ying <lvying6@huawei.com>
+Date: Fri, 24 Feb 2023 16:14:42 +0800
+Subject: [PATCH 2/3] elf/ld.so: keep compatible with the original policy of
+ the LD_HUGEPAGE_LIB env
+
+When we use new policy: ld.so load PT_LOAD segement use hugepage according to
+PF_HUGEPAGE flag. We should keep compatible with the original policy of
+the LD_HUGEPAGE_LIB env which loads all the PT_LOAD segment try to use
+hugepage.
+
+Signed-off-by: Lv Ying <lvying6@huawei.com>
+---
+ elf/dl-load.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index e0d4fa2e..e01bb448 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -1184,7 +1184,9 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd,
+ }
+
+ #ifdef HUGEPAGE_SHARED_LIB
+- if (ph->p_flags & PF_HUGEPAGE) {
++ if (GLRO(dl_hugepage_mask) & DL_HUGEPAGE_LIB_LARGE_IN_FLAG) {
++ hp_bitmap[nloadcmds] = 1;
++ } else if (ph->p_flags & PF_HUGEPAGE) {
+ hp_bitmap[nloadcmds] = 1;
+ use_hugepage = true;
+ } else
+--
+2.38.1
+