Skip to content

Commit e20f996

Browse files
Update link.ld with stack, heap, and memory layout improvements.
1 parent cc96510 commit e20f996

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

link.ld

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ SECTIONS
66

77
.multiboot : ALIGN(4K)
88
{
9-
*(.multiboot)
9+
KEEP(*(.multiboot))
1010
}
1111

1212
.text : ALIGN(4K)
1313
{
1414
*(.text*)
1515
}
1616

17+
__ro_start = .;
1718
.rodata : ALIGN(4K)
1819
{
1920
*(.rodata*)
2021
}
22+
__ro_end = .;
2123

2224
.data : ALIGN(4K)
2325
{
@@ -26,7 +28,26 @@ SECTIONS
2628

2729
.bss : ALIGN(4K)
2830
{
31+
_bss_start = .;
2932
*(COMMON)
3033
*(.bss*)
34+
_bss_end = .;
3135
}
36+
37+
.stack : ALIGN(16)
38+
{
39+
_stack_start = .;
40+
. = . + 0x4000;
41+
_stack_end = .;
42+
}
43+
44+
.heap : ALIGN(16)
45+
{
46+
_heap_start = .;
47+
. = . + 0x100000;
48+
_heap_end = .;
49+
}
50+
51+
_end = .;
52+
_kernel_end = .;
3253
}

0 commit comments

Comments
 (0)