summaryrefslogtreecommitdiff
path: root/kexec/arch/ppc64
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2010-02-02 14:42:02 +1100
committerSimon Horman <horms@verge.net.au>2010-02-02 14:42:02 +1100
commitebadff4f150b3309938ec1779ecbd8ede871b7ac (patch)
tree62badf59c93f4a07af7092c1e311fd6db3628b75 /kexec/arch/ppc64
parente90a4fef6966eecfc6f6fa2f3a755ac031996db1 (diff)
Cast 64bit pointer to a 64bit int then a 32bit int
The two-stage cast is because we really do want a 32bit integer value from a 64bit pointer, and gcc assumes that we're making a mistake if there is just one cast. # powerpc64-unknown-linux-gnu-gcc --version powerpc64-unknown-linux-gnu-gcc (GCC) 4.1.1 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # make kexec/arch/ppc64/kexec-elf-rel-ppc64.c: In function 'machine_apply_elf_rel': kexec/arch/ppc64/kexec-elf-rel-ppc64.c:66: warning: cast from pointer to integer of different size Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/ppc64')
-rw-r--r--kexec/arch/ppc64/kexec-elf-rel-ppc64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
index 97aa34c..ec787b0 100644
--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
@@ -63,7 +63,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
break;
case R_PPC64_REL32:
- *(uint32_t *)location = value - (uint32_t)location;
+ *(uint32_t *)location = value - (uint32_t)(uint64_t)location;
break;
case R_PPC64_TOC: