aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2011-10-26 09:59:17 -0700
committerRiku Voipio <riku.voipio@linaro.org>2011-10-27 14:43:30 +0300
commit8e78064e9d95094b7db8e82e57fa6d57fd38b333 (patch)
tree3ed292a712523326bff5f6ad3b459d4fc374e92c /linux-user
parent7cd393ac1db87a5268173ce2286a4283c9e7a4a9 (diff)
downloadqemu-8e78064e9d95094b7db8e82e57fa6d57fd38b333.zip
qemu-8e78064e9d95094b7db8e82e57fa6d57fd38b333.tar.gz
qemu-8e78064e9d95094b7db8e82e57fa6d57fd38b333.tar.bz2
ppc64-linux-user: Properly interpret the entry function descriptor.
Don't confuse the load address with the load bias. They're equal for ET_DYN objects (i.e. ld.so) but different for ET_EXEC objects (i.e. statically linked). Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/elfload.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 8677bba..a413976 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -618,8 +618,8 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
{
_regs->gpr[1] = infop->start_stack;
#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
- _regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_addr;
- infop->entry = ldq_raw(infop->entry) + infop->load_addr;
+ _regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_bias;
+ infop->entry = ldq_raw(infop->entry) + infop->load_bias;
#endif
_regs->nip = infop->entry;
}
@@ -1884,11 +1884,11 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
info->start_stack = bprm->p;
/* If we have an interpreter, set that as the program's entry point.
- Copy the load_addr as well, to help PPC64 interpret the entry
+ Copy the load_bias as well, to help PPC64 interpret the entry
point as a function descriptor. Do this after creating elf tables
so that we copy the original program entry point into the AUXV. */
if (elf_interpreter) {
- info->load_addr = interp_info.load_addr;
+ info->load_bias = interp_info.load_bias;
info->entry = interp_info.entry;
free(elf_interpreter);
}