summaryrefslogtreecommitdiffstats
path: root/common/elf.c
diff options
context:
space:
mode:
authorClement Leger <cleger@kalray.eu>2020-06-12 09:10:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-06-15 16:14:48 +0200
commitdb400c59c471d8e52dda292749a10e5c4bf688d5 (patch)
tree22ccb154f332812bf8a96b8b5be11612101bd719 /common/elf.c
parent588255910d570aa37328489cbb314cc39e6dc1b7 (diff)
downloadbarebox-db400c59c471d8e52dda292749a10e5c4bf688d5.tar.gz
barebox-db400c59c471d8e52dda292749a10e5c4bf688d5.tar.xz
common: elf: fix warning on 32 bits architectures
When pointers are 32 bits wide and we cast a potentially 64 bits value in it, the compiler will yield an error. Cast that value first into a phys_addr_t to match the architecture pointer size and then in a void *. Signed-off-by: Clement Leger <cleger@kalray.eu> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/elf.c')
-rw-r--r--common/elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/elf.c b/common/elf.c
index d64de401c4..55f5bc6455 100644
--- a/common/elf.c
+++ b/common/elf.c
@@ -47,7 +47,7 @@ static void elf_release_regions(struct elf_image *elf)
static int load_elf_phdr_segment(struct elf_image *elf, void *src,
void *phdr)
{
- void *dst = (void *) elf_phdr_p_paddr(elf, phdr);
+ void *dst = (void *) (phys_addr_t) elf_phdr_p_paddr(elf, phdr);
int ret;
u64 p_filesz = elf_phdr_p_filesz(elf, phdr);
u64 p_memsz = elf_phdr_p_memsz(elf, phdr);