linker: do not force keep common kernel objects

This uses the new macros so the common kernel objects can be
garbage collected if they are not referred directly anywhere
in the code. This is useful for reducing library data size
as not all library functions and their corresponding kobjects
are being used.

Fixes #20663

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2020-09-16 16:24:46 -07:00 committed by Anas Nashif
commit 4f106c32d5

View file

@ -91,17 +91,17 @@
_static_kernel_objects_begin = .;
#endif /* CONFIG_USERSPACE */
Z_ITERABLE_SECTION_RAM(k_timer, 4)
Z_ITERABLE_SECTION_RAM(k_mem_slab, 4)
Z_ITERABLE_SECTION_RAM(k_mem_pool, 4)
Z_ITERABLE_SECTION_RAM(k_heap, 4)
Z_ITERABLE_SECTION_RAM(k_mutex, 4)
Z_ITERABLE_SECTION_RAM(k_stack, 4)
Z_ITERABLE_SECTION_RAM(k_msgq, 4)
Z_ITERABLE_SECTION_RAM(k_mbox, 4)
Z_ITERABLE_SECTION_RAM(k_pipe, 4)
Z_ITERABLE_SECTION_RAM(k_sem, 4)
Z_ITERABLE_SECTION_RAM(k_queue, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_timer, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_slab, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_pool, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_heap, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mutex, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_stack, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_msgq, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mbox, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_pipe, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_sem, 4)
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_queue, 4)
SECTION_DATA_PROLOGUE(_net_buf_pool_area,,SUBALIGN(4))
{