mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-06-01 17:27:59 +00:00
Update linker for i386
This commit is contained in:
parent
649450d191
commit
3dcb696de1
@ -20,55 +20,80 @@ OUTPUT_ARCH(i386)
|
|||||||
|
|
||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
|
|
||||||
|
PF_R = 0x4;
|
||||||
|
PF_W = 0x2;
|
||||||
|
PF_X = 0x1;
|
||||||
|
|
||||||
|
PHDRS
|
||||||
|
{
|
||||||
|
bootstrap PT_LOAD FLAGS( PF_R | PF_W /*| PF_X*/ );
|
||||||
|
text PT_LOAD FLAGS( PF_R | PF_X );
|
||||||
|
data PT_LOAD FLAGS( PF_R | PF_W );
|
||||||
|
rodata PT_LOAD FLAGS( PF_R );
|
||||||
|
bss PT_LOAD FLAGS( PF_R | PF_W );
|
||||||
|
}
|
||||||
|
|
||||||
|
KERNEL_VMA = 0xC0000000;
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = 0xC0000000;
|
. = 0x100000;
|
||||||
|
_bootstrap_start = .;
|
||||||
|
.bootstrap ALIGN(CONSTANT(MAXPAGESIZE)) :
|
||||||
|
{
|
||||||
|
*(.multiboot)
|
||||||
|
*(.multiboot2)
|
||||||
|
*(.bootstrap .bootstrap.*)
|
||||||
|
} :bootstrap
|
||||||
|
_bootstrap_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
|
||||||
_kernel_start = .;
|
. += KERNEL_VMA;
|
||||||
.text :
|
|
||||||
|
_kernel_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
_kernel_text_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
.text ALIGN(CONSTANT(MAXPAGESIZE)) : AT(ADDR(.text) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
*(.text .text.*)
|
*(.text .text.*)
|
||||||
}
|
} :text
|
||||||
_kernel_text_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
_kernel_text_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
. += CONSTANT(MAXPAGESIZE);
|
|
||||||
|
|
||||||
.data :
|
_kernel_data_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
.data ALIGN(CONSTANT(MAXPAGESIZE)) : AT(ADDR(.data) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
*(.data .data.*)
|
*(.data .data.*)
|
||||||
}
|
} :data
|
||||||
_kernel_data_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
_kernel_data_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
. += CONSTANT(MAXPAGESIZE);
|
|
||||||
|
|
||||||
.rodata :
|
_kernel_rodata_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
.rodata ALIGN(CONSTANT(MAXPAGESIZE)) : AT(ADDR(.rodata) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
*(.rodata .rodata.*)
|
*(.rodata .rodata.*)
|
||||||
}
|
} :rodata
|
||||||
_kernel_rodata_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
|
||||||
. += CONSTANT(MAXPAGESIZE);
|
|
||||||
|
|
||||||
.init_array :
|
.init_array ALIGN(CONSTANT(MAXPAGESIZE)) : AT(ADDR(.init_array) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN(__init_array_start = .);
|
PROVIDE_HIDDEN(__init_array_start = .);
|
||||||
KEEP(*(.init_array .ctors))
|
KEEP(*(.init_array .ctors))
|
||||||
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
|
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
}
|
} :rodata
|
||||||
|
|
||||||
.fini_array :
|
.fini_array ALIGN(CONSTANT(MAXPAGESIZE)) : AT(ADDR(.fini_array) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
PROVIDE_HIDDEN(__fini_array_start = .);
|
PROVIDE_HIDDEN(__fini_array_start = .);
|
||||||
KEEP(*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
|
KEEP(*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
|
||||||
KEEP(*(.fini_array .dtors))
|
KEEP(*(.fini_array .dtors))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
}
|
} :rodata
|
||||||
. += CONSTANT(MAXPAGESIZE);
|
_kernel_rodata_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
|
||||||
.bss :
|
_kernel_bss_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
.bss ALIGN(CONSTANT(MAXPAGESIZE)) : AT(ADDR(.bss) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
*(.bss .bss.*)
|
*(.bss .bss.*)
|
||||||
}
|
} :bss
|
||||||
. += CONSTANT(MAXPAGESIZE);
|
_kernel_bss_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
_kernel_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
_kernel_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
|
||||||
/DISCARD/ :
|
/DISCARD/ :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user