aboutsummaryrefslogtreecommitdiff
path: root/i386/include
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-02-16 22:33:16 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-16 23:27:25 +0100
commit78395241a0546832f0904492579df8210f7a176e (patch)
tree1f6d8454b4e347b9bf3d3b2b694a1d1526fa9413 /i386/include
parentbdfedb6e4ada9adc78137d75065b9e9607223f4f (diff)
downloadgnumach-78395241a0546832f0904492579df8210f7a176e.tar.gz
gnumach-78395241a0546832f0904492579df8210f7a176e.tar.bz2
gnumach-78395241a0546832f0904492579df8210f7a176e.zip
x86_64: load Elf64 bootstrap modules if ! USER32
* i386/include/mach/i386/exec/elf.h: add Elf64 definitions and define common Elf structures, corresponding to 32/64 bit variants at compile time. * include/mach/exec/elf.h: add Elf64 definitions * kern/elf-load.c: use common Elf structures Message-Id: <20230216213318.2048699-2-luca@orpolo.org>
Diffstat (limited to 'i386/include')
-rw-r--r--i386/include/mach/i386/exec/elf.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/i386/include/mach/i386/exec/elf.h b/i386/include/mach/i386/exec/elf.h
index cfa988d2..582f8767 100644
--- a/i386/include/mach/i386/exec/elf.h
+++ b/i386/include/mach/i386/exec/elf.h
@@ -29,8 +29,26 @@ typedef unsigned int Elf32_Off;
typedef signed int Elf32_Sword;
typedef unsigned int Elf32_Word;
-/* Architecture identification parameters for i386. */
+typedef uint64_t Elf64_Addr;
+typedef uint64_t Elf64_Off;
+typedef int32_t Elf64_Shalf;
+typedef int32_t Elf64_Sword;
+typedef uint32_t Elf64_Word;
+typedef int64_t Elf64_Sxword;
+typedef uint64_t Elf64_Xword;
+typedef uint32_t Elf64_Half;
+typedef uint16_t Elf64_Quarter;
+
+
+/* Architecture identification parameters for x86. */
+#if defined(__x86_64__) && ! defined(USER32)
+#define MY_ELF_CLASS ELFCLASS64
+#define MY_EI_DATA ELFDATA2LSB
+#define MY_E_MACHINE EM_X86_64
+#else
+#define MY_ELF_CLASS ELFCLASS32
#define MY_EI_DATA ELFDATA2LSB
#define MY_E_MACHINE EM_386
+#endif
#endif /* _MACH_I386_EXEC_ELF_H_ */