[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/17] Load 64-bit ELFs on all 64-bit ports
From: |
Sergey Bugaev |
Subject: |
[PATCH 04/17] Load 64-bit ELFs on all 64-bit ports |
Date: |
Wed, 27 Mar 2024 19:18:28 +0300 |
Not only on x86_64.
---
include/mach/exec/elf.h | 4 ++--
kern/exception.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/mach/exec/elf.h b/include/mach/exec/elf.h
index 42920e25..55304496 100644
--- a/include/mach/exec/elf.h
+++ b/include/mach/exec/elf.h
@@ -212,7 +212,7 @@ typedef struct elf64_sym {
Elf64_Xword st_size;
} Elf64_Sym;
-#ifdef __x86_64__
+#ifdef __LP64__
#define Elf_Sym Elf64_Sym
#define Elf_Shdr Elf64_Shdr
#else
@@ -350,7 +350,7 @@ typedef struct {
#define DT_TEXTREL 22
#define DT_JMPREL 23
-#if defined(__x86_64__) && ! defined(USER32)
+#if defined(__LP64__) && ! defined(USER32)
typedef Elf64_Ehdr Elf_Ehdr;
typedef Elf64_Phdr Elf_Phdr;
#else
diff --git a/kern/exception.c b/kern/exception.c
index 15f29705..7139b466 100644
--- a/kern/exception.c
+++ b/kern/exception.c
@@ -283,7 +283,7 @@ struct mach_exception {
#define INTEGER_T_SIZE_IN_BITS (8 * sizeof(integer_t))
#define INTEGER_T_TYPE MACH_MSG_TYPE_INTEGER_T
#define RPC_LONG_INTEGER_T_SIZE_IN_BITS (8 * sizeof(rpc_long_integer_t))
-#if defined(__x86_64__) && !defined(USER32)
+#if defined(__LP64__) && !defined(USER32)
#define RPC_LONG_INTEGER_T_TYPE MACH_MSG_TYPE_INTEGER_64
#else
#define RPC_LONG_INTEGER_T_TYPE MACH_MSG_TYPE_INTEGER_32
--
2.44.0
- [PATCH 00/17] Preparatory patches, Sergey Bugaev, 2024/03/27
- [PATCH 04/17] Load 64-bit ELFs on all 64-bit ports,
Sergey Bugaev <=
- [PATCH 06/17] kern/syscall_subr.c: Use copyin()/copyout() to access user memory, Sergey Bugaev, 2024/03/27
- [PATCH 03/17] Use the x86_64 message ABI on all 64-bit ports, Sergey Bugaev, 2024/03/27
- [PATCH 02/17] Disable host_kernel_version() everywhere but on i386, Sergey Bugaev, 2024/03/27
- [PATCH 08/17] ipc: Turn ipc_entry_lookup_failed() into a macro, Sergey Bugaev, 2024/03/27
- [PATCH 11/17] tests: Fix halt(), Sergey Bugaev, 2024/03/27