-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlinkscript
33 lines (28 loc) · 830 Bytes
/
linkscript
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
/* Linker script for kernel */
/* Define the kernel entry point. Needed to prevent ld's -gc-sections option
* getting rid of everything
*/
ENTRY(_start)
/* Define the memory as starting at 0x8000, and being a megabyte long
* (shouldn't need to be more than this)
*/
MEMORY
{
kernel : org = 0x8000, len = 1M
}
/* Output kernel code (.text) and data (.bss) into kernel address space
*
* Make sure start.o comes first, so the entry point is at the start of the
* file
*
* Puts .bss in the middle to force the final binary kernel to contain it;
* this means it will be set to 0 rather than left to whatever is in the
* memory beforehand. This isn't very efficient.
*/
SECTIONS
{
.text : { start.o(.text) *(.text*) } >kernel
.bss : { *(.bss) } >kernel
.data : { *(.data) } >kernel
end = .; _end = .; __end = .;
}