Skip to contentSkip to conversation

bootm: relocate names of sub-command table for archs with CONFIG_NEEDS_MANUAL_RELOC

PATCH In review daniel.schwierzeck at gmail.com 2 participants 2 messages Jan 7, 2013 – Jan 10, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bootm: relocate names of sub-command table for archs with CONFIG_NEEDS_MANUAL_RELOC

From: Daniel Schwierzeck <[email protected]>

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.

---
 common/cmd_bootm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
common/cmd_bootm.c +7 -1
index f7595c0..1b8a8c1 100644
@@ -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
Signature · 1 line
1.8.0.3
#1 lore raw
Quoted 6 lines · Daniel Schwierzeck

From: Daniel Schwierzeck <[email protected]>

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130110/37e14abf/attachment.pgp>