[PATCH 06/11] version: Put version_string[] variable into section .text_version_string

Pali Rohár pali at kernel.org
Mon Aug 2 15:18:33 CEST 2021


This would allow to reference this variable easily from linker scripts.

Signed-off-by: Pali Rohár <pali at kernel.org>
---
 cmd/version.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/version.c b/cmd/version.c
index 965ac2e2144d..ad632fe4fb7a 100644
--- a/cmd/version.c
+++ b/cmd/version.c
@@ -13,7 +13,7 @@
 #include <asm/cb_sysinfo.h>
 #endif
 
-const char __weak version_string[] = U_BOOT_VERSION_STRING;
+const char __weak version_string[] __section(".text_version_string") = U_BOOT_VERSION_STRING;
 
 static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
 		      char *const argv[])
-- 
2.20.1



More information about the U-Boot mailing list