Commit 992f48a0 authored by blueswir1's avatar blueswir1

Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3396 c046a42c-6fe2-441c-8c8c-71466251a162
parent b227a8e9
...@@ -31,7 +31,10 @@ CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) ...@@ -31,7 +31,10 @@ CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
endif endif
ifdef CONFIG_LINUX_USER ifdef CONFIG_LINUX_USER
VPATH+=:$(SRC_PATH)/linux-user VPATH+=:$(SRC_PATH)/linux-user
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) ifndef TARGET_ABI_DIR
TARGET_ABI_DIR=$(TARGET_ARCH)
endif
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
endif endif
BASE_CFLAGS= BASE_CFLAGS=
BASE_LDFLAGS= BASE_LDFLAGS=
...@@ -66,6 +69,11 @@ ifeq ($(TARGET_ARCH),mips64) ...@@ -66,6 +69,11 @@ ifeq ($(TARGET_ARCH),mips64)
TARGET_ARCH2=mips64el TARGET_ARCH2=mips64el
endif endif
endif endif
ifeq ($(TARGET_ARCH),sparc64)
ifeq ($(TARGET_ABI_DIR),sparc)
TARGET_ARCH2=sparc32plus
endif
endif
QEMU_USER=qemu-$(TARGET_ARCH2) QEMU_USER=qemu-$(TARGET_ARCH2)
# system emulator name # system emulator name
ifdef CONFIG_SOFTMMU ifdef CONFIG_SOFTMMU
......
...@@ -504,7 +504,7 @@ if test -z "$target_list" ; then ...@@ -504,7 +504,7 @@ if test -z "$target_list" ; then
fi fi
# the following are Linux specific # the following are Linux specific
if [ "$linux_user" = "yes" ] ; then if [ "$linux_user" = "yes" ] ; then
target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user x86_64-linux-user cris-linux-user $target_list" target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user x86_64-linux-user cris-linux-user $target_list"
fi fi
# the following are Darwin specific # the following are Darwin specific
if [ "$darwin_user" = "yes" ] ; then if [ "$darwin_user" = "yes" ] ; then
...@@ -933,6 +933,7 @@ target_bigendian="no" ...@@ -933,6 +933,7 @@ target_bigendian="no"
[ "$target_cpu" = "armeb" ] && target_bigendian=yes [ "$target_cpu" = "armeb" ] && target_bigendian=yes
[ "$target_cpu" = "sparc" ] && target_bigendian=yes [ "$target_cpu" = "sparc" ] && target_bigendian=yes
[ "$target_cpu" = "sparc64" ] && target_bigendian=yes [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
[ "$target_cpu" = "ppc" ] && target_bigendian=yes [ "$target_cpu" = "ppc" ] && target_bigendian=yes
[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
[ "$target_cpu" = "ppc64" ] && target_bigendian=yes [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
...@@ -1026,6 +1027,13 @@ elif test "$target_cpu" = "sparc64" ; then ...@@ -1026,6 +1027,13 @@ elif test "$target_cpu" = "sparc64" ; then
echo "#define TARGET_SPARC 1" >> $config_h echo "#define TARGET_SPARC 1" >> $config_h
echo "#define TARGET_SPARC64 1" >> $config_h echo "#define TARGET_SPARC64 1" >> $config_h
elfload32="yes" elfload32="yes"
elif test "$target_cpu" = "sparc32plus" ; then
echo "TARGET_ARCH=sparc64" >> $config_mak
echo "TARGET_ABI_DIR=sparc" >> $config_mak
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
echo "#define TARGET_SPARC 1" >> $config_h
echo "#define TARGET_SPARC64 1" >> $config_h
echo "#define TARGET_ABI32 1" >> $config_h
elif test "$target_cpu" = "ppc" ; then elif test "$target_cpu" = "ppc" ; then
echo "TARGET_ARCH=ppc" >> $config_mak echo "TARGET_ARCH=ppc" >> $config_mak
echo "#define TARGET_ARCH \"ppc\"" >> $config_h echo "#define TARGET_ARCH \"ppc\"" >> $config_h
...@@ -1113,7 +1121,7 @@ if test "$target_darwin_user" = "yes" ; then ...@@ -1113,7 +1121,7 @@ if test "$target_darwin_user" = "yes" ; then
echo "#define CONFIG_DARWIN_USER 1" >> $config_h echo "#define CONFIG_DARWIN_USER 1" >> $config_h
fi fi
if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "sparc32plus" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
echo "CONFIG_SOFTFLOAT=yes" >> $config_mak echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
echo "#define CONFIG_SOFTFLOAT 1" >> $config_h echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
fi fi
......
...@@ -2,40 +2,40 @@ ...@@ -2,40 +2,40 @@
#define __USER_DS (1) #define __USER_DS (1)
struct target_pt_regs { struct target_pt_regs {
target_ulong r0; abi_ulong r0;
target_ulong r1; abi_ulong r1;
target_ulong r2; abi_ulong r2;
target_ulong r3; abi_ulong r3;
target_ulong r4; abi_ulong r4;
target_ulong r5; abi_ulong r5;
target_ulong r6; abi_ulong r6;
target_ulong r7; abi_ulong r7;
target_ulong r8; abi_ulong r8;
target_ulong r19; abi_ulong r19;
target_ulong r20; abi_ulong r20;
target_ulong r21; abi_ulong r21;
target_ulong r22; abi_ulong r22;
target_ulong r23; abi_ulong r23;
target_ulong r24; abi_ulong r24;
target_ulong r25; abi_ulong r25;
target_ulong r26; abi_ulong r26;
target_ulong r27; abi_ulong r27;
target_ulong r28; abi_ulong r28;
target_ulong hae; abi_ulong hae;
/* JRP - These are the values provided to a0-a2 by PALcode */ /* JRP - These are the values provided to a0-a2 by PALcode */
target_ulong trap_a0; abi_ulong trap_a0;
target_ulong trap_a1; abi_ulong trap_a1;
target_ulong trap_a2; abi_ulong trap_a2;
/* These are saved by PAL-code: */ /* These are saved by PAL-code: */
target_ulong ps; abi_ulong ps;
target_ulong pc; abi_ulong pc;
target_ulong gp; abi_ulong gp;
target_ulong r16; abi_ulong r16;
target_ulong r17; abi_ulong r17;
target_ulong r18; abi_ulong r18;
/* Those is needed by qemu to temporary store the user stack pointer */ /* Those is needed by qemu to temporary store the user stack pointer */
target_ulong usp; abi_ulong usp;
target_ulong unique; abi_ulong unique;
}; };
#define UNAME_MACHINE "alpha" #define UNAME_MACHINE "alpha"
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
/* this struct defines a stack used during syscall handling */ /* this struct defines a stack used during syscall handling */
typedef struct target_sigaltstack { typedef struct target_sigaltstack {
target_ulong ss_sp; abi_ulong ss_sp;
target_long ss_flags; abi_long ss_flags;
target_ulong ss_size; abi_ulong ss_size;
} target_stack_t; } target_stack_t;
...@@ -21,7 +21,7 @@ typedef struct target_sigaltstack { ...@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 4096 #define TARGET_MINSIGSTKSZ 4096
#define TARGET_SIGSTKSZ 16384 #define TARGET_SIGSTKSZ 16384
static inline target_ulong get_sp_from_cpustate(CPUAlphaState *state) static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state)
{ {
return state->ir[IR_SP]; return state->ir[IR_SP];
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
stack during a system call. */ stack during a system call. */
struct target_pt_regs { struct target_pt_regs {
target_long uregs[18]; abi_long uregs[18];
}; };
#define ARM_cpsr uregs[16] #define ARM_cpsr uregs[16]
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
/* this struct defines a stack used during syscall handling */ /* this struct defines a stack used during syscall handling */
typedef struct target_sigaltstack { typedef struct target_sigaltstack {
target_ulong ss_sp; abi_ulong ss_sp;
target_long ss_flags; abi_long ss_flags;
target_ulong ss_size; abi_ulong ss_size;
} target_stack_t; } target_stack_t;
...@@ -21,7 +21,7 @@ typedef struct target_sigaltstack { ...@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048 #define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192 #define TARGET_SIGSTKSZ 8192
static inline target_ulong get_sp_from_cpustate(CPUARMState *state) static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
{ {
return state->regs[13]; return state->regs[13];
} }
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
/* this struct defines a stack used during syscall handling */ /* this struct defines a stack used during syscall handling */
typedef struct target_sigaltstack { typedef struct target_sigaltstack {
target_ulong ss_sp; abi_ulong ss_sp;
target_ulong ss_size; abi_ulong ss_size;
target_long ss_flags; abi_long ss_flags;
} target_stack_t; } target_stack_t;
...@@ -21,7 +21,7 @@ typedef struct target_sigaltstack { ...@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048 #define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192 #define TARGET_SIGSTKSZ 8192
static inline target_ulong get_sp_from_cpustate(CPUCRISState *state) static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state)
{ {
return state->regs[14]; return state->regs[14];
} }
......
...@@ -172,7 +172,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i ...@@ -172,7 +172,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
{ {
target_long stack = infop->start_stack; abi_long stack = infop->start_stack;
memset(regs, 0, sizeof(*regs)); memset(regs, 0, sizeof(*regs));
regs->ARM_cpsr = 0x10; regs->ARM_cpsr = 0x10;
if (infop->entry & 1) if (infop->entry & 1)
...@@ -214,7 +214,11 @@ enum ...@@ -214,7 +214,11 @@ enum
#define ELF_START_MMAP 0x80000000 #define ELF_START_MMAP 0x80000000
#ifndef TARGET_ABI32
#define elf_check_arch(x) ( (x) == EM_SPARCV9 || (x) == EM_SPARC32PLUS ) #define elf_check_arch(x) ( (x) == EM_SPARCV9 || (x) == EM_SPARC32PLUS )
#else
#define elf_check_arch(x) ( (x) == EM_SPARC32PLUS || (x) == EM_SPARC )
#endif
#define ELF_CLASS ELFCLASS64 #define ELF_CLASS ELFCLASS64
#define ELF_DATA ELFDATA2MSB #define ELF_DATA ELFDATA2MSB
...@@ -224,14 +228,20 @@ enum ...@@ -224,14 +228,20 @@ enum
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
{ {
#ifndef TARGET_ABI32
regs->tstate = 0; regs->tstate = 0;
#endif
regs->pc = infop->entry; regs->pc = infop->entry;
regs->npc = regs->pc + 4; regs->npc = regs->pc + 4;
regs->y = 0; regs->y = 0;
#ifdef TARGET_ABI32
regs->u_regs[14] = infop->start_stack - 16 * 4;
#else
if (personality(infop->personality) == PER_LINUX32) if (personality(infop->personality) == PER_LINUX32)
regs->u_regs[14] = infop->start_stack - 16 * 4; regs->u_regs[14] = infop->start_stack - 16 * 4;
else else
regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS; regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS;
#endif
} }
#else #else
...@@ -313,10 +323,10 @@ do { \ ...@@ -313,10 +323,10 @@ do { \
static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop) static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop)
{ {
target_ulong pos = infop->start_stack; abi_ulong pos = infop->start_stack;
target_ulong tmp; abi_ulong tmp;
#ifdef TARGET_PPC64 #ifdef TARGET_PPC64
target_ulong entry, toc; abi_ulong entry, toc;
#endif #endif
_regs->msr = 1 << MSR_PR; /* Set user mode */ _regs->msr = 1 << MSR_PR; /* Set user mode */
...@@ -333,9 +343,9 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info * ...@@ -333,9 +343,9 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
* execution of PPC BSD programs. * execution of PPC BSD programs.
*/ */
_regs->gpr[3] = tgetl(pos); _regs->gpr[3] = tgetl(pos);
pos += sizeof(target_ulong); pos += sizeof(abi_ulong);
_regs->gpr[4] = pos; _regs->gpr[4] = pos;
for (tmp = 1; tmp != 0; pos += sizeof(target_ulong)) for (tmp = 1; tmp != 0; pos += sizeof(abi_ulong))
tmp = ldl(pos); tmp = ldl(pos);
_regs->gpr[5] = pos; _regs->gpr[5] = pos;
} }
...@@ -475,9 +485,9 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i ...@@ -475,9 +485,9 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
#define ELF_HWCAP 0 #define ELF_HWCAP 0
#endif #endif
#ifdef OVERRIDE_ELF_CLASS #ifdef TARGET_ABI32
#undef ELF_CLASS #undef ELF_CLASS
#define ELF_CLASS OVERRIDE_ELF_CLASS #define ELF_CLASS ELFCLASS32
#undef bswaptls #undef bswaptls
#define bswaptls(ptr) bswap32s(ptr) #define bswaptls(ptr) bswap32s(ptr)
#endif #endif
...@@ -588,8 +598,8 @@ static void bswap_sym(struct elf_sym *sym) ...@@ -588,8 +598,8 @@ static void bswap_sym(struct elf_sym *sym)
* to be put directly into the top of new user memory. * to be put directly into the top of new user memory.
* *
*/ */
static target_ulong copy_elf_strings(int argc,char ** argv, void **page, static abi_ulong copy_elf_strings(int argc,char ** argv, void **page,
target_ulong p) abi_ulong p)
{ {
char *tmp, *tmp1, *pag = NULL; char *tmp, *tmp1, *pag = NULL;
int len, offset = 0; int len, offset = 0;
...@@ -638,10 +648,10 @@ static target_ulong copy_elf_strings(int argc,char ** argv, void **page, ...@@ -638,10 +648,10 @@ static target_ulong copy_elf_strings(int argc,char ** argv, void **page,
return p; return p;
} }
static target_ulong setup_arg_pages(target_ulong p, struct linux_binprm *bprm, static abi_ulong setup_arg_pages(abi_ulong p, struct linux_binprm *bprm,
struct image_info *info) struct image_info *info)
{ {
target_ulong stack_base, size, error; abi_ulong stack_base, size, error;
int i; int i;
/* Create enough stack to hold everything. If we don't use /* Create enough stack to hold everything. If we don't use
...@@ -677,7 +687,7 @@ static target_ulong setup_arg_pages(target_ulong p, struct linux_binprm *bprm, ...@@ -677,7 +687,7 @@ static target_ulong setup_arg_pages(target_ulong p, struct linux_binprm *bprm,
return p; return p;
} }
static void set_brk(target_ulong start, target_ulong end) static void set_brk(abi_ulong start, abi_ulong end)
{ {
/* page-align the start and end addresses... */ /* page-align the start and end addresses... */
start = HOST_PAGE_ALIGN(start); start = HOST_PAGE_ALIGN(start);
...@@ -696,9 +706,9 @@ static void set_brk(target_ulong start, target_ulong end) ...@@ -696,9 +706,9 @@ static void set_brk(target_ulong start, target_ulong end)
/* We need to explicitly zero any fractional pages after the data /* We need to explicitly zero any fractional pages after the data
section (i.e. bss). This would contain the junk from the file that section (i.e. bss). This would contain the junk from the file that
should not be in memory. */ should not be in memory. */
static void padzero(target_ulong elf_bss, target_ulong last_bss) static void padzero(abi_ulong elf_bss, abi_ulong last_bss)
{ {
target_ulong nbyte; abi_ulong nbyte;
if (elf_bss >= last_bss) if (elf_bss >= last_bss)
return; return;
...@@ -709,7 +719,7 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss) ...@@ -709,7 +719,7 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss)
patch target_mmap(), but it is more complicated as the file patch target_mmap(), but it is more complicated as the file
size must be known */ size must be known */
if (qemu_real_host_page_size < qemu_host_page_size) { if (qemu_real_host_page_size < qemu_host_page_size) {
target_ulong end_addr, end_addr1; abi_ulong end_addr, end_addr1;
end_addr1 = (elf_bss + qemu_real_host_page_size - 1) & end_addr1 = (elf_bss + qemu_real_host_page_size - 1) &
~(qemu_real_host_page_size - 1); ~(qemu_real_host_page_size - 1);
end_addr = HOST_PAGE_ALIGN(elf_bss); end_addr = HOST_PAGE_ALIGN(elf_bss);
...@@ -731,16 +741,16 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss) ...@@ -731,16 +741,16 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss)
} }
static target_ulong create_elf_tables(target_ulong p, int argc, int envc, static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
struct elfhdr * exec, struct elfhdr * exec,
target_ulong load_addr, abi_ulong load_addr,
target_ulong load_bias, abi_ulong load_bias,
target_ulong interp_load_addr, int ibcs, abi_ulong interp_load_addr, int ibcs,
struct image_info *info) struct image_info *info)
{ {
target_ulong sp; abi_ulong sp;
int size; int size;
target_ulong u_platform; abi_ulong u_platform;
const char *k_platform; const char *k_platform;
const int n = sizeof(elf_addr_t); const int n = sizeof(elf_addr_t);
...@@ -756,7 +766,7 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc, ...@@ -756,7 +766,7 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
/* /*
* Force 16 byte _final_ alignment here for generality. * Force 16 byte _final_ alignment here for generality.
*/ */
sp = sp &~ (target_ulong)15; sp = sp &~ (abi_ulong)15;
size = (DLINFO_ITEMS + 1) * 2; size = (DLINFO_ITEMS + 1) * 2;
if (k_platform) if (k_platform)
size += 2; size += 2;
...@@ -786,18 +796,18 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc, ...@@ -786,18 +796,18 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
NEW_AUX_ENT (AT_NULL, 0); NEW_AUX_ENT (AT_NULL, 0);
/* There must be exactly DLINFO_ITEMS entries here. */ /* There must be exactly DLINFO_ITEMS entries here. */
NEW_AUX_ENT(AT_PHDR, (target_ulong)(load_addr + exec->e_phoff)); NEW_AUX_ENT(AT_PHDR, (abi_ulong)(load_addr + exec->e_phoff));
NEW_AUX_ENT(AT_PHENT, (target_ulong)(sizeof (struct elf_phdr))); NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr)));
NEW_AUX_ENT(AT_PHNUM, (target_ulong)(exec->e_phnum)); NEW_AUX_ENT(AT_PHNUM, (abi_ulong)(exec->e_phnum));
NEW_AUX_ENT(AT_PAGESZ, (target_ulong)(TARGET_PAGE_SIZE)); NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)(TARGET_PAGE_SIZE));
NEW_AUX_ENT(AT_BASE, (target_ulong)(interp_load_addr)); NEW_AUX_ENT(AT_BASE, (abi_ulong)(interp_load_addr));
NEW_AUX_ENT(AT_FLAGS, (target_ulong)0); NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0);
NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry); NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry);
NEW_AUX_ENT(AT_UID, (target_ulong) getuid()); NEW_AUX_ENT(AT_UID, (abi_ulong) getuid());
NEW_AUX_ENT(AT_EUID, (target_ulong) geteuid()); NEW_AUX_ENT(AT_EUID, (abi_ulong) geteuid());
NEW_AUX_ENT(AT_GID, (target_ulong) getgid()); NEW_AUX_ENT(AT_GID, (abi_ulong) getgid());
NEW_AUX_ENT(AT_EGID, (target_ulong) getegid()); NEW_AUX_ENT(AT_EGID, (abi_ulong) getegid());
NEW_AUX_ENT(AT_HWCAP, (target_ulong) ELF_HWCAP); NEW_AUX_ENT(AT_HWCAP, (abi_ulong) ELF_HWCAP);
if (k_platform) if (k_platform)
NEW_AUX_ENT(AT_PLATFORM, u_platform); NEW_AUX_ENT(AT_PLATFORM, u_platform);
#ifdef ARCH_DLINFO #ifdef ARCH_DLINFO
...@@ -814,17 +824,17 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc, ...@@ -814,17 +824,17 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
} }
static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex, static abi_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
int interpreter_fd, int interpreter_fd,
target_ulong *interp_load_addr) abi_ulong *interp_load_addr)
{ {
struct elf_phdr *elf_phdata = NULL; struct elf_phdr *elf_phdata = NULL;
struct elf_phdr *eppnt; struct elf_phdr *eppnt;
target_ulong load_addr = 0; abi_ulong load_addr = 0;
int load_addr_set = 0; int load_addr_set = 0;
int retval; int retval;
target_ulong last_bss, elf_bss; abi_ulong last_bss, elf_bss;
target_ulong error; abi_ulong error;
int i; int i;
elf_bss = 0; elf_bss = 0;
...@@ -838,20 +848,20 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex, ...@@ -838,20 +848,20 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
if ((interp_elf_ex->e_type != ET_EXEC && if ((interp_elf_ex->e_type != ET_EXEC &&
interp_elf_ex->e_type != ET_DYN) || interp_elf_ex->e_type != ET_DYN) ||
!elf_check_arch(interp_elf_ex->e_machine)) { !elf_check_arch(interp_elf_ex->e_machine)) {
return ~((target_ulong)0UL); return ~((abi_ulong)0UL);
} }
/* Now read in all of the header information */ /* Now read in all of the header information */
if (sizeof(struct elf_phdr) * interp_elf_ex->e_phnum > TARGET_PAGE_SIZE) if (sizeof(struct elf_phdr) * interp_elf_ex->e_phnum > TARGET_PAGE_SIZE)
return ~(target_ulong)0UL; return ~(abi_ulong)0UL;
elf_phdata = (struct elf_phdr *) elf_phdata = (struct elf_phdr *)
malloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum); malloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum);
if (!elf_phdata) if (!elf_phdata)
return ~((target_ulong)0UL); return ~((abi_ulong)0UL);
/* /*