mirror of https://gitee.com/openkylin/qemu.git
bsd-user/elfload.c: Don't use ldl() or ldq_raw()
Use get_user_u64() and get_user_ual() instead of the ldl() and ldq_raw() functions. [Note that this change is not compile tested as it is actually in dead code -- none of the bsd-user configurations are PPC.] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 1421334118-3287-6-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
2ccf97ec0f
commit
b8d6ac9f90
|
@ -351,8 +351,10 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
|
||||||
|
|
||||||
_regs->gpr[1] = infop->start_stack;
|
_regs->gpr[1] = infop->start_stack;
|
||||||
#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
|
#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
|
||||||
entry = ldq_raw(infop->entry) + infop->load_addr;
|
get_user_u64(entry, infop->entry);
|
||||||
toc = ldq_raw(infop->entry + 8) + infop->load_addr;
|
entry += infop->load_addr;
|
||||||
|
get_user_u64(toc, infop->entry + 8);
|
||||||
|
toc += infop->load_addr;
|
||||||
_regs->gpr[2] = toc;
|
_regs->gpr[2] = toc;
|
||||||
infop->entry = entry;
|
infop->entry = entry;
|
||||||
#endif
|
#endif
|
||||||
|
@ -365,8 +367,9 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
|
||||||
get_user_ual(_regs->gpr[3], pos);
|
get_user_ual(_regs->gpr[3], pos);
|
||||||
pos += sizeof(abi_ulong);
|
pos += sizeof(abi_ulong);
|
||||||
_regs->gpr[4] = pos;
|
_regs->gpr[4] = pos;
|
||||||
for (tmp = 1; tmp != 0; pos += sizeof(abi_ulong))
|
for (tmp = 1; tmp != 0; pos += sizeof(abi_ulong)) {
|
||||||
tmp = ldl(pos);
|
get_user_ual(tmp, pos);
|
||||||
|
}
|
||||||
_regs->gpr[5] = pos;
|
_regs->gpr[5] = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue