summaryrefslogtreecommitdiff
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-01-20 15:19:33 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-01-20 15:19:33 +0000
commit2ccf97ec0f1b7a62a3220064f305454f3932c55a (patch)
tree2c2c226cc82b21d780179a6609bd7618b6950919 /linux-user/elfload.c
parenteb513f82f04fab442cdef9db698dafc852275f7f (diff)
downloadqemu-2ccf97ec0f1b7a62a3220064f305454f3932c55a.tar.gz
qemu-2ccf97ec0f1b7a62a3220064f305454f3932c55a.tar.bz2
qemu-2ccf97ec0f1b7a62a3220064f305454f3932c55a.zip
linux-user/elfload.c: Don't use _raw accessor functions
The _raw accessor functions are an implementation detail that has leaked out to some callsites. Use get_user_u64() instead of ldq_raw(). 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-5-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index e2596a4201..399c021337 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -829,8 +829,11 @@ 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)
if (get_ppc64_abi(infop) < 2) {
- _regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_bias;
- infop->entry = ldq_raw(infop->entry) + infop->load_bias;
+ uint64_t val;
+ get_user_u64(val, infop->entry + 8);
+ _regs->gpr[2] = val + infop->load_bias;
+ get_user_u64(val, infop->entry);
+ infop->entry = val + infop->load_bias;
} else {
_regs->gpr[12] = infop->entry; /* r12 set to global entry address */
}