/* * Link script for LatticeMico32 programs. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ OUTPUT_FORMAT("elf32-lm8") OUTPUT_ARCH("lm8") ENTRY(_start) MEMORY { text (rx) : ORIGIN = 0, LENGTH = 64K data (rw!x) : ORIGIN = 0, LENGTH = 32 } SECTIONS { .text : { _ftext = .; *(.vectors) KEEP(*(.vectors)) *(.text .text.*) /* Constructors and destructors */ KEEP (*crtbegin*.o(.ctors)) KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) KEEP (*crtbegin*.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) KEEP (*(.jcr)) _etext = .; } > text .data : AT (LOADADDR (.text) + SIZEOF (.text)) { PROVIDE (__data_start = .); /* Reserved for interrupts */ LONG(0) /* Program data */ *(.data .data.* .gnu.linkonce.d.*) *(.data*) SORT(CONSTRUCTORS) *(.sdata .sdata.* .gnu.linkonce.s.*) *(.rodata .rodata.* .gnu.linkonce.r.*) *(.rodata*) . = ALIGN(2); _edata = .; PROVIDE (__data_end = .); } > data .bss : AT (LOADADDR (.text) + SIZEOF (.text) + SIZEOF (.data)) { PROVIDE (__bss_start = .); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) *(.scommon) *(.dynbss) *(.bss .bss.* .gnu.linkonce.b.*) *(COMMON) PROVIDE (__bss_end = .); } > data .irq_stack : AT (LOADADDR (.text) + SIZEOF (.text) + SIZEOF (.data) + SIZEOF (.bss)) { *(.irq_stack) } > data . = ALIGN (4); _end = .; PROVIDE (end = .); PROVIDE (__stack = ORIGIN (data) + LENGTH (data)); __data_load_start = LOADADDR(.data); __data_load_end = __data_load_start + SIZEOF(.data); /* 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) } .debug_sfnames 0 : { *(.debug_sfnames) } /* DWARF 1.1 and DWARF 2 */ .debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 2 */ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } .debug_macinfo 0 : { *(.debug_macinfo) } }