aboutsummaryrefslogtreecommitdiff
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-05 07:13:51 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-05 07:13:51 +0000
commit7a3148a955e3350720a01f57163ab230b72aca7e (patch)
tree185d039892949f7d14d4394749ccf016bb2d03db /linux-user/elfload.c
parent86cc1ce08362ac8f7da40b7c2aafb9093ab3ae24 (diff)
Preliminary patch for Alpha Linux user mode emulation support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2600 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index c0ea5a0125..5caa44eafd 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -313,6 +313,31 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
#endif
+#ifdef TARGET_ALPHA
+
+#define ELF_START_MMAP (0x30000000000ULL)
+
+#define elf_check_arch(x) ( (x) == ELF_ARCH )
+
+#define ELF_CLASS ELFCLASS64
+#define ELF_DATA ELFDATA2MSB
+#define ELF_ARCH EM_ALPHA
+
+static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
+{
+ regs->pc = infop->entry;
+ regs->ps = 8;
+ regs->usp = infop->start_stack;
+ regs->unique = infop->start_data; /* ? */
+ printf("Set unique value to " TARGET_FMT_lx " (" TARGET_FMT_lx ")\n",
+ regs->unique, infop->start_data);
+}
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE 8192
+
+#endif /* TARGET_ALPHA */
+
#ifndef ELF_PLATFORM
#define ELF_PLATFORM (NULL)
#endif
@@ -431,11 +456,11 @@ static void bswap_shdr(struct elf_shdr *shdr)
bswaptls(&shdr->sh_entsize);
}
-static void bswap_sym(Elf32_Sym *sym)
+static void bswap_sym(struct elf_sym *sym)
{
bswap32s(&sym->st_name);
- bswap32s(&sym->st_value);
- bswap32s(&sym->st_size);
+ bswaptls(&sym->st_value);
+ bswaptls(&sym->st_size);
bswap16s(&sym->st_shndx);
}
#endif