modlib:need add ctors to init_array and dtors to fini_array

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2024-11-12 12:24:34 +08:00 committed by Xiang Xiao
parent d8bdf23e8a
commit c62b35a12c

View file

@ -36,13 +36,16 @@ SECTIONS
.init_array : .init_array :
{ {
_sinit = .; _sinit = .;
*(.init_array) KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP(*(.init_array .ctors))
_einit = .; _einit = .;
} }
.fini_array : .fini_array :
{ {
*(.fini_array) KEEP (*(.dtors))
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
} }
.rodata : .rodata :