summaryrefslogtreecommitdiff
path: root/src/user/bootstrap/linker.ld
blob: 34d8101da863c56d50fffe40fd0bace1b2e84cd4 (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
ENTRY(_start)
OUTPUT_FORMAT("binary")

SECTIONS
{
	. = 0x20000;
	_bss_start = .;
	.bss BLOCK(4K) : ALIGN(4K)
	{
		*(COMMON)
		*(.bss)
	}
	_bss_end = .;

	. = 2M;
	.text BLOCK(4K) : ALIGN(4K)
	{
		/* the assert needs to be inside of a section or it'll be a syntax error */
		ASSERT(_bss_end <= 2M, "bss too big, needs to be moved down");
		*(.text.startup)
		*(.text)
	}
	.rodata BLOCK(4K) : ALIGN(4K)
	{
		*(.rodata)
	}
	.data BLOCK(4K) : ALIGN(4K)
	{
		*(.data)
	}
	_initrd = .; /* is just appended onto the end of the binary */

	/DISCARD/ : {
		*(*.rel.*)
	}
}