On 04/09/19 1:23 PM, Fabien Dessenne wrote:
> 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.desse...@st.com>

Reviewed-by: Lokesh Vutla <lokeshvu...@ti.com>

Thanks and regards,
Lokesh

> ---
>  drivers/remoteproc/rproc-elf-loader.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/rproc-elf-loader.c 
> b/drivers/remoteproc/rproc-elf-loader.c
> index 67937a7..23d502d 100644
> --- a/drivers/remoteproc/rproc-elf-loader.c
> +++ b/drivers/remoteproc/rproc-elf-loader.c
> @@ -78,7 +78,7 @@ int rproc_elf32_load_image(struct udevice *dev, unsigned 
> long addr)
>       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;
>  
> @@ -99,7 +99,6 @@ int rproc_elf32_load_image(struct udevice *dev, unsigned 
> long addr)
>                           roundup((unsigned long)dst + phdr->p_filesz,
>                                   ARCH_DMA_MINALIGN) -
>                           rounddown((unsigned long)dst, ARCH_DMA_MINALIGN));
> -             ++phdr;
>       }
>  
>       return 0;
> 
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to