]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
common: always compile fixup_cmdtable()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 26 Nov 2020 19:46:37 +0000 (20:46 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 16 Jan 2021 19:49:09 +0000 (14:49 -0500)
With our optimization settings the linker eliminates unused functions.

But for debugging it is better to compile with -Og or -O0. With -O0
compiling the sandbox fails due to the missing function fixup_cmdtable()
called by dm_reloc() and others.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/command.c

index 068cb55b4cd50d246c11367d05f33f3cb6c31cb6..3fe6791edaa2034d88b26a0ddb6bce3ed4183fd5 100644 (file)
@@ -16,6 +16,8 @@
 #include <log.h>
 #include <linux/ctype.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Use puts() instead of printf() to avoid printf buffer overflow
  * for long help messages
@@ -488,9 +490,6 @@ int cmd_get_data_size(char* arg, int default_size)
 }
 #endif
 
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
-DECLARE_GLOBAL_DATA_PTR;
-
 void fixup_cmdtable(struct cmd_tbl *cmdtp, int size)
 {
        int     i;
@@ -535,7 +534,6 @@ void fixup_cmdtable(struct cmd_tbl *cmdtp, int size)
                cmdtp++;
        }
 }
-#endif
 
 int cmd_always_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
                          char *const argv[], int *repeatable)