Skip to content

Commit

Permalink
nuttx/x86_64:Add _sinit and _einit initialization.
Browse files Browse the repository at this point in the history
Signed-off-by: cuiziwei <[email protected]>
  • Loading branch information
cuiziweizw committed Oct 15, 2024
1 parent 39690a9 commit bea1276
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion boards/x86/qemu/qemu-i486/scripts/qemu.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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) :
{
Expand Down

0 comments on commit bea1276

Please sign in to comment.