From patchwork Wed Sep 4 07:53:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien DESSENNE X-Patchwork-Id: 1157798 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="Aa6pZ9XH"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Nn4R6kNGz9s3Z for ; Thu, 5 Sep 2019 00:57:59 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 662BAC21E1D; Wed, 4 Sep 2019 14:55:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F1759C21DB3; Wed, 4 Sep 2019 14:53:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3CBF7C21C38; Wed, 4 Sep 2019 07:53:48 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 7E10AC21C29 for ; Wed, 4 Sep 2019 07:53:43 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x847p8hp007131; Wed, 4 Sep 2019 09:53:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=zDNYR1PFaspce2lSaQcE0Vs61WY8bHZWSD4DU2vbfN0=; b=Aa6pZ9XHbHls3ZlVpYxow29T8trxJc7KXfWiXoZHZ1Rb6Sku/2Ln9a67hQWC3byS3URM f/hJML/7yX6tl2vnxHEAK64eqPDFQtyRWiyH38lyjD6ubRHvvdFE6dVjI26w0tC+199n maPQNxoNc9mQt/701b3AwBEPoVJxrk94xn9OQzFa/eFba/vOPbPOiuzba1V6gJjpb2Ib N1eUFBnZnNSCXinKFtAW6P86pA918/235dyFc7gq5ig+xSn3iwVvwPBQSerEIFRkBOWy szjSUjALahqFwsefxUCWXMoHxb4jyLsIzdRuOtqw7BzZcOQinL/KboS9BwNXvKTdhSQM 0w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uqec2ytqw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 04 Sep 2019 09:53:42 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id CDC894E; Wed, 4 Sep 2019 07:53:37 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 233952B6BCC; Wed, 4 Sep 2019 09:53:37 +0200 (CEST) Received: from SAFEX1HUBCAS21.st.com (10.75.90.45) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 09:53:37 +0200 Received: from localhost (10.201.23.25) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 09:53:36 +0200 From: Fabien Dessenne To: , Lokesh Vutla , Loic Pallardy Date: Wed, 4 Sep 2019 09:53:22 +0200 Message-ID: <1567583602-17022-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.25] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-04_01:2019-09-03,2019-09-04 signatures=0 X-Mailman-Approved-At: Wed, 04 Sep 2019 14:53:11 +0000 Cc: uboot-stm32@st-md-mailman.stormreply.com, Fabien Dessenne Subject: [U-Boot] [PATCH] remoteproc: elf_loader: fix program header parsing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Acked-by: Suman Anna --- 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;