Initial import of OsmocomBB into git repository
[osmocom-bb.git] / src / target / firmware / board / common / compal_ramload.lds
1 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
2 OUTPUT_ARCH(arm)
3 ENTRY(_start)
4 MEMORY
5 {
6         /* area that can be initialized by the loader (plus some reserved stuff) */
7         LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00010000
8         /* remainder of internal ram, can be used for bss and the like */
9         IRAM (rw) : ORIGIN = 0x00810000, LENGTH = 0x00030000
10         /* external ram on a C123 */
11         ERAM (rw) : ORIGIN = 0x01000000, LENGTH = 0x00040000
12 }
13 SECTIONS
14 {
15         . = 0x800000;
16
17         /* reserved (what is in here?) */
18         .compal.reserved1 (NOLOAD) : { . = 0x100; } > LRAM
19
20         /* XXX: leftovers from exception vector trickery development? */
21         /* .compal.reserved1 (NOLOAD) : { . = 0x1C; } > LRAM */
22         /* .compal.reserved2 (NOLOAD) : { . = 0xC8; } > LRAM */
23
24         /* image signature (prepended by compal_dnload according to phone type) */
25         .compal.header (NOLOAD) : { . = 4; } > LRAM
26
27         /* code */
28         . = ALIGN(4);
29         .text_start : {
30                 /* initialization code */
31                 PROVIDE(_start = .);
32                 KEEP(*(.init))
33                 *(.text._start)
34                 _exceptions = .;
35         } > LRAM
36
37         /* exception vectors from 0x80001c to 0x800034 */
38         .text.exceptions 0x80001c: AT (LOADADDR(.text_start) + SIZEOF(.text_start)) {
39                 KEEP(*(.text.exceptions))
40                 * (.text.exceptions)
41                 . = ALIGN(4);
42         } > LRAM
43
44         /* code */
45         . = ALIGN(4);
46         .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) :
47               AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) {
48                 /* regular code */
49                 *(.text*)
50         } > LRAM
51
52         /* read-only data */
53         . = ALIGN(4);
54         .rodata : {
55                 *(.rodata) 
56         } > LRAM
57
58         /* initialized data */
59         . = ALIGN(4);
60                 .data : {
61                 *(.data)
62         } > LRAM
63
64         /* pic offset tables */
65         . = ALIGN(4);
66         .got : {
67                 *(.got) 
68         } > LRAM
69
70         /* uninitialized data */
71         .bss (NOLOAD) : {
72                 . = ALIGN(4);
73                 __bss_start = .;
74                 *(.bss) 
75         } > IRAM
76         . = ALIGN(4);
77         __bss_end = .;
78
79         /* end of image */
80         . = ALIGN(4);
81         _end = .;
82         PROVIDE(end = .);
83 }