aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-07 21:33:03 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-07 21:33:03 +0000
commit30ac07d4f044975c324933eccc56bbd28a9a8a19 (patch)
treeb6495aeea35d41dc1fc18ab9a0d544b246278771 /linux-user
parent885705205502e9b9668aa7c38daf54ea1ab0a072 (diff)
moved i386 specific stuff outside elf.h
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@78 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/elfload.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 386991a495..78d477c030 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -12,6 +12,43 @@
#include "qemu.h"
+#ifdef TARGET_I386
+
+#define ELF_START_MMAP 0x80000000
+
+typedef uint32_t elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct target_pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_i387_struct elf_fpregset_t;
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x) ( ((x) == EM_386) || ((x) == EM_486) )
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS ELFCLASS32
+#define ELF_DATA ELFDATA2LSB
+#define ELF_ARCH EM_386
+
+ /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program
+ starts %edx contains a pointer to a function which might be
+ registered using `atexit'. This provides a mean for the
+ dynamic linker to call DT_FINI functions for shared libraries
+ that have been loaded before the code runs.
+
+ A value of 0 tells we have no such handler. */
+#define ELF_PLAT_INIT(_r) _r->edx = 0
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE 4096
+
+#endif
+
#include "linux_bin.h"
#include "elf.h"
#include "segment.h"