annotate nuc-fw/finlink/xram.lds @ 82:dd13211c9f10

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