From patchwork Thu Oct 13 16:07:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 119563 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 61C7CB71C5 for ; Fri, 14 Oct 2011 03:08:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4078828A19; Thu, 13 Oct 2011 18:07:57 +0200 (CEST) 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 UgyJ9eV2DaIK; Thu, 13 Oct 2011 18:07:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FE0D28A4D; Thu, 13 Oct 2011 18:07:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A6C228A4D for ; Thu, 13 Oct 2011 18:07:50 +0200 (CEST) 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 THTPQipGV+bF for ; Thu, 13 Oct 2011 18:07:49 +0200 (CEST) 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-gy0-f172.google.com (mail-gy0-f172.google.com [209.85.160.172]) by theia.denx.de (Postfix) with ESMTPS id DC48628A19 for ; Thu, 13 Oct 2011 18:07:47 +0200 (CEST) Received: by gyh20 with SMTP id 20so172580gyh.3 for ; Thu, 13 Oct 2011 09:07:45 -0700 (PDT) Received: by 10.223.5.139 with SMTP id 11mr6930638fav.21.1318522065433; Thu, 13 Oct 2011 09:07:45 -0700 (PDT) Received: from localhost.localdomain (dslb-088-073-209-043.pools.arcor-ip.net. [88.73.209.43]) by mx.google.com with ESMTPS id v17sm459370fai.18.2011.10.13.09.07.43 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Oct 2011 09:07:44 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Thu, 13 Oct 2011 18:07:39 +0200 Message-Id: <1318522059-16182-1-git-send-email-daniel.schwierzeck@googlemail.com> X-Mailer: git-send-email 1.7.7 Subject: [U-Boot] [PATCH] common: fix missing function pointer relocation in fixup_cmdtable() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 The command auto-completion does not work on architectures relying on CONFIG_NEEDS_MANUAL_RELOC like MIPS. Cause is the missing function pointer fixup for cmd_tbl_t::complete function in fixup_cmdtable(). This patch adds the missing pointer fixup in case of CONFIG_AUTO_COMPLETE is defined. Signed-off-by: Daniel Schwierzeck --- common/command.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/common/command.c b/common/command.c index ddaed68..ed931d7 100644 --- a/common/command.c +++ b/common/command.c @@ -475,6 +475,12 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size) cmdtp->help = (char *)addr; } #endif +#ifdef CONFIG_AUTO_COMPLETE + if (cmdtp->complete) { + addr = (ulong)(cmdtp->complete) + gd->reloc_off; + cmdtp->complete = (char *)addr; + } +#endif cmdtp++; } }