summaryrefslogtreecommitdiff
path: root/utils/mks5lboot/dualboot/dualboot.lds
diff options
context:
space:
mode:
Diffstat (limited to 'utils/mks5lboot/dualboot/dualboot.lds')
-rw-r--r--utils/mks5lboot/dualboot/dualboot.lds59
1 files changed, 59 insertions, 0 deletions
diff --git a/utils/mks5lboot/dualboot/dualboot.lds b/utils/mks5lboot/dualboot/dualboot.lds
new file mode 100644
index 0000000000..cb92e2a286
--- /dev/null
+++ b/utils/mks5lboot/dualboot/dualboot.lds
@@ -0,0 +1,59 @@
1#define ASM
2#include "config.h"
3#include "cpu.h"
4#include "mks5lboot.h"
5
6ENTRY(_start)
7OUTPUT_FORMAT(elf32-littlearm)
8OUTPUT_ARCH(arm)
9
10#define BIN_ORIG DFU_LOADADDR + BIN_OFFSET
11#define BIN_SIZE MAX_PAYLOAD
12
13MEMORY
14{
15 IRAM : ORIGIN = BIN_ORIG, LENGTH = BIN_SIZE
16}
17
18SECTIONS
19{
20 .text : {
21 *(.init.text*)
22 *(.text*)
23 *(.icode*)
24 . = ALIGN(4);
25 } > IRAM
26
27 /* include initialized BSS (if any) into DFU image */
28 .bss : {
29 *(.bss*)
30 *(.ibss*)
31 *(COMMON)
32 . = ALIGN(4);
33 } > IRAM
34
35#if 1
36 /* reuse pwnage as stack, 0x30c bytes available */
37 _exception_stack = BIN_ORIG;
38 _supervisor_stack = _exception_stack;
39#else
40 /* include stack into DFU image */
41 .stack : {
42 . += 0x400;
43 _supervisor_stack = .;
44 . += 0x200;
45 _exception_stack = .;
46 } > IRAM
47#endif
48
49 .data : {
50 *(.data*)
51 *(.rodata*)
52 *(.idata*)
53 *(.irodata*)
54 /* place bootloader IM3 header at the end, mkdfu
55 will concatenate the bootloader binary here */
56 . = ALIGN(16);
57 *(.im3info.data*)
58 } > IRAM
59}