diff options
author | Fabien Dessenne <fabien.dessenne@st.com> | 2019-09-04 09:53:22 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-01-24 11:19:52 -0500 |
commit | 83b539cfd49f0fbcce4dd9d127776354031a7308 (patch) | |
tree | 8165dc2412942d2fec5c13e7a65183c754710c49 /drivers/remoteproc | |
parent | 2c871f9e084b2c03d1961884228a6901387ab8d6 (diff) | |
download | u-boot-83b539cfd49f0fbcce4dd9d127776354031a7308.zip u-boot-83b539cfd49f0fbcce4dd9d127776354031a7308.tar.gz u-boot-83b539cfd49f0fbcce4dd9d127776354031a7308.tar.bz2 |
remoteproc: elf_loader: fix program header parsing
Fix an issue where some sections are never loaded : if p_type is
different from PT_LOAD the phdr pointer must be incremented.
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/rproc-elf-loader.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/remoteproc/rproc-elf-loader.c b/drivers/remoteproc/rproc-elf-loader.c index 5384812..d234592 100644 --- a/drivers/remoteproc/rproc-elf-loader.c +++ b/drivers/remoteproc/rproc-elf-loader.c @@ -189,7 +189,7 @@ int rproc_elf32_load_image(struct udevice *dev, unsigned long addr, ulong size) ops = rproc_get_ops(dev); /* Load each program header */ - for (i = 0; i < ehdr->e_phnum; ++i) { + for (i = 0; i < ehdr->e_phnum; i++, phdr++) { void *dst = (void *)(uintptr_t)phdr->p_paddr; void *src = (void *)addr + phdr->p_offset; @@ -211,7 +211,6 @@ int rproc_elf32_load_image(struct udevice *dev, unsigned long addr, ulong size) roundup((unsigned long)dst + phdr->p_filesz, ARCH_DMA_MINALIGN) - rounddown((unsigned long)dst, ARCH_DMA_MINALIGN)); - ++phdr; } return 0; |