-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.ld
43 lines (32 loc) · 836 Bytes
/
script.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
SECTIONS {
.text : {
/* I want the contents of crt0 to appear at the beginning of the
binary, regardless of where it appears in the list of files given
on the command line. I could use STARTUP for this, but I want to
leave crt0.o as a dependency in the Makefile, so rather than
figure out how to tell make to not pass `crt0.o` to the linker,
I'll do this instead. */
crt0.o (.text);
/* With e.g. -O2 GCC puts main in ".text.startup". It's convenient
to have main near the beginning of the binary, hence this. */
* (.text.startup);
* (.text);
}
.data : {
* (.rodata*);
}
__global_pointer$ = . + 0x800;
.sdata : {
* (.sdata);
}
.sbss : {
* (.sbss);
}
.bss : {
* (.bss);
}
.text.isr 0x2000 : {
* (.text.isr);
}
/DISCARD/ : { * (*); }
}