mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
common: Convert the U-Boot commands to LG-arrays
This patch converts the old method of creating a list of command onto the new LG-arrays code. The old u_boot_cmd section is converted to new u_boot_list_cmd subsection and LG-array macros used as needed. Minor adjustments had to be made to the common code to work with the LG-array macros, mostly the fixup_cmdtable() calls are now passed the ll_entry_start and ll_entry_count instead of linker-generated symbols. The command.c had to be adjusted as well so it would use the newly introduced LG-array API instead of directly using linker-generated symbols. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
@@ -15,12 +15,12 @@ help: Long description. This is a string
|
||||
|
||||
**** Behind the scene ******
|
||||
|
||||
The structure created is named with a special prefix (__u_boot_cmd_)
|
||||
The structure created is named with a special prefix (__u_boot_list_cmd_)
|
||||
and placed by the linker in a special section.
|
||||
|
||||
This makes it possible for the final link to extract all commands
|
||||
compiled into any object code and construct a static array so the
|
||||
command can be found in an array starting at __u_boot_cmd_start.
|
||||
command can be found in an array starting at _u_boot_list_cmd__start.
|
||||
|
||||
To ensure that the linker does not discard these symbols when linking
|
||||
full U-Boot we generate a list of all the commands we have built (based
|
||||
@@ -33,6 +33,6 @@ If a new board is defined do not forget to define the command section
|
||||
by writing in u-boot.lds ($(TOPDIR)/board/boardname/u-boot.lds) these
|
||||
3 lines:
|
||||
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
.u_boot_list : {
|
||||
#include "u-boot.lst";
|
||||
}
|
||||
|
Reference in New Issue
Block a user