1 # In microcomputer (MC) mode, the vectors are mapped into the on-chip ROM,
2 # otherwise in microprocessor (MP) mode the vectors are mapped to address 0
3 # on the external bus. In MC mode, the on-chip ROM contains a bootloader program
4 # that loads the internal RAM from the serial port or external ROM.
6 # Common configurations:
7 # 1. MC mode, no external memory (serial boot).
8 # 2. MC mode, external RAM (serial boot).
9 # 3. MC mode, external ROM.
10 # 4. MC mode, external ROM, external RAM.
11 # 5. MP mode, external ROM.
12 # 6. MP mode, external ROM, external RAM.
13 # 7. MP mode, external RAM (dual-port with hosting CPU or external debugger).
15 # Config TEXT DATA/BSS
16 # 1. INT_RAM INT_RAM (mcmode,onchip)
17 # 2. EXT_RAM EXT_RAM (mcmode,extram)
18 # 3. INT_RAM INT_RAM (mcmode,onchip)
19 # 4. EXT_RAM EXT_RAM (mcmode,extram)
20 # 5. EXT_ROM INT_RAM (mpmode,onchip,extrom)
21 # 6. EXT_ROM EXT_RAM (mpmode,extram,extrom)
22 # 7. EXT_RAM EXT_RAM (mpmode,extram)
24 # In MC mode, TEXT and DATA are copied into RAM by the bootloader.
26 # In MP mode with external ROM, DATA needs to be copied into RAM at boot time.
28 # If there is external RAM it is better to use that and reserve the internal RAM
29 # for data buffers. However, the address of the external RAM needs to be specified.
31 # This emulation assumes config 7.
34 tic3x) OUTPUT_ARCHNAME="TMS320C3x" ;;
35 tic4x) OUTPUT_ARCHNAME="TMS320C4x" ;;
40 STACK_SIZE_DEFAULT=128;
44 STACK_SIZE_DEFAULT=0x1000;
45 HEAP_SIZE_DEFAULT=0x4000;
54 /* C30 memory space. */
57 EXT0 : org = 0x0000000, len = 0x800000 /* External address bus. */
58 XBUS : org = 0x0800000, len = 0x002000 /* Expansion bus. */
59 IOBUS : org = 0x0804000, len = 0x002000 /* I/O BUS. */
60 RAM0 : org = 0x0809800, len = 0x000400 /* Internal RAM block 0. */
61 RAM1 : org = 0x0809a00, len = 0x000400 /* Internal RAM block 1. */
62 RAM : org = 0x0809800, len = 0x000800 /* Internal RAM. */
63 EXT1 : org = 0x080a000, len = 0x7f6000 /* External address bus. */
67 test -z "$ENTRY" && ENTRY=_start
70 ${RELOCATING+/* Linker script for $OUTPUT_ARCHNAME executable. */}
71 ${RELOCATING-/* Linker script for $OUTPUT_ARCHNAME object file (ld -r). */}
73 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
74 OUTPUT_ARCH("${OUTPUT_ARCH}")
78 ${RELOCATING+ __HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : ${HEAP_SIZE_DEFAULT};}
79 ${RELOCATING+ __STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : ${STACK_SIZE_DEFAULT};}
81 ${RELOCATING+${MEMORY_DEF}}
83 /* In the small memory model the .data and .bss sections must be contiguous
84 when loaded and fit within the same page. The DP register is loaded
85 with the page address. */
89 /* Reset, interrupt, and trap vectors. */
90 .vectors ${RELOCATING+ 0} : {
92 } ${RELOCATING+ > ${TEXT_MEMORY}}
96 } ${RELOCATING+ > ${TEXT_MEMORY}}
99 ${RELOCATING+ __text = .;}
100 ${RELOCATING+ *(.init)}
102 ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
103 ${CONSTRUCTING+ LONG(___CTOR_END__ - ___CTOR_LIST__ - 2)}
104 ${CONSTRUCTING+ *(.ctors)}
105 ${CONSTRUCTING+ LONG(0);}
106 ${CONSTRUCTING+ ___CTOR_END__ = .;}
107 ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
108 ${CONSTRUCTING+ LONG(___DTOR_END__ - ___DTOR_LIST__ - 2)}
109 ${CONSTRUCTING+ *(.dtors)}
110 ${CONSTRUCTING+ LONG(0)}
111 ${CONSTRUCTING+ ___DTOR_END__ = .;}
112 ${RELOCATING+ *(.fini)}
113 ${RELOCATING+ __etext = .;}
114 } ${RELOCATING+ > ${TEXT_MEMORY}}
115 /* Global initialised variables. */
118 ${RELOCATING+ __data = .;}
120 ${RELOCATING+ __edata = .;}
121 } ${RELOCATING+ > ${DATA_MEMORY}}
122 /* Global uninitialised variables. */
124 ${RELOCATING+ __bss = .;}
127 ${RELOCATING+ __end = .;}
128 } ${RELOCATING+ > ${DATA_MEMORY}}
132 ${RELOCATING+ __heap = .;}
133 ${RELOCATING+ . += __HEAP_SIZE};
134 } ${RELOCATING+ > ${DATA_MEMORY}}
135 /* Stack (grows upward). */
138 ${RELOCATING+ __stack = .;}
140 ${RELOCATING+ . = . + __STACK_SIZE};
141 } ${RELOCATING+ > ${DATA_MEMORY}}
142 .stab 0 ${RELOCATING+(NOLOAD)} :
146 .stabstr 0 ${RELOCATING+(NOLOAD)} :