-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinker.ld
More file actions
72 lines (62 loc) · 1.27 KB
/
linker.ld
File metadata and controls
72 lines (62 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* UOS Linker Script
* Memory layout for ARM kernel
* Copyright 2075-2077 RobCo Industries
*/
/* Entry point */
ENTRY(_start)
/* Memory regions */
MEMORY
{
/* Kernel loads at 1MB (0x100000) */
ram : ORIGIN = 0x00100000, LENGTH = 0x00F00000
}
SECTIONS
{
/* Kernel code section */
.text : {
KEEP(*(.text.boot))
*(.text .text.*)
. = ALIGN(4096);
} > ram
/* Read-only data */
.rodata : {
*(.rodata .rodata.*)
. = ALIGN(4096);
} > ram
/* Initialized data */
.data : {
*(.data .data.*)
. = ALIGN(4096);
} > ram
/* Uninitialized data */
.bss : {
__bss_start = .;
*(.bss .bss.*)
*(COMMON)
__bss_end = .;
. = ALIGN(4096);
} > ram
/* Stack (grows downward) */
.stack : {
. = ALIGN(4096);
__stack_start = .;
. += 0x8000; /* 32KB stack */
__stack_end = .;
} > ram
/* Heap (grows upward) */
.heap : {
. = ALIGN(4096);
__heap_start = .;
/* Heap extends to end of RAM */
} > ram
/* Symbol table (debugging) */
__kernel_end = .;
/* Discard sections */
/DISCARD/ : {
*(.comment)
*(.gnu*)
*(.note*)
*(.eh_frame*)
}
}