/* Script for ld -r: link without relocation */
OUTPUT_FORMAT("elf32-msp430","elf32-msp430","elf32-msp430")
OUTPUT_ARCH(msp:46)
MEMORY
{
  text   (rx)       : ORIGIN = 0x2100,     LENGTH = 0xdec0
  fartext(rx)       : ORIGIN = 0x10000,    LENGTH = 0x9100
  data   (rwx)      : ORIGIN = 0x1100,     LENGTH = 4096
  vectors (rw)      : ORIGIN = 0xffc0,     LENGTH = 64
  bootloader(rx)    : ORIGIN = 0x0c00,     LENGTH = 1024
  infomem(rx)       : ORIGIN = 0x1000,     LENGTH = 256
  infomemnobits(rx) : ORIGIN = 0x1000,     LENGTH = 256
}
SECTIONS
{
  /* Read-only sections, merged into text segment.  */
  .hash        0 : { *(.hash)             }
  .dynsym      0 : { *(.dynsym)           }
  .dynstr      0 : { *(.dynstr)           }
  .gnu.version 0 : { *(.gnu.version)      }
  .gnu.version_d 0 : { *(.gnu.version_d)  }
  .gnu.version_r 0 : { *(.gnu.version_r)  }
  .rel.init    0 : { *(.rel.init) }
  .rela.init   0 : { *(.rela.init) }
  .rel.text    0 :
    {
      *(.rel.text)
    }
  .rela.text   0 :
    {
      *(.rela.text)
    }
  .rel.fini    0 : { *(.rel.fini) }
  .rela.fini   0 : { *(.rela.fini) }
  .rel.rodata  0 :
    {
      *(.rel.rodata)
    }
  .rela.rodata 0 :
    {
      *(.rela.rodata)
    }
  .rel.data    0 :
    {
      *(.rel.data)
    }
  .rela.data   0 :
    {
      *(.rela.data)
    }
  .rel.ctors   0 : { *(.rel.ctors)        }
  .rela.ctors  0 : { *(.rela.ctors)       }
  .rel.dtors   0 : { *(.rel.dtors)        }
  .rela.dtors  0 : { *(.rela.dtors)       }
  .rel.got     0 : { *(.rel.got)          }
  .rela.got    0 : { *(.rela.got)         }
  .rel.bss     0 : { *(.rel.bss)          }
  .rela.bss    0 : { *(.rela.bss)         }
  .rel.plt     0 : { *(.rel.plt)          }
  .rela.plt    0 : { *(.rela.plt)         }
  /* Internal text space.  */
  .text :
  {
    *(.init)
    KEEP(*(.init))
    *(.init0)  /* Start here after reset.               */
    KEEP(*(.init0))
    *(.init1)  /* User definable.                       */
    KEEP(*(.init1))
    *(.init2)  /* Initialize stack.                     */
    KEEP(*(.init2))
    *(.init3)  /* Initialize hardware, user definable.  */
    KEEP(*(.init3))
    *(.init4)  /* Copy data to .data, clear bss.        */
    KEEP(*(.init4))
    *(.init5)  /* User definable.                       */
    KEEP(*(.init5))
    *(.init6)  /* C++ constructors.                     */
    KEEP(*(.init6))
    *(.init7)  /* User definable.                       */
    KEEP(*(.init7))
    *(.init8)  /* User definable.                       */
    KEEP(*(.init8))
    *(.init9)  /* Call main().                          */
    KEEP(*(.init9))
    *(.text)
    *(.text.*)
    *(.fini9)  /* Jumps here after main(). User definable.  */
    KEEP(*(.fini9))
    *(.fini8)  /* User definable.                           */
    KEEP(*(.fini8))
    *(.fini7)  /* User definable.                           */
    KEEP(*(.fini7))
    *(.fini6)  /* C++ destructors.                          */
    KEEP(*(.fini6))
    *(.fini5)  /* User definable.                           */
    KEEP(*(.fini5))
    *(.fini4)  /* User definable.                           */
    KEEP(*(.fini4))
    *(.fini3)  /* User definable.                           */
    KEEP(*(.fini3))
    *(.fini2)  /* User definable.                           */
    KEEP(*(.fini2))
    *(.fini1)  /* User definable.                           */
    KEEP(*(.fini1))
    *(.fini0)  /* Infinite loop after program termination.  */
    KEEP(*(.fini0))
    *(.fini)
    KEEP(*(.fini))
    _etext = .;
  }
  .data 0 :
  {
    *(.data)
    *(SORT_BY_ALIGNMENT(.data.*))
    *(.gnu.linkonce.d*)
  }
  /* Bootloader.  */
  .bootloader 0 :
  {
    *(.bootloader)
    *(.bootloader.*)
  }
  /* Information memory.  */
  .infomem 0 :
  {
    *(.infomem)
    *(.infomem.*)
  }
  /* Information memory (not loaded into MPU).  */
  .infomemnobits 0 :
  {
    *(.infomemnobits)
    *(.infomemnobits.*)
  }
  .bss 0 :
  {
    *(.bss)
    *(SORT_BY_ALIGNMENT(.bss.*))
    *(COMMON)
  }
  .noinit 0 :
  {
    *(.noinit)
    *(.noinit.*)
    *(COMMON)
  }
  .vectors 0:
  {
    *(.vectors*)
    KEEP(*(.vectors*))
  }
  /* Extended address space, accessed with extended instructions.  */
  .fartext :
  {
    *(.fartext)
    *(.fartext.*)
    _efartext = .;
  }
  /* Stabs for profiling information*/
  .profiler 0 : { *(.profiler) }
  /* Stabs debugging sections.  */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  .stab.excl 0 : { *(.stab.excl) }
  .stab.exclstr 0 : { *(.stab.exclstr) }
  .stab.index 0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo .zdebug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames .zdebug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges .zdebug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .zdebug_info) }
  .debug_abbrev   0 : { *(.debug_abbrev .zdebug_abbrev) }
  .debug_line     0 : { *(.debug_line .zdebug_line) }
  .debug_frame    0 : { *(.debug_frame .zdebug_frame) }
  .debug_str      0 : { *(.debug_str .zdebug_str) }
  .debug_loc      0 : { *(.debug_loc .zdebug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo .zdebug_macinfo) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  PROVIDE (__stack = 0x2100) ;
  PROVIDE (__data_start_rom = _etext) ;
  PROVIDE (__data_end_rom   = _etext + SIZEOF (.data)) ;
  PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
  PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
  PROVIDE (__subdevice_has_heap = 0) ;
}
