forked from DragonMinded/libdragon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dso.ld
84 lines (74 loc) · 1.83 KB
/
dso.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
72
73
74
75
76
77
78
79
80
81
82
83
84
SECTIONS {
/* Write text section */
.text : {
*(.text)
*(.text.*)
*(.init)
*(.fini)
*(.gnu.linkonce.t.*)
}
.eh_frame_hdr : { *(.eh_frame_hdr) }
/* Write exception frames which must be 4-byte aligned to satisfy MIPS requirements */
.eh_frame ALIGN(4) : {
__EH_FRAME_BEGIN__ = .; /* Define symbol for accessing eh_frame section */
KEEP (*(.eh_frame))
/* Add terminator to section */
LONG(0);
}
.gcc_except_table : { *(.gcc_except_table*) }
/* Write read-only data */
.rodata : {
*(.rdata)
*(.rodata)
*(.rodata.*)
*(.gnu.linkonce.r.*)
}
/* Write constructors and destructors which each must be 4-byte aligned */
.ctors ALIGN(4) : {
LONG(0); /* Add terminator to CTOR list */
KEEP(*(.ctors))
KEEP(*(SORT(.ctors.*)))
__CTOR_LIST__ = .-4; /* Define symbol for CTOR list */
}
.dtors ALIGN(4) : {
__DTOR_LIST__ = .; /* Define symbol for DTOR list */
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
LONG(0); /* Add terminator to DTOR list */
}
/* Write data sections */
.data : {
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
}
.sdata : {
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
/* Define 4 bytes of space for __dso_handle */
. = ALIGN(4);
__dso_handle = .;
LONG(0);
}
.lit8 : {
*(.lit8)
}
.lit4 : {
*(.lit4)
}
/* Write bss sections */
.sbss (NOLOAD) : {
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
*(.scommon.*)
}
.bss (NOLOAD) : {
*(.bss)
*(.bss*)
*(.gnu.linkonce.b.*)
*(COMMON)
}
}