-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathfiwix.ld
57 lines (48 loc) · 885 Bytes
/
fiwix.ld
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Linker script for the Fiwix kernel.
*
* Copyright 2018, Jordi Sanfeliu. All rights reserved.
* Distributed under the terms of the Fiwix License.
*/
#include <fiwix/linker.h>
OUTPUT_FORMAT("elf32-i386")
OUTPUT_ARCH("i386")
ENTRY(_start) /* entry point */
vaddr = PAGE_OFFSET; /* virtual start address */
paddr = KERNEL_ADDR; /* physical address at 1MB */
/* define output sections */
SECTIONS
{
. = paddr;
/* kernel setup code */
.setup ALIGN(4096) :
{
*(.setup)
}
. += vaddr;
/* kernel code */
.text : AT(ADDR(.text) - vaddr)
{
*(.text)
}
_etext = .;
/* initialized data */
.data ALIGN(4096) : AT(ADDR(.data) - vaddr)
{
*(.data)
*(.rodata*)
}
_edata = .;
/* uninitialized data */
.bss ALIGN(4096) : AT(ADDR(.bss) - vaddr)
{
*(COMMON*)
*(.bss*)
}
_end = .;
/* remove information not needed */
/DISCARD/ :
{
*(.eh_frame)
}
}