ladybird/Kernel/linker.ld
Andrew Kaster 233ea7eb1d Kernel: Add bare minimum for global constructors (#707)
Add text.startup to the .text block, add .ctors as well.
Use them in init.cpp to call global constructors after
gtd and idt init. That way any funky constructors should be ok.

Also defines some Itanium C++ ABI methods that probably shouldn't be,
but without them the linker gets very angry.
If the code ever actually tries to use __dso_handle or call
 __cxa_atexit, there's bigger problems with the kernel.

Bit of a hack would be an understatement but hey. It works :)
2019-10-31 19:01:13 +01:00

34 lines
358 B
Text

ENTRY(start)
SECTIONS
{
. = 0x10000;
.text BLOCK(4K) : ALIGN(4K)
{
Arch/i386/Boot/boot.ao
*(.multiboot)
*(.text)
*(.text.startup)
}
.rodata BLOCK(4K) : ALIGN(4K)
{
start_ctors = .;
*(.ctors)
end_ctors = .;
*(.rodata)
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
}
}