summaryrefslogtreecommitdiff
path: root/Kernel/linker.ld
diff options
context:
space:
mode:
authorAndrew Kaster <andrewdkaster@gmail.com>2019-10-31 12:01:13 -0600
committerAndreas Kling <awesomekling@gmail.com>2019-10-31 19:01:13 +0100
commit233ea7eb1ded63f5e9c067e5b97851bd2de6cdbb (patch)
treef876833685381da8f397d51c9ccf5c18cc12b99e /Kernel/linker.ld
parentd0c11bbcc36eb64713c59ef7de4742c36ee7aba7 (diff)
downloadserenity-233ea7eb1ded63f5e9c067e5b97851bd2de6cdbb.zip
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 :)
Diffstat (limited to 'Kernel/linker.ld')
-rw-r--r--Kernel/linker.ld5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/linker.ld b/Kernel/linker.ld
index e0880fd96e..986ede14ed 100644
--- a/Kernel/linker.ld
+++ b/Kernel/linker.ld
@@ -9,10 +9,15 @@ SECTIONS
Arch/i386/Boot/boot.ao
*(.multiboot)
*(.text)
+ *(.text.startup)
}
.rodata BLOCK(4K) : ALIGN(4K)
{
+ start_ctors = .;
+ *(.ctors)
+ end_ctors = .;
+
*(.rodata)
}