[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 05/23] hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for
From: |
Sergey Bugaev |
Subject: |
[RFC PATCH 05/23] hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for now |
Date: |
Wed, 3 Jan 2024 20:14:38 +0300 |
While we could support it on any architecture, the tunable is currently
only defined on x86_64.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
Alternatively, we could declare the tunable for all Hurd ports (e.g. in
sysdeps/mach/hurd/dl-tunables.list), but I'm concerned about whether it
would interact well with the existing definition for x86_64. Is it
considered OK for the same tunable to be declared in two places?
sysdeps/mach/hurd/dl-sysdep.c | 2 +-
sysdeps/mach/hurd/mmap.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 43129a1e..6ba00e41 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -457,7 +457,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int
fd, off_t offset)
if (prot & PROT_EXEC)
vmprot |= VM_PROT_EXECUTE;
-#ifdef __LP64__
+#ifdef __x86_64__
if ((addr == NULL) && (prot & PROT_EXEC)
&& HAS_ARCH_FEATURE (Prefer_MAP_32BIT_EXEC))
flags |= MAP_32BIT;
diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
index 7b945610..30e369f0 100644
--- a/sysdeps/mach/hurd/mmap.c
+++ b/sysdeps/mach/hurd/mmap.c
@@ -60,7 +60,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd,
off_t offset)
copy = ! (flags & MAP_SHARED);
anywhere = ! (flags & MAP_FIXED);
-#ifdef __LP64__
+#ifdef __x86_64__
if ((addr == NULL) && (prot & PROT_EXEC)
&& HAS_ARCH_FEATURE (Prefer_MAP_32BIT_EXEC))
flags |= MAP_32BIT;
--
2.43.0
- [RFC PATCH 14/23] aarch64: Allow building without kernel support for BTI, (continued)
- [RFC PATCH 14/23] aarch64: Allow building without kernel support for BTI, Sergey Bugaev, 2024/01/03
- [RFC PATCH 15/23] mach: Add a basic AArch64 port, Sergey Bugaev, 2024/01/03
- [RFC PATCH 16/23] hurd: Add a basic AArch64 port, Sergey Bugaev, 2024/01/03
- [RFC PATCH 19/23] Add FPE_FLTIDO, Sergey Bugaev, 2024/01/03
- [RFC PATCH 18/23] hurd: Implement longjmp for AArch64, Sergey Bugaev, 2024/01/03
- [RFC PATCH 21/23] htl: Implement some support for TLS_DTV_AT_TP, Sergey Bugaev, 2024/01/03
- [RFC PATCH 22/23] htl: Add an AArch64 implementation, Sergey Bugaev, 2024/01/03
- [RFC PATCH 17/23] hurd: Implement TLS on AArch64, Sergey Bugaev, 2024/01/03
- [RFC PATCH 23/23] hurd: Add expected aarch64-gnu abistlists, Sergey Bugaev, 2024/01/03
- [RFC PATCH 20/23] hurd: Add an AArch64 signal implementation, Sergey Bugaev, 2024/01/03
- [RFC PATCH 05/23] hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for now,
Sergey Bugaev <=
- Re: [RFC PATCH 00/23] aarch64-gnu port, Joseph Myers, 2024/01/03