From patchwork Mon Jan 7 16:54:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 210005 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E29AB2C00AC for ; Tue, 8 Jan 2013 04:00:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A83A4A105; Mon, 7 Jan 2013 18:00:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hDhu1Ub5tqjL; Mon, 7 Jan 2013 18:00:27 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A10FB4A0F1; Mon, 7 Jan 2013 18:00:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D21284A0F1 for ; Mon, 7 Jan 2013 18:00:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vpbbskU4Q7PL for ; Mon, 7 Jan 2013 18:00:22 +0100 (CET) X-Greylist: delayed 321 seconds by postgrey-1.27 at theia; Mon, 07 Jan 2013 18:00:20 CET X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bk0-f43.google.com (mail-bk0-f43.google.com [209.85.214.43]) by theia.denx.de (Postfix) with ESMTPS id 264F44A0ED for ; Mon, 7 Jan 2013 18:00:20 +0100 (CET) Received: by mail-bk0-f43.google.com with SMTP id jf20so8547642bkc.2 for ; Mon, 07 Jan 2013 09:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=Y0DOtll5ufrmybfkD2NxeW9Vu98PSi+0LHzDWZcy/wQ=; b=ZwFDPBGxZPVr7naEIFYacr388XNSUKYqwkbtct4T7LOzuGCx/kTSK457TSACxV8mRU 4LzyIell67eXjw0P0JWqUxeWZlImXHujP1yCm21dVVqpORXPIW7x9sjsdci4MbNKSmd9 ma/4C6M/dkC3XOxL8I5++3Zsw5M/kM6318aeuG4WMT5TWARdEyoYA2d1kE7M/9swd9uj aMpmHogTPCZmDBr0dyU/gYEusPeywoFLDbBAzLd09niCFdoclpP2+EjkcvxFqljNNl8s vj++NaxvbscPBfnWAvJYFimO56tn7Xo38jjMYbH5vDVmjOzy7H2M8Wr7gmyAFiA/WpWx 4zRA== X-Received: by 10.204.4.80 with SMTP id 16mr29946285bkq.73.1357577697714; Mon, 07 Jan 2013 08:54:57 -0800 (PST) Received: from workstation.sas.sys.sphairon.com (dslb-094-222-053-172.pools.arcor-ip.net. [94.222.53.172]) by mx.google.com with ESMTPS id c10sm43002811bkw.1.2013.01.07.08.54.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 08:54:57 -0800 (PST) From: daniel.schwierzeck@gmail.com To: u-boot@lists.denx.de Date: Mon, 7 Jan 2013 17:54:52 +0100 Message-Id: <1357577692-29227-1-git-send-email-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 1.8.0.3 Cc: Tom Rini Subject: [U-Boot] [PATCH] bootm: relocate names of sub-command table for archs with CONFIG_NEEDS_MANUAL_RELOC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Daniel Schwierzeck To make bootm sub-command feature working on archs with CONFIG_NEEDS_MANUAL_RELOC, the name pointers in the sub-command table need to be relocated. Signed-off-by: Daniel Schwierzeck --- common/cmd_bootm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index f7595c0..1b8a8c1 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -592,12 +592,18 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #ifdef CONFIG_NEEDS_MANUAL_RELOC static int relocated = 0; - /* relocate boot function table */ if (!relocated) { int i; + + /* relocate boot function table */ for (i = 0; i < ARRAY_SIZE(boot_os); i++) if (boot_os[i] != NULL) boot_os[i] += gd->reloc_off; + + /* relocate names of sub-command table */ + for (i = 0; i < ARRAY_SIZE(cmd_bootm_sub); i++) + cmd_bootm_sub[i].name += gd->reloc_off; + relocated = 1; } #endif