nuttx/x86_64:Add _sinit and _einit initialization.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei 2024-04-01 19:52:34 +08:00 committed by Xiang Xiao
parent 696e1a3f70
commit 68e25dcee6
2 changed files with 17 additions and 1 deletions

View File

@ -31,7 +31,15 @@ SECTIONS
_etext = ABSOLUTE(.);
}
.text ALIGN (0x1000) : {
.init_section ALIGN(0x1000) :
{
_sinit = ABSOLUTE(.);
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP(*(.init_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o) .ctors))
_einit = ABSOLUTE(.);
}
.rodata ALIGN (0x1000) : {
_srodata = ABSOLUTE(.);
*(.rodata .rodata.*)
*(.fixup)

View File

@ -77,6 +77,14 @@ SECTIONS
_etext = ABSOLUTE(.);
}
.init_section ALIGN(0x1000) :
{
_sinit = ABSOLUTE(.);
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP(*(.init_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o) .ctors))
. = ALIGN(4096);
_einit = ABSOLUTE(.);
}
.rodata ALIGN(0x1000) :
{