summaryrefslogtreecommitdiff
path: root/gdb/linker.cfg
blob: 053323b9d4a3a503b9729030d9eafcdc5b1d8279 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "config.h"

#ifdef CPU_ARM
ENTRY(start)
STARTUP(crt0.o)
OUTPUT_FORMAT(elf32-littlearm)
#else
#error "Unsupported CPU!"
#endif

#ifdef EXAMPLE
MEMORY
{
   IRAM : ORIGIN = 0, LENGTH = 0x10000
   DRAM : ORIGIN = 0xc00000, LENGTH = 0x6000
   DRAM_API : ORIGIN = 0xc06000, LENGTH = 0x100
}

SECTIONS
{
    .text :
    {
	*(.init*)
        *(.text)
        *(.text*)
	*(.rodata)
	*(.rodata*)
        *(.glue_7)
        *(.glue_7t)
    } >DRAM

    .gdbapi :
    {
        *(.gdbapi)
    } >DRAM_API

    .data :
    {
        *(.data)
    } >DRAM

    .vectors :
    {
	_vectorsstart = .;
        *(.vectors)
        _vectorsend = .;
    } >IRAM AT>DRAM
    _vectorscopy = LOADADDR(.vectors);

    .stack (NOLOAD) :
    {
	stackbegin = .;
        . += 0x400;
	_stub_stack = .;
	. += 0x200;
        stackend = .;
    } >DRAM

    .bss (NOLOAD) :
    {
        _edata = .;
	*(.bss)
        _end = .;
    } >DRAM
}
#else

SECTIONS
{
    .vectors 0x09000000 :
    {
        *(.vectors);
        . = ALIGN(0x200);
        start.o(.text)
        *(.rodata)
    }

    .text :
    {
        *(.text)
    }

    .bss :
    {
       _stack = . + 0x1000;
       _stub_stack = _stack + 0x1000;
    }

    .pad 0x0900C800 :
    {
        LONG(0);
    }
}

#endif