BIOS: hello world
[litex.git] / software / bios / linker.ld
1 OUTPUT_FORMAT("elf32-lm32")
2 ENTRY(_start)
3
4 __DYNAMIC = 0;
5
6 MEMORY {
7 flash : ORIGIN = 0x00860000, LENGTH = 0x20000 /* 128K */
8 sram : ORIGIN = 0x10000000, LENGTH = 0x01000 /* 4K */
9 }
10
11 SECTIONS
12 {
13 .text :
14 {
15 _ftext = .;
16 *(.text .stub .text.* .gnu.linkonce.t.*)
17 _etext = .;
18 } > flash
19
20 .rodata :
21 {
22 . = ALIGN(4);
23 _frodata = .;
24 *(.rodata .rodata.* .gnu.linkonce.r.*)
25 *(.rodata1)
26 _erodata = .;
27 } > flash
28
29 /* We shouldn't have a .data section, but the GNU crapchain whines if we don't */
30 .data :
31 {
32 . = ALIGN(4);
33 _fdata = .;
34 *(.data .data.* .gnu.linkonce.d.*)
35 *(.data1)
36 _gp = ALIGN(16);
37 *(.sdata .sdata.* .gnu.linkonce.s.*)
38 _edata = .;
39 } > flash
40
41 .bss :
42 {
43 . = ALIGN(4);
44 _fbss = .;
45 *(.dynsbss)
46 *(.sbss .sbss.* .gnu.linkonce.sb.*)
47 *(.scommon)
48 *(.dynbss)
49 *(.bss .bss.* .gnu.linkonce.b.*)
50 *(COMMON)
51 . = ALIGN(4);
52 _ebss = .;
53 _end = .;
54 } > sram
55 }
56
57 PROVIDE(_fstack = ORIGIN(sram) + LENGTH(sram) - 4);