summaryrefslogtreecommitdiff
path: root/link.ld
blob: 49cdbe01abc31d46da48334b3cfceee3e1fc14d4 (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
ENTRY(_start)

MEMORY {
    RAM (rwx) : ORIGIN = 0x80000000, LENGTH = 16M
}

SECTIONS {
    .text : ALIGN(4) {
        *(.text*)
    } > RAM

    .rodata : ALIGN(8) {
        *(.rodata*)
    } > RAM

    .data : ALIGN(8) {
        _data_start = .;
        *(.data*)
        _data_end = .;
    } > RAM

    .bss : ALIGN(8) {
        _bss_start = .;
        *(.bss*)
        *(COMMON)
        _bss_end = .;
    } > RAM

    .sdata : ALIGN(8) {
        _sdata_start = .;
        *(.sdata*)
        _sdata_end = .;
    } > RAM

    .sbss : ALIGN(8) {
        _sbss_start = .;
        *(.sbss*)
        _sbss_end = .;
    } > RAM

    __global_pointer$ = _sdata_start + ((_sdata_end - _sdata_start + _sbss_end - _sbss_start) / 2);

    _heap_start = ALIGN(8);

    _stack_top = ORIGIN(RAM) + LENGTH(RAM);
}