aboutsummaryrefslogtreecommitdiff
path: root/linker.ld
blob: 0cbd1fb43ac8413f98e51846bb2ce1cdd6204b89 (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
ENTRY(_start)
 
SECTIONS
{
    /* Starts at LOADER_ADDR. */
    /* Warning! Internet says RPis in 32-bit mode load kernel at 0x8000! */
    /* My experiments do, however, show, that qemu emulating RPi2 */
    /* Loads the kernel at 0x10000! (took some pain to find out) */
    . = 0x10000;
    /* For AArch64, use . = 0x80000; Unless this too is wrong */
    __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;
    __end = .;
}