All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] remoteproc: elf_loader: fix program header parsing
Date: Wed, 4 Sep 2019 13:27:43 +0530	[thread overview]
Message-ID: <bba9f02c-f4a8-04d9-4159-a96dc9921e25@ti.com> (raw)
In-Reply-To: <1567583602-17022-1-git-send-email-fabien.dessenne@st.com>



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.dessenne@st.com>

Reviewed-by: Lokesh Vutla <lokeshvutla@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;
> 

  reply	other threads:[~2019-09-04  7:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  7:53 [U-Boot] [PATCH] remoteproc: elf_loader: fix program header parsing Fabien Dessenne
2019-09-04  7:57 ` Lokesh Vutla [this message]
2019-10-11 19:35 ` Suman Anna
2020-01-25 17:08 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bba9f02c-f4a8-04d9-4159-a96dc9921e25@ti.com \
    --to=lokeshvutla@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.