[PATCH u-boot 11/39] binman: declare symbols externally visible

Marek Behún marek.behun at nic.cz
Sun Mar 7 05:25:10 CET 2021


Use the `externally_visible` attribute to declare binman symbols
externally visible, so that when building with LTO the compiler does not
optimize this data away.

Signed-off-by: Marek Behún <marek.behun at nic.cz>
---
 include/binman_sym.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/binman_sym.h b/include/binman_sym.h
index 72e6765fe5..f9c0e681c9 100644
--- a/include/binman_sym.h
+++ b/include/binman_sym.h
@@ -34,7 +34,8 @@
  */
 #define binman_sym_declare(_type, _entry_name, _prop_name) \
 	_type binman_symname(_entry_name, _prop_name) \
-		__attribute__((aligned(4), unused, section(".binman_sym")))
+		__attribute__((aligned(4), unused, externally_visible, \
+		section(".binman_sym")))
 
 /**
  * binman_sym_extern() - Declare a extern symbol that will be used at run-time
@@ -59,7 +60,7 @@
  */
 #define binman_sym_declare_optional(_type, _entry_name, _prop_name) \
 	_type binman_symname(_entry_name, _prop_name) \
-		__attribute__((aligned(4), weak, unused, \
+		__attribute__((aligned(4), weak, unused, externally_visible \
 		section(".binman_sym")))
 
 /**
-- 
2.26.2



More information about the U-Boot mailing list