Skip to content

Commit 68e25dc

Browse files
cuiziweizwxiaoxiang781216
authored andcommitted
nuttx/x86_64:Add _sinit and _einit initialization.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
1 parent 696e1a3 commit 68e25dc

File tree

2 files changed

+17
-1
lines changed
  • boards
    • x86_64/intel64/qemu-intel64/scripts
    • x86/qemu/qemu-i486/scripts

2 files changed

+17
-1
lines changed

boards/x86/qemu/qemu-i486/scripts/qemu.ld

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ SECTIONS
3131
_etext = ABSOLUTE(.);
3232
}
3333

34-
.text ALIGN (0x1000) : {
34+
.init_section ALIGN(0x1000) :
35+
{
36+
_sinit = ABSOLUTE(.);
37+
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
38+
KEEP(*(.init_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o) .ctors))
39+
_einit = ABSOLUTE(.);
40+
}
41+
42+
.rodata ALIGN (0x1000) : {
3543
_srodata = ABSOLUTE(.);
3644
*(.rodata .rodata.*)
3745
*(.fixup)

boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ SECTIONS
7777
_etext = ABSOLUTE(.);
7878
}
7979

80+
.init_section ALIGN(0x1000) :
81+
{
82+
_sinit = ABSOLUTE(.);
83+
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
84+
KEEP(*(.init_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o) .ctors))
85+
. = ALIGN(4096);
86+
_einit = ABSOLUTE(.);
87+
}
8088

8189
.rodata ALIGN(0x1000) :
8290
{

0 commit comments

Comments
 (0)