diff options
author | Michal Simek <michal.simek@xilinx.com> | 2015-12-04 10:42:01 (GMT) |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2015-12-07 09:14:30 (GMT) |
commit | d6df048bca348a964943e6dedda8a674eb07dc30 (patch) | |
tree | fb30250315476c700ef83103bf0c4ab3fda93954 /test | |
parent | e4099c8b8053e7534cc50cdc8403792304eea973 (diff) | |
download | u-boot-d6df048bca348a964943e6dedda8a674eb07dc30.tar.xz |
dm: cmd: Relocate subcommands when MANUAL_RELOC
Subcommands contain pointers to functions which are not updated when
MANUAL_RELOC is enabled. This patch fix it.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/dm/cmd_dm.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c index caff49a..b6e7109 100644 --- a/test/dm/cmd_dm.c +++ b/test/dm/cmd_dm.c @@ -46,11 +46,25 @@ static cmd_tbl_t test_commands[] = { U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""), }; +static __maybe_unused void dm_reloc(void) +{ + static int relocated; + + if (!relocated) { + fixup_cmdtable(test_commands, ARRAY_SIZE(test_commands)); + relocated = 1; + } +} + static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *test_cmd; int ret; +#ifdef CONFIG_NEEDS_MANUAL_RELOC + dm_reloc(); +#endif + if (argc < 2) return CMD_RET_USAGE; test_cmd = find_cmd_tbl(argv[1], test_commands, |