-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathuser.ld
40 lines (38 loc) · 933 Bytes
/
user.ld
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
/*
* This file specifies locations in the virtual address space where the final
* sections will be located.
*
* On startup, QEMU loads the code at the physical address, 0x4001000. However,
* the exact address should not matter. startup.s is position-independent, and
* maps the code to the addresses specified by the linker symbols defined here.
*/
ENTRY(_start)
SECTIONS {
. = 0x40000000;
code_start = .;
.startup . : {
user/startup.o(*)
}
.text . : {
*(.text)
}
code_end = .;
data_start = .;
.rodata . : {
*(.rodata)
}
.data . : {
*(.data)
/* Include the bss into the .data section because otherwise, it
* will be left out of the .bin image. If that happens, we can
* incorrectly allocate space for the stack and image, which
* will be bad news */
*(.bss)
}
data_end = .;
/* Kernel mode stack */
. = ALIGN(8);
stack_start = .;
. = . + 0x1000; /* 4kB stack memory */
stack_end = .;
}