summaryrefslogtreecommitdiff
path: root/bootrom/common/bram.ld
blob: 45df67fe0bd050a5dd3990dd3b265604302058a2 (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
OUTPUT_ARCH("riscv")
ENTRY(_start)

MEMORY
{
	rom (rx) : ORIGIN = 0x00001000, LENGTH = 4K
	ram (rwx) : ORIGIN = 0x80000000, LENGTH = 256M
}

SECTIONS
{
	PROVIDE(_rom = ORIGIN(rom));
	PROVIDE(_rom_end = _rom + LENGTH(rom));
	PROVIDE(_ram = ORIGIN(ram));
	PROVIDE(_ram_end = _ram + LENGTH(ram));

	.text : {
		PROVIDE(_ftext = .);
		*(.text.init)
		*(.text .text.* .gnu.linkonce.t.*)
		PROVIDE(_etext = .);
	} > rom

	.rodata : {
		*(.rodata .rodata.* .gnu.linkonce.r.*)
	} > rom

	.bss : ALIGN(8) {
		PROVIDE(_fbss = .);
		*(.bss .bss.* .gnu.linkonce.b.*)
		*(.sbss .sbss.* .gnu.linkonce.sb.*)
		. = ALIGN(8);
		PROVIDE(_ebss = .);
	} > ram

	. += 0x1000;
	PROVIDE(_sp = NEXT(0x1000));

	PROVIDE(_end = .);
}