Patchwork [U-Boot] common: fix missing function pointer relocation in fixup_cmdtable()

login
register
mail settings
Submitter Daniel Schwierzeck
Date Oct. 13, 2011, 4:07 p.m.
Message ID <1318522059-16182-1-git-send-email-daniel.schwierzeck@googlemail.com>
Download mbox | patch
Permalink /patch/119563/
State Accepted
Commit fa28bd2eef588ec2048ccafedb2b384d5a355858
Headers show

Comments

Daniel Schwierzeck - Oct. 13, 2011, 4:07 p.m.
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 <daniel.schwierzeck@googlemail.com>
---
 common/command.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Wolfgang Denk - Oct. 15, 2011, 8:19 p.m.
Dear Daniel Schwierzeck,

In message <1318522059-16182-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> 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 <daniel.schwierzeck@googlemail.com>
> ---
>  common/command.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Daniel Schwierzeck - Oct. 18, 2011, 12:37 p.m.
Dear Wolfgang,

On Sat, Oct 15, 2011 at 10:19 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Daniel Schwierzeck,
>
> In message <1318522059-16182-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
>> The command auto-completion does not work on architectures relying
...
>
> Applied, thanks.

you have missed v2 of the patch.
See also http://patchwork.ozlabs.org/patch/119777/

Maybe because I forgot to cc you in the second mail, sorry for that.

Shall I send an updated patch?

Best regards,
Daniel
Wolfgang Denk - Oct. 18, 2011, 8:20 p.m.
Dear Daniel Schwierzeck,

In message <CACUy__VcnaeQMcTzv1KAK7LDdBfqBj=vXYWpK081M3AW2HQ3tg@mail.gmail.com> you wrote:
>
> you have missed v2 of the patch.
> See also http://patchwork.ozlabs.org/patch/119777/
> 
> Maybe because I forgot to cc you in the second mail, sorry for that.

No, this was my fault. I have to be sorry.

> Shall I send an updated patch?

Yes, please (an incremental one against current master).

Best regards,

Wolfgang Denk

Patch

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