feat: added support for constructors/desctructors

This commit is contained in:
2023-05-09 22:00:17 +02:00
parent be07ec78da
commit 7411fb55ea
6 changed files with 71 additions and 3 deletions

View File

@@ -23,6 +23,8 @@ SECTIONS
. = 0xffffffff80000000;
.text : {
*(.init)
*(.fini)
*(.text .text.*)
} :text
@@ -33,6 +35,20 @@ SECTIONS
*(.rodata .rodata.*)
} :rodata
/* Include the list of initialization functions sorted. */
.init_array :
{
KEEP (*(.init_array.*))
KEEP (*(.init_array))
} :rodata
/* Include the list of termination functions sorted. */
.fini_array :
{
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array))
} :rodata
/* Move to the next memory page for .data */
. += CONSTANT(MAXPAGESIZE);