-
Notifications
You must be signed in to change notification settings - Fork 5
/
otg_stage2.ld
46 lines (39 loc) · 906 Bytes
/
otg_stage2.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
OUTPUT_FORMAT(binary)
ENTRY(S2Entrypoint)
SECTIONS {
. = 0x08000000 - 8;
.header . : {
*(.header)
*(.textstart)
}
ASSERT(ADDR(.header) == 0x07FFFFF8, "header VMA")
ASSERT(SIZEOF(.header) == 0x00000020, "header size")
. = 0x08000018;
.text . : ALIGN(4) SUBALIGN(4) {
*(.textasm)
*(.text)
*(.data)
*(.bss)
*(.rodata)
*(.rodata.*)
}
.crc : ALIGN(4) SUBALIGN(4) {
*(.crc)
}
ASSERT(S2Entrypoint == 0x08000000, "S2Entrypoint")
ASSERT(S2Entrypoint2 == 0x08000018, "S2Entrypoint2")
ASSERT(SIZEOF(.crc) == 4, "CRC size")
S2SizeInBytes = ADDR(.crc) + SIZEOF(.crc) - 0x08000000;
S2StackTop = 0x08007000;
/* lld doesn't support --orphan-sections=discard, ugh. */
/DISCARD/ : {
*(.comment)
*(.note.GNU-stack)
*(.eh_frame)
*(.MIPS.abiflags)
*(.reginfo)
*(.got)
*(.mdebug.abi32)
*(.pdr)
}
}