mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 03:26:10 +00:00
Kernel+Toolchain: Use .init_array
section for global constructors
Before this change, our dynamic linker's global constructor handler relied on the GNU linker implicitly including the content of `.ctors` section inside `.init_array`. The mold linker does not do this, so global constructors would fail to be called in the mold-built userland. There is no point in sticking to `.ctors`, as most other systems already use the superior `.init_array` scheme. This commit changes the kernel linker script to not discard this new section, and enables it by default in our toolchain.
This commit is contained in:
parent
eeb74e2578
commit
5576e9c4c5
Notes:
sideshowbarker
2024-07-17 20:19:13 +09:00
Author: https://github.com/BertalanD
Commit: 5576e9c4c5
Pull-request: https://github.com/SerenityOS/serenity/pull/12049
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/bgianfo ✅
Reviewed-by: https://github.com/linusg ✅
3 changed files with 4 additions and 1 deletions
|
@ -59,10 +59,12 @@ SECTIONS
|
|||
{
|
||||
start_heap_ctors = .;
|
||||
*libkernel_heap.a:*(.ctors)
|
||||
*libkernel_heap.a:*(.init_array)
|
||||
end_heap_ctors = .;
|
||||
|
||||
start_ctors = .;
|
||||
*(.ctors)
|
||||
*(.init_array)
|
||||
end_ctors = .;
|
||||
|
||||
*(.rodata*)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue