comparison nuc-fw/finlink/xram.lds @ 80:39b1c369b67f

nuc-fw: links to an ELF image
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 16 Aug 2013 02:25:58 +0000
parents
children dd13211c9f10
comparison
equal deleted inserted replaced
79:947b1f473960 80:39b1c369b67f
1 /*
2 * This linker script is used when building the ramImage version of
3 * FreeCalypso firmware: the version which is to be test-run via fc-xram
4 * without touching the flash. Everything is loaded into IRAM or XRAM,
5 * and in this ld script we pretend as if the actual flash memory
6 * does not exist.
7 */
8
9 ENTRY(_FlashorXram_entry)
10
11 MEMORY {
12 IRAM : ORIGIN = 0x00800000, LENGTH = 512K
13 XRAM : ORIGIN = 0x01000000, LENGTH = 8M
14 }
15
16 SECTIONS {
17 /* XIP code, using XRAM to emulate flash */
18 xip.text : {
19 *(xip.text*)
20 xipcode.o(.text*)
21 *libplus.xip.a:(.text*)
22 *libsprintf.a:(.text*)
23 } > XRAM
24
25 /* copy-to-IRAM code */
26 iram.text 0x80001C : {
27 /* the 7 exception and interrupt vectors @ 0x80001C */
28 *(iram.vectors)
29 *(iram.text*)
30 iramcode.o(.text*)
31 *libplus.iram.a:(.text*)
32 *libc.a:(.text*)
33 *libgcc.a:(.text*)
34 } > IRAM AT> XRAM
35 __iramtext_ram_addr = ADDR(iram.text);
36 __iramtext_flash_addr = LOADADDR(iram.text);
37 __iramtext_size = SIZEOF(iram.text);
38
39 /* all .rodata will stay in flash */
40 .rodata : {
41 *(.rodata*)
42 } > XRAM
43
44 /* all .data will go into XRAM */
45 .data : {
46 *(.data*)
47 } > XRAM
48
49 /* we have two kinds of BSS: internal and external */
50 int.bss (NOLOAD) : {
51 *(int.bss*)
52 iramcode.o(.bss* COMMON)
53 *libplus.iram.a:(.bss* COMMON)
54 *libc.a:(.bss* COMMON)
55 *libgcc.a:(.bss* COMMON)
56 . = ALIGN(4);
57 } > IRAM
58 __intbss_start = ADDR(int.bss);
59 __intbss_size = SIZEOF(int.bss);
60
61 ext.bss (NOLOAD) : {
62 *(ext.bss*)
63 xipcode.o(.bss* COMMON)
64 *libplus.xip.a:(.bss* COMMON)
65 *libsprintf.a:(.bss* COMMON)
66 . = ALIGN(4);
67 } > XRAM
68 __extbss_start = ADDR(ext.bss);
69 __extbss_size = SIZEOF(ext.bss);
70
71 /* finally, we have "raw RAM": like BSS, but we don't zero it out */
72 int.ram (NOLOAD) : {
73 *(int.ram*)
74 *(system_stack)
75 *(irq_stack)
76 *(fiq_stack)
77 *(timer_hisr_stack)
78 . = ALIGN(4);
79 _iram_end = .;
80 } > IRAM
81
82 ext.ram (NOLOAD) : {
83 *(ext.ram*)
84 . = ALIGN(4);
85 _xram_end = .;
86 } > XRAM
87 }