From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Wed, 3 Mar 2021 05:12:02 +0100 Subject: [RFC PATCH u-boot 03/12] linker_lists: declare entries and lists externally visible In-Reply-To: <20210303041211.26945-1-marek.behun@nic.cz> References: <20210303041211.26945-1-marek.behun@nic.cz> Message-ID: <20210303041211.26945-4-marek.behun@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Use the `__visible` macro to declare entires and lists declared by ll_entry_declare() and ll_entry_declare_list() externally visible, so that when building with LTO the compiler does not optimize this data away. Signed-off-by: Marek Beh?n --- include/linker_lists.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linker_lists.h b/include/linker_lists.h index fd98ecd297..9d44dab2e5 100644 --- a/include/linker_lists.h +++ b/include/linker_lists.h @@ -70,7 +70,8 @@ #define ll_entry_declare(_type, _name, _list) \ _type _u_boot_list_2_##_list##_2_##_name __aligned(4) \ __attribute__((unused, \ - section(".u_boot_list_2_"#_list"_2_"#_name))) + section(".u_boot_list_2_"#_list"_2_"#_name))) \ + __visible /** * ll_entry_declare_list() - Declare a list of link-generated array entries @@ -93,7 +94,8 @@ #define ll_entry_declare_list(_type, _name, _list) \ _type _u_boot_list_2_##_list##_2_##_name[] __aligned(4) \ __attribute__((unused, \ - section(".u_boot_list_2_"#_list"_2_"#_name))) + section(".u_boot_list_2_"#_list"_2_"#_name))) \ + __visible /* * We need a 0-byte-size type for iterator symbols, and the compiler -- 2.26.2