blob: 387e7c78da8ff3fe179ee8859dc060667dda5a0d (
plain)
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
73
74
75
76
77
78
79
80
|
ENTRY(_start) /* defined in boot.S */
SECTIONS
{
/* Starts at 0x8000 - that's where RPis in 32-bit mode load kernel at. */
/* My experiments do, however, show, that qemu emulating RPi2 */
/* loads the kernel at 0x10000! (took some pain to find out). */
/* rpi-open-firmware, on the other hand, loads kernel at 0x2000000! */
/* This is not really a problem, since: */
/* 1. We can use out bootloader to load the kernel at 0x8000 */
/* 2. We compile kernel with -fPIC, so it should be able to work with */
/* any load addr.
/* 3. In qemu, we can load kernel.elf instead of raw binary */
/* (qemu will do the loading then) */
. = 0x8000;
/* For AArch64, use . = 0x80000 */
__start = .;
__text_start = .;
.text :
{
KEEP(*(.text.boot))
*(.text)
}
. = ALIGN(4096); /* align to page size */
__text_end = .;
__rodata_start = .;
.rodata :
{
*(.rodata)
}
. = ALIGN(4096); /* align to page size */
__rodata_end = .;
__data_start = .;
.data :
{
*(.data)
}
. = ALIGN(4096); /* align to page size */
__data_end = .;
__bss_start = .;
.bss :
{
bss = .;
*(.bss)
}
. = ALIGN(4096); /* align to page size */
__bss_end = .;
__bss_size = __bss_end - __bss_start;
/* libkernel */
.libkernel :
{
__libkernel_start = .;
libkernel.o
__libkernel_end = .;
}
__libkernel_size = __libkernel_end - __libkernel_start;
. = ALIGN(4096); /* align to page size */
__interrupt_vectors_start = .;
.interrupt_vectors :
{
interrupt_vectors = .;
*(.interrupt_vectors.text)
*(.interrupt_vectors.data)
}
. = ALIGN(4096); /* align to page size */
__interrupt_vectors_end = .;
__interrupt_vectors_size = __interrupt_vectors_end - __interrupt_vectors_start;
__end = .;
}
|