refactor(kernel.ld): adjust comments
This commit is contained in:
28
kernel.ld
28
kernel.ld
@@ -1,29 +1,35 @@
|
|||||||
/*
|
/**
|
||||||
* This is the entry point
|
* This is the entry point
|
||||||
* `boot` should be a defined label
|
* `boot` should be a defined label
|
||||||
*/
|
*/
|
||||||
ENTRY(boot)
|
ENTRY(boot)
|
||||||
|
|
||||||
/* SECTIONS tells to linker how to arrange sections inside the memory */
|
/**
|
||||||
|
* SECTIONS tells to linker how to arrange sections inside the memory
|
||||||
|
*/
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
/*
|
/**
|
||||||
* This is the base address (start address of the kernel)
|
* This is the base address (start address of the kernel)
|
||||||
* OpenSBI takes little ram
|
* OpenSBI takes little ram
|
||||||
*/
|
*/
|
||||||
. = 0x80200000;
|
. = 0x80200000;
|
||||||
|
|
||||||
/* This section contains the code of the program */
|
/**
|
||||||
|
* This section contains the code of the program
|
||||||
|
*/
|
||||||
.text :{
|
.text :{
|
||||||
/*
|
/**
|
||||||
* Take the .text.boot before everything
|
* Take the .text.boot before everything
|
||||||
* KEEP() prevents the linker to mark it as "unused"
|
* KEEP() prevents the linker to mark it as "unused"
|
||||||
*/
|
*/
|
||||||
KEEP(*(.text.boot));
|
KEEP(*(.text.boot));
|
||||||
/* Include everything else inside the .text section */
|
/**
|
||||||
|
* Include everything else inside the .text section
|
||||||
|
*/
|
||||||
*(.text .text.*);
|
*(.text .text.*);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Contains constant read-only data
|
* Contains constant read-only data
|
||||||
* Align the start of the section at 4 byte
|
* Align the start of the section at 4 byte
|
||||||
*/
|
*/
|
||||||
@@ -31,12 +37,16 @@ SECTIONS {
|
|||||||
*(.rodata .rodata.*);
|
*(.rodata .rodata.*);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Contains read/write data */
|
/**
|
||||||
|
* Contains read/write data
|
||||||
|
*/
|
||||||
.data : ALIGN(4) {
|
.data : ALIGN(4) {
|
||||||
*(.data .data.*);
|
*(.data .data.*);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Contains read/data with an initial value of zero */
|
/**
|
||||||
|
* Contains read/data with an initial value of zero
|
||||||
|
*/
|
||||||
.bss : ALIGN(4) {
|
.bss : ALIGN(4) {
|
||||||
__bss = .;
|
__bss = .;
|
||||||
*(.bss .bss.* .sbss .sbss.*);
|
*(.bss .bss.* .sbss .sbss.*);
|
||||||
|
|||||||
Reference in New Issue
Block a user