Add higher half support in linker script
This commit is contained in:
parent
b6d7e5d5c4
commit
a7f28c50e1
1 changed files with 28 additions and 6 deletions
32
link.ld
32
link.ld
|
@ -1,23 +1,45 @@
|
||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
|
|
||||||
|
KERNEL_ADDR_OFFSET = 0xC0000000;
|
||||||
|
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
. = 1M;
|
. = 1M;
|
||||||
|
KERNEL_PHYSADDR_START = .;
|
||||||
|
|
||||||
.text : ALIGN(4K) {
|
.rodata.boot : {
|
||||||
KEEP(*(.multiboot))
|
*(.rodata.boot)
|
||||||
|
}
|
||||||
|
|
||||||
|
.text.boot : {
|
||||||
|
*(.text.boot)
|
||||||
|
}
|
||||||
|
|
||||||
|
. = KERNEL_ADDR_OFFSET;
|
||||||
|
KERNEL_VADDR_START = .;
|
||||||
|
|
||||||
|
.text ALIGN(4K) : AT (ADDR(.text) - KERNEL_ADDR_OFFSET) {
|
||||||
*(.text)
|
*(.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
.rodata : ALIGN(4K) {
|
.rodata ALIGN(4K) : AT (ADDR(.rodata) - KERNEL_ADDR_OFFSET) {
|
||||||
*(.rodata)
|
*(.rodata)
|
||||||
}
|
}
|
||||||
|
|
||||||
.data : ALIGN(4K) {
|
.data ALIGN(4K) : AT (ADDR(.data) - KERNEL_ADDR_OFFSET) {
|
||||||
*(.data)
|
*(.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss : ALIGN(4K) {
|
.bss ALIGN(4K) : AT (ADDR(.bss) - KERNEL_ADDR_OFFSET) {
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
*(.bss)
|
*(.bss)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bss.stack ALIGN(4K) : AT (ADDR(.bss.stack) - KERNEL_ADDR_OFFSET) {
|
||||||
|
*(.bss.stack)
|
||||||
|
KERNEL_STACK_END = .;
|
||||||
|
}
|
||||||
|
|
||||||
|
KERNEL_VADDR_END = .;
|
||||||
|
KERNEL_PHYSADDR_END = . - KERNEL_ADDR_OFFSET;
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue