mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
Kernel: Reorder sections in aarch64 linker script to save space
By putting the NOLOAD sections (.bss and .super_pages) at the end of the ELF file, objcopy does not have to insert a lot of zeros to make sure that the .ksyms section is at the right place in memory. Now the .ksyms section comes before the two NOLOAD sections. This shrinks the kernel8.img with 6MB, from 8.3M to 2.3M. :^)
This commit is contained in:
parent
a1b352fdc0
commit
d449fef606
Notes:
sideshowbarker
2024-07-17 11:07:33 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/d449fef606 Pull-request: https://github.com/SerenityOS/serenity/pull/13991 Reviewed-by: https://github.com/linusg
@ -5,9 +5,9 @@ PHDRS
|
||||
{
|
||||
text PT_LOAD ;
|
||||
data PT_LOAD ;
|
||||
ksyms PT_LOAD ;
|
||||
bss PT_LOAD ;
|
||||
super_pages PT_LOAD ;
|
||||
ksyms PT_LOAD ;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
@ -34,6 +34,13 @@ SECTIONS
|
||||
*(.data*)
|
||||
} :data
|
||||
|
||||
.ksyms ALIGN(4K) : AT (ADDR(.ksyms))
|
||||
{
|
||||
start_of_kernel_ksyms = .;
|
||||
*(.kernel_symbols)
|
||||
end_of_kernel_ksyms = .;
|
||||
} :ksyms
|
||||
|
||||
.bss ALIGN(4K) (NOLOAD) : AT (ADDR(.bss))
|
||||
{
|
||||
start_of_bss = .;
|
||||
@ -49,13 +56,6 @@ SECTIONS
|
||||
*(.super_pages)
|
||||
} :super_pages
|
||||
|
||||
.ksyms ALIGN(4K) : AT (ADDR(.ksyms))
|
||||
{
|
||||
start_of_kernel_ksyms = .;
|
||||
*(.kernel_symbols)
|
||||
end_of_kernel_ksyms = .;
|
||||
} :ksyms
|
||||
|
||||
/*
|
||||
FIXME: 8MB is enough space for all of the tables required to identity map
|
||||
physical memory. 8M is wasteful, so this should be properly calculated.
|
||||
|
Loading…
Reference in New Issue
Block a user