-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinker.ld
More file actions
36 lines (30 loc) · 955 Bytes
/
linker.ld
File metadata and controls
36 lines (30 loc) · 955 Bytes
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(loader) /*entery point of the program*/
OUTPUT_FORMAT(elf32-i386) /*32bit ELF type executable*/
OUTPUT_ARCH(i386:i386) /*32bit output*/
SECTIONS
{
. =0x0100000; /*defines the output pointer to 0x100000 aka" . " = = 0x0100000*/
.text : /*code of the program goes here*/
{
*(.multiboot)
*(.text*)
*(.rodata)
}
.data :
{
start_ctors = .; /*allow initaisation of global variables, Pointer of where it starts (this is known to other .o files)*/
KEEP(*(.init_array )); /*data constructors*/
KEEP(*(SORT_BY_INIT_PRIORITY( .init_array.* ))); /*data constructors*/
end_ctors = .; /*end seting of global variables, Pointer of where it ends (this is known to other .o files)*/
*(.data)
}
.bss :
{
*(.bss)
}
/DISCARD/ :
{
*(.fini_array*)
*(.comment) /*tell it to ignore comments*/
}
}