This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit eda1633709bf896b83d9a4220fbd82090d27bd41
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Jun 27 20:50:11 2025 +0200

    util: Fix link section attribute
    
    LINK_TABLE_ELEMENT_SECTION macro that defines attribute
    for symbol did not have 'used' part that is needed
    for link table to collect unreferenced symbols
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 kernel/os/include/os/link_tables.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/os/include/os/link_tables.h 
b/kernel/os/include/os/link_tables.h
index 13c329611..2a738086b 100644
--- a/kernel/os/include/os/link_tables.h
+++ b/kernel/os/include/os/link_tables.h
@@ -95,7 +95,7 @@
     __attribute__((section("." #table_name), used))
 /* Macro to create attribute for table with name that may affect order of 
elements */
 #define LINK_TABLE_ELEMENT_SECTION(table_name, elem)                          \
-    __attribute__((section("." #table_name "." #elem)))
+    __attribute__((section("." #table_name "." #elem), used))
 /* Macro to create element that goes to link table.
  * It could be used like this:
  * LINK_TABLE_ELEMENT(example1_table, foo5) = {
@@ -126,7 +126,7 @@
  */
 #define LINK_TABLE_ELEMENT_REF(table_name, elem, var)                         \
     LINK_TABLE_ELEMENT_TYPE(table_name)                                       \
-    const elem##_ptr LINK_TABLE_ELEMENT_SECTION(table_name, elem) = &var
+    const elem##_ptr LINK_TABLE_ELEMENT_SECTION(table_name, elem) = &var;
 
 #define LINK_TABLE(element_type, table_name)                                  \
     typedef element_type table_name##_element_t;                              \

Reply via email to