Commit 30ac07d4f044975c324933eccc56bbd28a9a8a19
1 parent
88570520
moved i386 specific stuff outside elf.h
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@78 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
37 additions
and
0 deletions
linux-user/elfload.c
... | ... | @@ -12,6 +12,43 @@ |
12 | 12 | |
13 | 13 | #include "qemu.h" |
14 | 14 | |
15 | +#ifdef TARGET_I386 | |
16 | + | |
17 | +#define ELF_START_MMAP 0x80000000 | |
18 | + | |
19 | +typedef uint32_t elf_greg_t; | |
20 | + | |
21 | +#define ELF_NGREG (sizeof (struct target_pt_regs) / sizeof(elf_greg_t)) | |
22 | +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |
23 | + | |
24 | +typedef struct user_i387_struct elf_fpregset_t; | |
25 | + | |
26 | +/* | |
27 | + * This is used to ensure we don't load something for the wrong architecture. | |
28 | + */ | |
29 | +#define elf_check_arch(x) ( ((x) == EM_386) || ((x) == EM_486) ) | |
30 | + | |
31 | +/* | |
32 | + * These are used to set parameters in the core dumps. | |
33 | + */ | |
34 | +#define ELF_CLASS ELFCLASS32 | |
35 | +#define ELF_DATA ELFDATA2LSB | |
36 | +#define ELF_ARCH EM_386 | |
37 | + | |
38 | + /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program | |
39 | + starts %edx contains a pointer to a function which might be | |
40 | + registered using `atexit'. This provides a mean for the | |
41 | + dynamic linker to call DT_FINI functions for shared libraries | |
42 | + that have been loaded before the code runs. | |
43 | + | |
44 | + A value of 0 tells we have no such handler. */ | |
45 | +#define ELF_PLAT_INIT(_r) _r->edx = 0 | |
46 | + | |
47 | +#define USE_ELF_CORE_DUMP | |
48 | +#define ELF_EXEC_PAGESIZE 4096 | |
49 | + | |
50 | +#endif | |
51 | + | |
15 | 52 | #include "linux_bin.h" |
16 | 53 | #include "elf.h" |
17 | 54 | #include "segment.h" | ... | ... |