Mouse code for the MacroRat
mbed-dev/targets/TARGET_NXP/TARGET_LPC82X/TARGET_LPC824/device/TOOLCHAIN_GCC_CR/LPC824.ld@18:6a4db94011d3, 2017-05-14 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sun May 14 23:18:57 2017 +0000
- Revision:
- 18:6a4db94011d3
Publishing again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /*Based on following file |
sahilmgandhi | 18:6a4db94011d3 | 2 | * (c) Code Red Technologies Ltd, 2008-13 |
sahilmgandhi | 18:6a4db94011d3 | 3 | * (c) NXP Semiconductors 2013-2015 |
sahilmgandhi | 18:6a4db94011d3 | 4 | * Generated linker script file for LPC824 |
sahilmgandhi | 18:6a4db94011d3 | 5 | * Created from generic_c.ld (LPCXpresso v7.4 (0 [Build 229] [2014-09-16] )) |
sahilmgandhi | 18:6a4db94011d3 | 6 | * By LPCXpresso v7.4.0 [Build 229] [2014-09-16] on Fri Jan 02 03:36:48 JST 2015 |
sahilmgandhi | 18:6a4db94011d3 | 7 | */ |
sahilmgandhi | 18:6a4db94011d3 | 8 | |
sahilmgandhi | 18:6a4db94011d3 | 9 | /* Linker script to configure memory regions. */ |
sahilmgandhi | 18:6a4db94011d3 | 10 | MEMORY |
sahilmgandhi | 18:6a4db94011d3 | 11 | { |
sahilmgandhi | 18:6a4db94011d3 | 12 | /* Define each memory region */ |
sahilmgandhi | 18:6a4db94011d3 | 13 | MFlash32 (rx) : ORIGIN = 0x0, LENGTH = 0x8000 /* 32K bytes */ |
sahilmgandhi | 18:6a4db94011d3 | 14 | RamLoc8 (rwx) : ORIGIN = 0x10000000+0xC0, LENGTH = 0x2000-0xC0 /* 8K bytes */ |
sahilmgandhi | 18:6a4db94011d3 | 15 | |
sahilmgandhi | 18:6a4db94011d3 | 16 | |
sahilmgandhi | 18:6a4db94011d3 | 17 | } |
sahilmgandhi | 18:6a4db94011d3 | 18 | |
sahilmgandhi | 18:6a4db94011d3 | 19 | /* Define a symbol for the top of each memory region */ |
sahilmgandhi | 18:6a4db94011d3 | 20 | __top_MFlash32 = 0x0 + 0x8000; |
sahilmgandhi | 18:6a4db94011d3 | 21 | __top_RamLoc8 = 0x10000000 + 0x2000; |
sahilmgandhi | 18:6a4db94011d3 | 22 | |
sahilmgandhi | 18:6a4db94011d3 | 23 | GROUP(libgcc.a libc.a libstdc++.a libm.a libcr_newlib_nohost.a crti.o crtn.o crtbegin.o crtend.o) |
sahilmgandhi | 18:6a4db94011d3 | 24 | /*GROUP(libcr_nohost.a libcr_c.a libcr_eabihelpers.a libm.a)*/ |
sahilmgandhi | 18:6a4db94011d3 | 25 | /* Linker script to place sections and symbol values. Should be used together |
sahilmgandhi | 18:6a4db94011d3 | 26 | * with other linker script that defines memory regions FLASH and RAM. |
sahilmgandhi | 18:6a4db94011d3 | 27 | * It references following symbols, which must be defined in code: |
sahilmgandhi | 18:6a4db94011d3 | 28 | * Reset_Handler : Entry of reset handler |
sahilmgandhi | 18:6a4db94011d3 | 29 | * |
sahilmgandhi | 18:6a4db94011d3 | 30 | * It defines following symbols, which code can use without definition: |
sahilmgandhi | 18:6a4db94011d3 | 31 | * __exidx_start |
sahilmgandhi | 18:6a4db94011d3 | 32 | * __exidx_end |
sahilmgandhi | 18:6a4db94011d3 | 33 | * __etext |
sahilmgandhi | 18:6a4db94011d3 | 34 | * __data_start__ |
sahilmgandhi | 18:6a4db94011d3 | 35 | * __preinit_array_start |
sahilmgandhi | 18:6a4db94011d3 | 36 | * __preinit_array_end |
sahilmgandhi | 18:6a4db94011d3 | 37 | * __init_array_start |
sahilmgandhi | 18:6a4db94011d3 | 38 | * __init_array_end |
sahilmgandhi | 18:6a4db94011d3 | 39 | * __fini_array_start |
sahilmgandhi | 18:6a4db94011d3 | 40 | * __fini_array_end |
sahilmgandhi | 18:6a4db94011d3 | 41 | * __data_end__ |
sahilmgandhi | 18:6a4db94011d3 | 42 | * __bss_start__ |
sahilmgandhi | 18:6a4db94011d3 | 43 | * __bss_end__ |
sahilmgandhi | 18:6a4db94011d3 | 44 | * __end__ |
sahilmgandhi | 18:6a4db94011d3 | 45 | * end |
sahilmgandhi | 18:6a4db94011d3 | 46 | * __HeapLimit |
sahilmgandhi | 18:6a4db94011d3 | 47 | * __StackLimit |
sahilmgandhi | 18:6a4db94011d3 | 48 | * __StackTop |
sahilmgandhi | 18:6a4db94011d3 | 49 | * __stack |
sahilmgandhi | 18:6a4db94011d3 | 50 | */ |
sahilmgandhi | 18:6a4db94011d3 | 51 | ENTRY(ResetISR) |
sahilmgandhi | 18:6a4db94011d3 | 52 | |
sahilmgandhi | 18:6a4db94011d3 | 53 | SECTIONS |
sahilmgandhi | 18:6a4db94011d3 | 54 | { |
sahilmgandhi | 18:6a4db94011d3 | 55 | |
sahilmgandhi | 18:6a4db94011d3 | 56 | /* MAIN TEXT SECTION */ |
sahilmgandhi | 18:6a4db94011d3 | 57 | .text : ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 58 | { |
sahilmgandhi | 18:6a4db94011d3 | 59 | FILL(0xff) |
sahilmgandhi | 18:6a4db94011d3 | 60 | __vectors_start__ = ABSOLUTE(.) ; |
sahilmgandhi | 18:6a4db94011d3 | 61 | KEEP(*(.isr_vector)) |
sahilmgandhi | 18:6a4db94011d3 | 62 | |
sahilmgandhi | 18:6a4db94011d3 | 63 | /* Global Section Table */ |
sahilmgandhi | 18:6a4db94011d3 | 64 | . = ALIGN(4) ; |
sahilmgandhi | 18:6a4db94011d3 | 65 | __section_table_start = .; |
sahilmgandhi | 18:6a4db94011d3 | 66 | __data_section_table = .; |
sahilmgandhi | 18:6a4db94011d3 | 67 | LONG(LOADADDR(.data)); |
sahilmgandhi | 18:6a4db94011d3 | 68 | LONG( ADDR(.data)); |
sahilmgandhi | 18:6a4db94011d3 | 69 | LONG( SIZEOF(.data)); |
sahilmgandhi | 18:6a4db94011d3 | 70 | __data_section_table_end = .; |
sahilmgandhi | 18:6a4db94011d3 | 71 | __bss_section_table = .; |
sahilmgandhi | 18:6a4db94011d3 | 72 | LONG( ADDR(.bss)); |
sahilmgandhi | 18:6a4db94011d3 | 73 | LONG( SIZEOF(.bss)); |
sahilmgandhi | 18:6a4db94011d3 | 74 | __bss_section_table_end = .; |
sahilmgandhi | 18:6a4db94011d3 | 75 | __section_table_end = . ; |
sahilmgandhi | 18:6a4db94011d3 | 76 | /* End of Global Section Table */ |
sahilmgandhi | 18:6a4db94011d3 | 77 | |
sahilmgandhi | 18:6a4db94011d3 | 78 | |
sahilmgandhi | 18:6a4db94011d3 | 79 | *(.after_vectors*) |
sahilmgandhi | 18:6a4db94011d3 | 80 | } >MFlash32 |
sahilmgandhi | 18:6a4db94011d3 | 81 | |
sahilmgandhi | 18:6a4db94011d3 | 82 | .text : ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 83 | { |
sahilmgandhi | 18:6a4db94011d3 | 84 | *(.text*) |
sahilmgandhi | 18:6a4db94011d3 | 85 | *(.rodata .rodata.* .constdata .constdata.*) |
sahilmgandhi | 18:6a4db94011d3 | 86 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 87 | |
sahilmgandhi | 18:6a4db94011d3 | 88 | |
sahilmgandhi | 18:6a4db94011d3 | 89 | /* C++ constructors etc */ |
sahilmgandhi | 18:6a4db94011d3 | 90 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 91 | KEEP(*(.init)) |
sahilmgandhi | 18:6a4db94011d3 | 92 | |
sahilmgandhi | 18:6a4db94011d3 | 93 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 94 | __preinit_array_start = .; |
sahilmgandhi | 18:6a4db94011d3 | 95 | KEEP (*(.preinit_array)) |
sahilmgandhi | 18:6a4db94011d3 | 96 | __preinit_array_end = .; |
sahilmgandhi | 18:6a4db94011d3 | 97 | |
sahilmgandhi | 18:6a4db94011d3 | 98 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 99 | __init_array_start = .; |
sahilmgandhi | 18:6a4db94011d3 | 100 | KEEP (*(SORT(.init_array.*))) |
sahilmgandhi | 18:6a4db94011d3 | 101 | KEEP (*(.init_array)) |
sahilmgandhi | 18:6a4db94011d3 | 102 | __init_array_end = .; |
sahilmgandhi | 18:6a4db94011d3 | 103 | |
sahilmgandhi | 18:6a4db94011d3 | 104 | KEEP(*(.fini)); |
sahilmgandhi | 18:6a4db94011d3 | 105 | |
sahilmgandhi | 18:6a4db94011d3 | 106 | /* .ctors */ |
sahilmgandhi | 18:6a4db94011d3 | 107 | *crtbegin.o(.ctors) |
sahilmgandhi | 18:6a4db94011d3 | 108 | *crtbegin?.o(.ctors) |
sahilmgandhi | 18:6a4db94011d3 | 109 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
sahilmgandhi | 18:6a4db94011d3 | 110 | *(SORT(.ctors.*)) |
sahilmgandhi | 18:6a4db94011d3 | 111 | *(.ctors) |
sahilmgandhi | 18:6a4db94011d3 | 112 | |
sahilmgandhi | 18:6a4db94011d3 | 113 | /* .dtors */ |
sahilmgandhi | 18:6a4db94011d3 | 114 | *crtbegin.o(.dtors) |
sahilmgandhi | 18:6a4db94011d3 | 115 | *crtbegin?.o(.dtors) |
sahilmgandhi | 18:6a4db94011d3 | 116 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
sahilmgandhi | 18:6a4db94011d3 | 117 | *(SORT(.dtors.*)) |
sahilmgandhi | 18:6a4db94011d3 | 118 | *(.dtors) |
sahilmgandhi | 18:6a4db94011d3 | 119 | |
sahilmgandhi | 18:6a4db94011d3 | 120 | *(.rodata*) |
sahilmgandhi | 18:6a4db94011d3 | 121 | |
sahilmgandhi | 18:6a4db94011d3 | 122 | KEEP(*(.eh_frame*)) |
sahilmgandhi | 18:6a4db94011d3 | 123 | |
sahilmgandhi | 18:6a4db94011d3 | 124 | |
sahilmgandhi | 18:6a4db94011d3 | 125 | |
sahilmgandhi | 18:6a4db94011d3 | 126 | } > MFlash32 |
sahilmgandhi | 18:6a4db94011d3 | 127 | |
sahilmgandhi | 18:6a4db94011d3 | 128 | /* |
sahilmgandhi | 18:6a4db94011d3 | 129 | * for exception handling/unwind - some Newlib functions (in common |
sahilmgandhi | 18:6a4db94011d3 | 130 | * with C++ and STDC++) use this. |
sahilmgandhi | 18:6a4db94011d3 | 131 | */ |
sahilmgandhi | 18:6a4db94011d3 | 132 | .ARM.extab : ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 133 | { |
sahilmgandhi | 18:6a4db94011d3 | 134 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
sahilmgandhi | 18:6a4db94011d3 | 135 | } > MFlash32 |
sahilmgandhi | 18:6a4db94011d3 | 136 | __exidx_start = .; |
sahilmgandhi | 18:6a4db94011d3 | 137 | |
sahilmgandhi | 18:6a4db94011d3 | 138 | .ARM.exidx : ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 139 | { |
sahilmgandhi | 18:6a4db94011d3 | 140 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
sahilmgandhi | 18:6a4db94011d3 | 141 | } > MFlash32 |
sahilmgandhi | 18:6a4db94011d3 | 142 | __exidx_end = .; |
sahilmgandhi | 18:6a4db94011d3 | 143 | |
sahilmgandhi | 18:6a4db94011d3 | 144 | _etext = .; |
sahilmgandhi | 18:6a4db94011d3 | 145 | |
sahilmgandhi | 18:6a4db94011d3 | 146 | |
sahilmgandhi | 18:6a4db94011d3 | 147 | /* MAIN DATA SECTION */ |
sahilmgandhi | 18:6a4db94011d3 | 148 | |
sahilmgandhi | 18:6a4db94011d3 | 149 | /* Default MTB section */ |
sahilmgandhi | 18:6a4db94011d3 | 150 | .mtb_buffer_default (NOLOAD) : |
sahilmgandhi | 18:6a4db94011d3 | 151 | { |
sahilmgandhi | 18:6a4db94011d3 | 152 | KEEP(*(.mtb*)) |
sahilmgandhi | 18:6a4db94011d3 | 153 | } > RamLoc8 |
sahilmgandhi | 18:6a4db94011d3 | 154 | |
sahilmgandhi | 18:6a4db94011d3 | 155 | .uninit_RESERVED : ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 156 | { |
sahilmgandhi | 18:6a4db94011d3 | 157 | KEEP(*(.bss.$RESERVED*)) |
sahilmgandhi | 18:6a4db94011d3 | 158 | . = ALIGN(4) ; |
sahilmgandhi | 18:6a4db94011d3 | 159 | _end_uninit_RESERVED = .; |
sahilmgandhi | 18:6a4db94011d3 | 160 | } > RamLoc8 |
sahilmgandhi | 18:6a4db94011d3 | 161 | |
sahilmgandhi | 18:6a4db94011d3 | 162 | |
sahilmgandhi | 18:6a4db94011d3 | 163 | /* Main DATA section (RamLoc8) */ |
sahilmgandhi | 18:6a4db94011d3 | 164 | .data : ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 165 | { |
sahilmgandhi | 18:6a4db94011d3 | 166 | FILL(0xff) |
sahilmgandhi | 18:6a4db94011d3 | 167 | _data = . ; |
sahilmgandhi | 18:6a4db94011d3 | 168 | *(vtable) |
sahilmgandhi | 18:6a4db94011d3 | 169 | *(.ramfunc*) |
sahilmgandhi | 18:6a4db94011d3 | 170 | *(.data*) |
sahilmgandhi | 18:6a4db94011d3 | 171 | . = ALIGN(4) ; |
sahilmgandhi | 18:6a4db94011d3 | 172 | _edata = . ; |
sahilmgandhi | 18:6a4db94011d3 | 173 | } > RamLoc8 AT>MFlash32 |
sahilmgandhi | 18:6a4db94011d3 | 174 | |
sahilmgandhi | 18:6a4db94011d3 | 175 | |
sahilmgandhi | 18:6a4db94011d3 | 176 | /* MAIN BSS SECTION */ |
sahilmgandhi | 18:6a4db94011d3 | 177 | .bss : ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 178 | { |
sahilmgandhi | 18:6a4db94011d3 | 179 | _bss = .; |
sahilmgandhi | 18:6a4db94011d3 | 180 | *(.bss*) |
sahilmgandhi | 18:6a4db94011d3 | 181 | *(COMMON) |
sahilmgandhi | 18:6a4db94011d3 | 182 | . = ALIGN(4) ; |
sahilmgandhi | 18:6a4db94011d3 | 183 | _ebss = .; |
sahilmgandhi | 18:6a4db94011d3 | 184 | PROVIDE(end = .); |
sahilmgandhi | 18:6a4db94011d3 | 185 | } > RamLoc8 |
sahilmgandhi | 18:6a4db94011d3 | 186 | |
sahilmgandhi | 18:6a4db94011d3 | 187 | |
sahilmgandhi | 18:6a4db94011d3 | 188 | /* DEFAULT NOINIT SECTION */ |
sahilmgandhi | 18:6a4db94011d3 | 189 | .noinit (NOLOAD): ALIGN(4) |
sahilmgandhi | 18:6a4db94011d3 | 190 | { |
sahilmgandhi | 18:6a4db94011d3 | 191 | _noinit = .; |
sahilmgandhi | 18:6a4db94011d3 | 192 | *(.noinit*) |
sahilmgandhi | 18:6a4db94011d3 | 193 | . = ALIGN(4) ; |
sahilmgandhi | 18:6a4db94011d3 | 194 | _end_noinit = .; |
sahilmgandhi | 18:6a4db94011d3 | 195 | } > RamLoc8 |
sahilmgandhi | 18:6a4db94011d3 | 196 | |
sahilmgandhi | 18:6a4db94011d3 | 197 | PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .); |
sahilmgandhi | 18:6a4db94011d3 | 198 | PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc8 - 0); |
sahilmgandhi | 18:6a4db94011d3 | 199 | } |