summaryrefslogtreecommitdiff
path: root/src/user_bootstrap/linker.ld
blob: 917388c1594eced38f5d3d6e0f05501fa0bbb41e (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
ENTRY(main)
OUTPUT_FORMAT("binary")

SECTIONS
{
	/* Not an ELF, but we need this to link with elfreloc.c.
	 * Not that we need to link with it, it's just easier that way */
	_DYNAMIC = 0;
	_image_base = 0;

	. = 2M;
	.text BLOCK(4K) : ALIGN(4K)
	{
		*(.text.startup)
		*(.text)
	}
	.rodata BLOCK(4K) : ALIGN(4K)
	{
		*(.rodata)
	}
	.data BLOCK(4K) : ALIGN(4K)
	{
		*(.data)
	}

	. = ALIGN(32); /* seems to be necessary? */
	_initrd = .; /* is just appended onto the end of the binary */
	. += 2M;

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