Improve linker scripts

This commit is contained in:
Alex Kotov 2022-01-15 23:06:03 +05:00
parent 71f4bf793c
commit 3c34afb931
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
3 changed files with 30 additions and 23 deletions

View File

@ -1,14 +1,27 @@
ENTRY(_start);
. = 0x80000000;
SECTIONS
{
. = 0x80000000;
SECTIONS {
/* Include entry point at start of binary */
.text : ALIGN(4K) {
.text : ALIGN(4K)
{
*(.init);
*(.text);
}
.bss : ALIGN(4K) {
.rodata : ALIGN(4K)
{
*(.rodata);
}
.data : ALIGN(4K)
{
*(.data);
}
.bss : ALIGN(4K)
{
PROVIDE(bss_start = .);
*(.bss);
. += 4096;
@ -17,10 +30,4 @@ SECTIONS {
PROVIDE(global_pointer = .);
PROVIDE(bss_end = .);
}
.rodata : ALIGN(4K) {
*(.rodata);
}
.data : ALIGN(4K) {
*(.data);
}
}

View File

@ -14,24 +14,24 @@ SECTIONS
.text BLOCK(4K) : ALIGN(4K)
{
*(.multiboot2)
*(.text)
*(.multiboot2);
*(.text);
}
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
*(.rodata);
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
*(.data);
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
*(COMMON);
*(.bss);
}
_kernel_size = . - _kernel_phys_base;

View File

@ -14,24 +14,24 @@ SECTIONS
.text BLOCK(4K) : ALIGN(4K)
{
*(.multiboot2)
*(.text)
*(.multiboot2);
*(.text);
}
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
*(.rodata);
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
*(.data);
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
*(COMMON);
*(.bss);
}
_kernel_size = . - _kernel_phys_base;