libelf: Support prioritized init and fini arrays.

Add a wildcard operator to gnu-elf.ld to ensure all c++ constructors
and destruction are included in partially linked application binaries.
This commit is contained in:
Stuart Ianna 2023-04-19 16:33:41 +10:00 committed by Xiang Xiao
parent 733807f635
commit f4dcdbec0e
1 changed files with 2 additions and 0 deletions

View File

@ -75,6 +75,7 @@ SECTIONS
_sctors = . ;
*(.ctors) /* Old ABI: Unallocated */
*(.init_array) /* New ABI: Allocated */
*(SORT(.init_array.*))
_ectors = . ;
}
@ -83,6 +84,7 @@ SECTIONS
_sdtors = . ;
*(.dtors) /* Old ABI: Unallocated */
*(.fini_array) /* New ABI: Allocated */
*(SORT(.fini_array.*))
_edtors = . ;
}