| 1 |
200 |
olivier.gi |
/* Default linker script, for normal executables */
|
| 2 |
|
|
OUTPUT_FORMAT("elf32-msp430")
|
| 3 |
|
|
OUTPUT_ARCH("msp430")
|
| 4 |
|
|
MEMORY {
|
| 5 |
|
|
sfr : ORIGIN = 0x0000, LENGTH = 0x0010
|
| 6 |
|
|
peripheral_8bit : ORIGIN = 0x0010, LENGTH = 0x00f0
|
| 7 |
|
|
peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100
|
| 8 |
|
|
ram (wx) : ORIGIN = 0x0200, LENGTH = 0x4000
|
| 9 |
|
|
rom (rx) : ORIGIN = 0xA000, LENGTH = 0x6000-0x20
|
| 10 |
|
|
vectors : ORIGIN = 0xffe0, LENGTH = 0x0020
|
| 11 |
|
|
}
|
| 12 |
|
|
REGION_ALIAS("REGION_TEXT", rom);
|
| 13 |
|
|
REGION_ALIAS("REGION_DATA", ram);
|
| 14 |
|
|
PROVIDE (__info_segment_size = 0x80);
|
| 15 |
|
|
__WDTCTL = 0x0120;
|
| 16 |
|
|
__MPY = 0x0130;
|
| 17 |
|
|
__MPYS = 0x0132;
|
| 18 |
|
|
__MAC = 0x0134;
|
| 19 |
|
|
__MACS = 0x0136;
|
| 20 |
|
|
__OP2 = 0x0138;
|
| 21 |
|
|
__RESLO = 0x013A;
|
| 22 |
|
|
__RESHI = 0x013C;
|
| 23 |
|
|
__SUMEXT = 0x013E;
|
| 24 |
|
|
|
| 25 |
|
|
SECTIONS
|
| 26 |
|
|
{
|
| 27 |
|
|
/* Read-only sections, merged into text segment. */
|
| 28 |
|
|
.hash : { *(.hash) }
|
| 29 |
|
|
.dynsym : { *(.dynsym) }
|
| 30 |
|
|
.dynstr : { *(.dynstr) }
|
| 31 |
|
|
.gnu.version : { *(.gnu.version) }
|
| 32 |
|
|
.gnu.version_d : { *(.gnu.version_d) }
|
| 33 |
|
|
.gnu.version_r : { *(.gnu.version_r) }
|
| 34 |
|
|
.rel.init : { *(.rel.init) }
|
| 35 |
|
|
.rela.init : { *(.rela.init) }
|
| 36 |
|
|
.rel.fini : { *(.rel.fini) }
|
| 37 |
|
|
.rela.fini : { *(.rela.fini) }
|
| 38 |
|
|
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
|
| 39 |
|
|
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
|
| 40 |
|
|
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
|
| 41 |
|
|
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
|
| 42 |
|
|
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
|
| 43 |
|
|
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
|
| 44 |
|
|
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
|
| 45 |
|
|
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
|
| 46 |
|
|
.rel.ctors : { *(.rel.ctors) }
|
| 47 |
|
|
.rela.ctors : { *(.rela.ctors) }
|
| 48 |
|
|
.rel.dtors : { *(.rel.dtors) }
|
| 49 |
|
|
.rela.dtors : { *(.rela.dtors) }
|
| 50 |
|
|
.rel.got : { *(.rel.got) }
|
| 51 |
|
|
.rela.got : { *(.rela.got) }
|
| 52 |
|
|
.rel.plt : { *(.rel.plt) }
|
| 53 |
|
|
.rela.plt : { *(.rela.plt) }
|
| 54 |
|
|
/* .any.{text,rodata,data,bss}{,.*} sections are treated as orphans and
|
| 55 |
|
|
* placed in output sections with available space by linker. Do not list
|
| 56 |
|
|
* them here, or the linker will not consider them orphans. */
|
| 57 |
|
|
.text :
|
| 58 |
|
|
{
|
| 59 |
|
|
. = ALIGN(2);
|
| 60 |
|
|
KEEP(*(.init .init.*))
|
| 61 |
|
|
KEEP(*(.init0)) /* Start here after reset. */
|
| 62 |
|
|
KEEP(*(.init1)) /* User definable. */
|
| 63 |
|
|
KEEP(*(.init2)) /* Initialize stack. */
|
| 64 |
|
|
KEEP(*(.init3)) /* Initialize hardware, user definable. */
|
| 65 |
|
|
KEEP(*(.init4)) /* Copy data to .data, clear bss. */
|
| 66 |
|
|
KEEP(*(.init5)) /* User definable. */
|
| 67 |
|
|
KEEP(*(.init6)) /* C++ constructors. */
|
| 68 |
|
|
KEEP(*(.init7)) /* User definable. */
|
| 69 |
|
|
KEEP(*(.init8)) /* User definable. */
|
| 70 |
|
|
KEEP(*(.init9)) /* Call main(). */
|
| 71 |
|
|
KEEP(*(.fini9)) /* Falls into here after main(). User definable. */
|
| 72 |
|
|
KEEP(*(.fini8)) /* User definable. */
|
| 73 |
|
|
KEEP(*(.fini7)) /* User definable. */
|
| 74 |
|
|
KEEP(*(.fini6)) /* C++ destructors. */
|
| 75 |
|
|
KEEP(*(.fini5)) /* User definable. */
|
| 76 |
|
|
KEEP(*(.fini4)) /* User definable. */
|
| 77 |
|
|
KEEP(*(.fini3)) /* User definable. */
|
| 78 |
|
|
KEEP(*(.fini2)) /* User definable. */
|
| 79 |
|
|
KEEP(*(.fini1)) /* User definable. */
|
| 80 |
|
|
KEEP(*(.fini0)) /* Infinite loop after program termination. */
|
| 81 |
|
|
KEEP(*(.fini .fini.*))
|
| 82 |
|
|
. = ALIGN(2);
|
| 83 |
|
|
__ctors_start = .;
|
| 84 |
|
|
KEEP(*(.ctors))
|
| 85 |
|
|
__ctors_end = .;
|
| 86 |
|
|
__dtors_start = .;
|
| 87 |
|
|
KEEP(*(.dtors))
|
| 88 |
|
|
__dtors_end = .;
|
| 89 |
|
|
. = ALIGN(2);
|
| 90 |
|
|
*(.text .text.* .gnu.linkonce.t.*)
|
| 91 |
|
|
*(.near.text .near.text.*)
|
| 92 |
|
|
} > REGION_TEXT
|
| 93 |
|
|
.rodata :
|
| 94 |
|
|
{
|
| 95 |
|
|
. = ALIGN(2);
|
| 96 |
|
|
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
| 97 |
|
|
*(.near.rodata .near.rodata.*)
|
| 98 |
|
|
} > REGION_TEXT
|
| 99 |
|
|
. = ALIGN(2);
|
| 100 |
|
|
_etext = .; /* Past last read-only (loadable) segment */
|
| 101 |
|
|
.data :
|
| 102 |
|
|
{
|
| 103 |
|
|
. = ALIGN(2);
|
| 104 |
|
|
PROVIDE (__data_start = .) ;
|
| 105 |
|
|
PROVIDE (__datastart = .) ;
|
| 106 |
|
|
*(.data .data.* .gnu.linkonce.d.*)
|
| 107 |
|
|
*(.near.data .near.data.*)
|
| 108 |
|
|
. = ALIGN(2);
|
| 109 |
|
|
_edata = .; /* Past last read-write (loadable) segment */
|
| 110 |
|
|
} > REGION_DATA AT > REGION_TEXT
|
| 111 |
|
|
__data_load_start = LOADADDR(.data);
|
| 112 |
|
|
__data_size = SIZEOF(.data);
|
| 113 |
|
|
.bss :
|
| 114 |
|
|
{
|
| 115 |
|
|
__bss_start = .;
|
| 116 |
|
|
*(.bss .bss.*)
|
| 117 |
|
|
*(.near.bss .near.bss.*)
|
| 118 |
|
|
*(COMMON)
|
| 119 |
|
|
. = ALIGN(2);
|
| 120 |
|
|
__bss_end = .;
|
| 121 |
|
|
} > REGION_DATA
|
| 122 |
|
|
__bss_size = SIZEOF(.bss);
|
| 123 |
|
|
.noinit :
|
| 124 |
|
|
{
|
| 125 |
|
|
. = ALIGN(2);
|
| 126 |
|
|
__noinit_start = .;
|
| 127 |
|
|
*(.noinit .noinit.*)
|
| 128 |
|
|
. = ALIGN(2);
|
| 129 |
|
|
__noinit_end = .;
|
| 130 |
|
|
} > REGION_DATA
|
| 131 |
|
|
. = ALIGN(2);
|
| 132 |
|
|
_end = .; /* Past last write (loadable) segment */
|
| 133 |
|
|
|
| 134 |
|
|
/* Values placed in the first 32 entries of a 64-entry interrupt vector
|
| 135 |
|
|
* table. This exists because the FRAM chips place the BSL and JTAG
|
| 136 |
|
|
* passwords at specific offsets that technically fall within the
|
| 137 |
|
|
* interrupt table, but for which no MCU has a corresponding interrupt.
|
| 138 |
|
|
* See https://sourceforge.net/tracker/?func=detail&aid=3554291&group_id=42303&atid=432701 */
|
| 139 |
|
|
PROVIDE(__vte_0 = 0xffff);
|
| 140 |
|
|
PROVIDE(__vte_1 = 0xffff);
|
| 141 |
|
|
PROVIDE(__vte_2 = 0xffff);
|
| 142 |
|
|
PROVIDE(__vte_3 = 0xffff);
|
| 143 |
|
|
PROVIDE(__vte_4 = 0xffff);
|
| 144 |
|
|
PROVIDE(__vte_5 = 0xffff);
|
| 145 |
|
|
PROVIDE(__vte_6 = 0xffff);
|
| 146 |
|
|
PROVIDE(__vte_7 = 0xffff);
|
| 147 |
|
|
PROVIDE(__vte_8 = 0xffff);
|
| 148 |
|
|
PROVIDE(__vte_9 = 0xffff);
|
| 149 |
|
|
PROVIDE(__vte_10 = 0xffff);
|
| 150 |
|
|
PROVIDE(__vte_11 = 0xffff);
|
| 151 |
|
|
PROVIDE(__vte_12 = 0xffff);
|
| 152 |
|
|
PROVIDE(__vte_13 = 0xffff);
|
| 153 |
|
|
PROVIDE(__vte_14 = 0xffff);
|
| 154 |
|
|
PROVIDE(__vte_15 = 0xffff);
|
| 155 |
|
|
PROVIDE(__vte_16 = 0xffff);
|
| 156 |
|
|
PROVIDE(__vte_17 = 0xffff);
|
| 157 |
|
|
PROVIDE(__vte_18 = 0xffff);
|
| 158 |
|
|
PROVIDE(__vte_19 = 0xffff);
|
| 159 |
|
|
PROVIDE(__vte_20 = 0xffff);
|
| 160 |
|
|
PROVIDE(__vte_21 = 0xffff);
|
| 161 |
|
|
PROVIDE(__vte_22 = 0xffff);
|
| 162 |
|
|
PROVIDE(__vte_23 = 0xffff);
|
| 163 |
|
|
PROVIDE(__vte_24 = 0xffff);
|
| 164 |
|
|
PROVIDE(__vte_25 = 0xffff);
|
| 165 |
|
|
PROVIDE(__vte_26 = 0xffff);
|
| 166 |
|
|
PROVIDE(__vte_27 = 0xffff);
|
| 167 |
|
|
PROVIDE(__vte_28 = 0xffff);
|
| 168 |
|
|
PROVIDE(__vte_29 = 0xffff);
|
| 169 |
|
|
PROVIDE(__vte_30 = 0xffff);
|
| 170 |
|
|
PROVIDE(__vte_31 = 0xffff);
|
| 171 |
|
|
.vectors :
|
| 172 |
|
|
{
|
| 173 |
|
|
__vectors_start = .;
|
| 174 |
|
|
KEEP(*(.vectors*))
|
| 175 |
|
|
_vectors_end = .;
|
| 176 |
|
|
} > vectors
|
| 177 |
|
|
/* Legacy section, prefer .far.text */
|
| 178 |
|
|
. = ALIGN(2);
|
| 179 |
|
|
_efartext = .; /* Past last read-only (loadable) segment */
|
| 180 |
|
|
. = ALIGN(2);
|
| 181 |
|
|
_far_end = .; /* Past last write (loadable) segment */
|
| 182 |
|
|
/* Stabs for profiling information*/
|
| 183 |
|
|
.profiler 0 : { *(.profiler) }
|
| 184 |
|
|
/* Stabs debugging sections. */
|
| 185 |
|
|
.stab 0 : { *(.stab) }
|
| 186 |
|
|
.stabstr 0 : { *(.stabstr) }
|
| 187 |
|
|
.stab.excl 0 : { *(.stab.excl) }
|
| 188 |
|
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
| 189 |
|
|
.stab.index 0 : { *(.stab.index) }
|
| 190 |
|
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
| 191 |
|
|
.comment 0 : { *(.comment) }
|
| 192 |
|
|
/* DWARF debug sections.
|
| 193 |
|
|
Symbols in the DWARF debugging sections are relative to the beginning
|
| 194 |
|
|
of the section so we begin them at 0. */
|
| 195 |
|
|
/* DWARF 1 */
|
| 196 |
|
|
.debug 0 : { *(.debug) }
|
| 197 |
|
|
.line 0 : { *(.line) }
|
| 198 |
|
|
/* GNU DWARF 1 extensions */
|
| 199 |
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
| 200 |
|
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
| 201 |
|
|
/* DWARF 1.1 and DWARF 2 */
|
| 202 |
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
| 203 |
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
| 204 |
|
|
/* DWARF 2 */
|
| 205 |
|
|
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
|
| 206 |
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
| 207 |
|
|
.debug_line 0 : { *(.debug_line) }
|
| 208 |
|
|
.debug_frame 0 : { *(.debug_frame) }
|
| 209 |
|
|
.debug_str 0 : { *(.debug_str) }
|
| 210 |
|
|
.debug_loc 0 : { *(.debug_loc) }
|
| 211 |
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
| 212 |
|
|
/* DWARF 3 */
|
| 213 |
|
|
.debug_pubtypes 0 : { *(.debug_pubtypes) }
|
| 214 |
|
|
.debug_ranges 0 : { *(.debug_ranges) }
|
| 215 |
|
|
/* __stack is the only symbol that the user can override */
|
| 216 |
|
|
PROVIDE (__stack = ORIGIN(ram) + LENGTH(ram));
|
| 217 |
|
|
PROVIDE (__data_start_rom = _etext) ;
|
| 218 |
|
|
PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
|
| 219 |
|
|
PROVIDE (__romdatastart = _etext) ;
|
| 220 |
|
|
PROVIDE (__romdataend = _etext + SIZEOF (.data)) ;
|
| 221 |
|
|
PROVIDE (__romdatacopysize = SIZEOF(.data));
|
| 222 |
|
|
}
|