All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suman Anna <s-anna@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] remoteproc: elf_loader: fix program header parsing
Date: Fri, 11 Oct 2019 14:35:35 -0500	[thread overview]
Message-ID: <7396d164-84ec-3757-bb1d-786267a07cf1@ti.com> (raw)
In-Reply-To: <1567583602-17022-1-git-send-email-fabien.dessenne@st.com>

On 9/4/19 2:53 AM, 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.
> 

Good catch Fabien.


Fixes: 7a7c4cb0f044 ("remoteproc: add elf file load support")
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>

Acked-by: Suman Anna <s-anna@ti.com>

regards
Suman

> ---
>  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;
> 

  parent reply	other threads:[~2019-10-11 19:35 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
2019-10-11 19:35 ` Suman Anna [this message]
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=7396d164-84ec-3757-bb1d-786267a07cf1@ti.com \
    --to=s-anna@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.