-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.ld
More file actions
49 lines (41 loc) · 803 Bytes
/
link.ld
File metadata and controls
49 lines (41 loc) · 803 Bytes
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
/*
Linker script for the kernel
Ensures everything goes in the correct place
Tells LD how to setup our kernel image. Tells it,
. start location should by the symbol 'start'
. text section (where all our code goes) should be first and start at 0x100000
. data (initialised static data) and bss (uninitialised static data) should be next and each page-aligned
. rodata (read only initialized data) bundled with data
*/
ENTRY( start )
SECTIONS
{
.text 0x100000 :
{
code = .;
_code = .;
__code = .;
*( .text )
. = ALIGN( 4096 );
}
.data :
{
data = .;
_data = .;
__data = .;
*( .data )
*( .rodata )
. = ALIGN( 4096 );
}
.bss :
{
bss = .;
_bss = .;
__bss = .;
*( .bss )
. = ALIGN( 4096 );
}
end = .;
_end = .;
__end = .;
}