]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
linker_lists: Do not set "unused" attribute
authorTom Rini <trini@konsulko.com>
Wed, 20 May 2026 00:09:53 +0000 (18:09 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 4 Jun 2026 18:27:16 +0000 (12:27 -0600)
Whenever we declare something to be in a linker list, we want it to be
included. This is why all of our linker scripts have a line similar to:
KEEP(*(SORT(__u_boot_list*)));
to ensure that any linker list found in any of the archives we are
linking together makes it to the final object. Remove the places where
we set an attribute saying that it is unused, or maybe_unused.

Signed-off-by: Tom Rini <trini@konsulko.com>
include/linker_lists.h

index 4425fcb67852fa37c7158af569e4c99c6701f54c..a8b7e2c9f2bb8ab544e3b58d9c6631d97c12cff3 100644 (file)
@@ -69,7 +69,6 @@
  */
 #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)
 
 /**
@@ -92,7 +91,6 @@
  */
 #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)
 
 /*
 #define ll_entry_start(_type, _list)                                   \
 ({                                                                     \
        static char start[0] __aligned(CONFIG_LINKER_LIST_ALIGN)        \
-               __attribute__((unused))                                 \
                __section("__u_boot_list_2_"#_list"_1");                        \
        _type * tmp = (_type *)&start;                                  \
        asm("":"+r"(tmp));                                              \
  */
 #define ll_entry_end(_type, _list)                                     \
 ({                                                                     \
-       static char end[0] __aligned(1) __attribute__((unused))         \
+       static char end[0] __aligned(1)                                 \
                __section("__u_boot_list_2_"#_list"_3");                        \
        _type * tmp = (_type *)&end;                                    \
        asm("":"+r"(tmp));                                              \
  */
 #define ll_start_decl(_sym, _type, _list)                                      \
        static _type _sym[0] __aligned(CONFIG_LINKER_LIST_ALIGN)        \
-               __maybe_unused __section("__u_boot_list_2_" #_list "_1")
+               __section("__u_boot_list_2_" #_list "_1")
 
 /*
  * ll_end_decl uses __aligned(1) to avoid padding before the end marker.
  */
 #define ll_end_decl(_sym, _type, _list)                                        \
        static _type _sym[0] __aligned(1)                               \
-               __maybe_unused __section("__u_boot_list_2_" #_list "_3")
+               __section("__u_boot_list_2_" #_list "_3")
 
 /**
  * ll_entry_get() - Retrieve entry from linker-generated array by name