-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinker.ld
71 lines (60 loc) · 1.13 KB
/
linker.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
OUTPUT_FORMAT("binary");
ENTRY(_start);
SECTIONS
{
_core_begin = 0x00100000;
. = 0x0;
.bootloader 0x7C00 : AT(0x0)
{
*bootloader.s.o(.text);
*.s.o(.text);
}
_bootloader_last_opcode = (. + 0x7C00 - 0x2);
.bootloader_data :
{
*bootloader.s.o(.data);
*.s.o(.data);
}
.sig : AT(0x1FE)
{
SHORT(0xAA55);
}
. = 0x0200;
.text _core_begin : AT(0x0200)
{
_text = .;
*(.text.main);
*(.text);
_text_end = .;
}
.data :
{
_data = .;
*(.bss);
*(.bss*);
*(.data);
*(.rodata*);
*(COMMON);
*(.eh_frame);
_data_end = .;
}
_core_size = _data_end - _text;
_core_size_sectors = (_core_size / 512) + 1;
_core_size_int = (_core_size / 4) + 1;
. = _data_end == . ? . + 1 : .;
. = ALIGN(0x200);
. -= 1;
.align :
{
BYTE(0x0);
}
/DISCARD/ :
{
*(.note*);
*(.iplt*);
*(.igot*);
*(.rel*);
*(.comment);
*(.debug*);
}
}