Mouse code for the MacroRat
mbed-dev/targets/TARGET_NXP/TARGET_LPC23XX/device/TOOLCHAIN_GCC_ARM/LPC2368.ld@46:b156ef445742, 2017-06-03 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sat Jun 03 00:22:44 2017 +0000
- Revision:
- 46:b156ef445742
- Parent:
- 18:6a4db94011d3
Final code for internal battlebot competition.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") |
sahilmgandhi | 18:6a4db94011d3 | 2 | OUTPUT_ARCH(arm) |
sahilmgandhi | 18:6a4db94011d3 | 3 | ENTRY(vectors) |
sahilmgandhi | 18:6a4db94011d3 | 4 | |
sahilmgandhi | 18:6a4db94011d3 | 5 | /* Memory Definitions: */ |
sahilmgandhi | 18:6a4db94011d3 | 6 | MEMORY |
sahilmgandhi | 18:6a4db94011d3 | 7 | { |
sahilmgandhi | 18:6a4db94011d3 | 8 | Flash (rx) : ORIGIN = 0x00000000, LENGTH = 512k |
sahilmgandhi | 18:6a4db94011d3 | 9 | Ram (rwx) : ORIGIN = 0x40000000, LENGTH = 32k |
sahilmgandhi | 18:6a4db94011d3 | 10 | UsbRam (rw) : ORIGIN = 0x7FD00000, LENGTH = 8k |
sahilmgandhi | 18:6a4db94011d3 | 11 | EthRam (rw) : ORIGIN = 0x7FE00000, LENGTH = 16k |
sahilmgandhi | 18:6a4db94011d3 | 12 | CanRam (rw) : ORIGIN = 0xE0038000, LENGTH = 2k |
sahilmgandhi | 18:6a4db94011d3 | 13 | BatRam (rw) : ORIGIN = 0xE0084000, LENGTH = 2k |
sahilmgandhi | 18:6a4db94011d3 | 14 | } |
sahilmgandhi | 18:6a4db94011d3 | 15 | |
sahilmgandhi | 18:6a4db94011d3 | 16 | /* Stack sizes: */ |
sahilmgandhi | 18:6a4db94011d3 | 17 | UND_Stack_Size = 16; |
sahilmgandhi | 18:6a4db94011d3 | 18 | SVC_Stack_Size = 512; |
sahilmgandhi | 18:6a4db94011d3 | 19 | ABT_Stack_Size = 16; |
sahilmgandhi | 18:6a4db94011d3 | 20 | FIQ_Stack_Size = 16; |
sahilmgandhi | 18:6a4db94011d3 | 21 | IRQ_Stack_Size = 256; |
sahilmgandhi | 18:6a4db94011d3 | 22 | Stack_Size_Total = UND_Stack_Size + SVC_Stack_Size + ABT_Stack_Size + FIQ_Stack_Size + IRQ_Stack_Size; |
sahilmgandhi | 18:6a4db94011d3 | 23 | |
sahilmgandhi | 18:6a4db94011d3 | 24 | /* Stack tops for each mode: */ |
sahilmgandhi | 18:6a4db94011d3 | 25 | __und_stack_top__ = __stacks_top__; |
sahilmgandhi | 18:6a4db94011d3 | 26 | __abt_stack_top__ = __und_stack_top__ - UND_Stack_Size ; |
sahilmgandhi | 18:6a4db94011d3 | 27 | __fiq_stack_top__ = __abt_stack_top__ - ABT_Stack_Size ; |
sahilmgandhi | 18:6a4db94011d3 | 28 | __irq_stack_top__ = __fiq_stack_top__ - FIQ_Stack_Size ; |
sahilmgandhi | 18:6a4db94011d3 | 29 | __svc_stack_top__ = __irq_stack_top__ - IRQ_Stack_Size ; |
sahilmgandhi | 18:6a4db94011d3 | 30 | |
sahilmgandhi | 18:6a4db94011d3 | 31 | /* C-accessible symbols for memory address ranges: */ |
sahilmgandhi | 18:6a4db94011d3 | 32 | __FLASH_segment_start__ = ORIGIN( Flash ); |
sahilmgandhi | 18:6a4db94011d3 | 33 | __FLASH_segment_end__ = ORIGIN( Flash ) + LENGTH( Flash ); |
sahilmgandhi | 18:6a4db94011d3 | 34 | __SRAM_segment_start__ = ORIGIN( Ram ); |
sahilmgandhi | 18:6a4db94011d3 | 35 | __SRAM_segment_end__ = ORIGIN( Ram ) + LENGTH( Ram ); |
sahilmgandhi | 18:6a4db94011d3 | 36 | |
sahilmgandhi | 18:6a4db94011d3 | 37 | /* Stacks (full descending) at top of RAM, grows downward: |
sahilmgandhi | 18:6a4db94011d3 | 38 | * |
sahilmgandhi | 18:6a4db94011d3 | 39 | * __stack_min__ is used by the malloc implementation to ensure heap never collides |
sahilmgandhi | 18:6a4db94011d3 | 40 | * with stack (assuming stack never grows beyond Stack_Size_Total in length) */ |
sahilmgandhi | 18:6a4db94011d3 | 41 | __stacks_top__ = __SRAM_segment_end__; |
sahilmgandhi | 18:6a4db94011d3 | 42 | __stacks_min__ = __SRAM_segment_end__ - Stack_Size_Total; |
sahilmgandhi | 18:6a4db94011d3 | 43 | |
sahilmgandhi | 18:6a4db94011d3 | 44 | SECTIONS |
sahilmgandhi | 18:6a4db94011d3 | 45 | { |
sahilmgandhi | 18:6a4db94011d3 | 46 | /* first section is .text which is used for code */ |
sahilmgandhi | 18:6a4db94011d3 | 47 | __text_start__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 48 | .text : { |
sahilmgandhi | 18:6a4db94011d3 | 49 | __privileged_code_start__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 50 | KEEP( *( .vectors ) ) |
sahilmgandhi | 18:6a4db94011d3 | 51 | *( .privileged_code ) |
sahilmgandhi | 18:6a4db94011d3 | 52 | |
sahilmgandhi | 18:6a4db94011d3 | 53 | __privileged_code_end__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 54 | |
sahilmgandhi | 18:6a4db94011d3 | 55 | *( .text .text.* .gnu.linkonce.t.* ) |
sahilmgandhi | 18:6a4db94011d3 | 56 | *( .plt ) |
sahilmgandhi | 18:6a4db94011d3 | 57 | *( .gnu.warning ) |
sahilmgandhi | 18:6a4db94011d3 | 58 | *( .glue_7t ) *( .glue_7 ) *( .vfp11_veneer ) |
sahilmgandhi | 18:6a4db94011d3 | 59 | |
sahilmgandhi | 18:6a4db94011d3 | 60 | *( .rodata .rodata.* .gnu.linkonce.r.* ) |
sahilmgandhi | 18:6a4db94011d3 | 61 | |
sahilmgandhi | 18:6a4db94011d3 | 62 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
sahilmgandhi | 18:6a4db94011d3 | 63 | *(.gcc_except_table) |
sahilmgandhi | 18:6a4db94011d3 | 64 | *(.eh_frame_hdr) |
sahilmgandhi | 18:6a4db94011d3 | 65 | *(.eh_frame) |
sahilmgandhi | 18:6a4db94011d3 | 66 | |
sahilmgandhi | 18:6a4db94011d3 | 67 | . = ALIGN( 4 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 68 | KEEP( *( .init ) ) |
sahilmgandhi | 18:6a4db94011d3 | 69 | . = ALIGN( 4 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 70 | __preinit_array_start = . ; |
sahilmgandhi | 18:6a4db94011d3 | 71 | KEEP( *( .preinit_array ) ) |
sahilmgandhi | 18:6a4db94011d3 | 72 | __preinit_array_end = . ; |
sahilmgandhi | 18:6a4db94011d3 | 73 | . = ALIGN( 4 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 74 | __init_array_start = . ; |
sahilmgandhi | 18:6a4db94011d3 | 75 | KEEP( *( SORT( .init_array.* ) ) ) |
sahilmgandhi | 18:6a4db94011d3 | 76 | KEEP( *( .init_array ) ) |
sahilmgandhi | 18:6a4db94011d3 | 77 | __init_array_end = . ; |
sahilmgandhi | 18:6a4db94011d3 | 78 | |
sahilmgandhi | 18:6a4db94011d3 | 79 | . = ALIGN( 4 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 80 | KEEP( *crtbegin.o( .ctors ) ) |
sahilmgandhi | 18:6a4db94011d3 | 81 | KEEP( *( EXCLUDE_FILE( *crtend.o ) .ctors ) ) |
sahilmgandhi | 18:6a4db94011d3 | 82 | KEEP( *( SORT( .ctors.* ) ) ) |
sahilmgandhi | 18:6a4db94011d3 | 83 | KEEP( *crtend.o( .ctors ) ) |
sahilmgandhi | 18:6a4db94011d3 | 84 | |
sahilmgandhi | 18:6a4db94011d3 | 85 | . = ALIGN( 4 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 86 | KEEP( *( .fini ) ) |
sahilmgandhi | 18:6a4db94011d3 | 87 | . = ALIGN( 4 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 88 | __fini_array_start = . ; |
sahilmgandhi | 18:6a4db94011d3 | 89 | KEEP( *( .fini_array ) ) |
sahilmgandhi | 18:6a4db94011d3 | 90 | KEEP( *( SORT( .fini_array.* ) ) ) |
sahilmgandhi | 18:6a4db94011d3 | 91 | __fini_array_end = . ; |
sahilmgandhi | 18:6a4db94011d3 | 92 | |
sahilmgandhi | 18:6a4db94011d3 | 93 | KEEP( *crtbegin.o( .dtors ) ) |
sahilmgandhi | 18:6a4db94011d3 | 94 | KEEP( *( EXCLUDE_FILE( *crtend.o ) .dtors ) ) |
sahilmgandhi | 18:6a4db94011d3 | 95 | KEEP( *( SORT( .dtors.* ) ) ) |
sahilmgandhi | 18:6a4db94011d3 | 96 | KEEP( *crtend.o( .dtors ) ) |
sahilmgandhi | 18:6a4db94011d3 | 97 | |
sahilmgandhi | 18:6a4db94011d3 | 98 | } >Flash |
sahilmgandhi | 18:6a4db94011d3 | 99 | |
sahilmgandhi | 18:6a4db94011d3 | 100 | __exidx_start = . ; |
sahilmgandhi | 18:6a4db94011d3 | 101 | .ARM.exidx : { |
sahilmgandhi | 18:6a4db94011d3 | 102 | *( .ARM.exidx* .gnu.linkonce.armexidx.* ) |
sahilmgandhi | 18:6a4db94011d3 | 103 | } >Flash |
sahilmgandhi | 18:6a4db94011d3 | 104 | __exidx_end = . ; |
sahilmgandhi | 18:6a4db94011d3 | 105 | |
sahilmgandhi | 18:6a4db94011d3 | 106 | .text.align : { . = ALIGN( 8 ) ; } >Flash /* Alignment schenanigans */ |
sahilmgandhi | 18:6a4db94011d3 | 107 | __text_end__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 108 | |
sahilmgandhi | 18:6a4db94011d3 | 109 | /* .bss section -- used for uninitialized data */ |
sahilmgandhi | 18:6a4db94011d3 | 110 | /* Located at the start of RAM */ |
sahilmgandhi | 18:6a4db94011d3 | 111 | .bss (NOLOAD) : { |
sahilmgandhi | 18:6a4db94011d3 | 112 | __bss_start__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 113 | *crt0.o( .ram_vectors ) |
sahilmgandhi | 18:6a4db94011d3 | 114 | |
sahilmgandhi | 18:6a4db94011d3 | 115 | __user_bss_start__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 116 | *( .user_bss ) |
sahilmgandhi | 18:6a4db94011d3 | 117 | __user_bss_end__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 118 | |
sahilmgandhi | 18:6a4db94011d3 | 119 | *( .shbss ) |
sahilmgandhi | 18:6a4db94011d3 | 120 | *( .bss .bss.* .gnu.linkonce.b.* ) |
sahilmgandhi | 18:6a4db94011d3 | 121 | *( COMMON ) |
sahilmgandhi | 18:6a4db94011d3 | 122 | *( .ram.b ) |
sahilmgandhi | 18:6a4db94011d3 | 123 | . = ALIGN( 8 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 124 | |
sahilmgandhi | 18:6a4db94011d3 | 125 | __bss_end__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 126 | } >Ram AT>Flash |
sahilmgandhi | 18:6a4db94011d3 | 127 | |
sahilmgandhi | 18:6a4db94011d3 | 128 | /* .data section -- used for initialized data */ |
sahilmgandhi | 18:6a4db94011d3 | 129 | .data : { |
sahilmgandhi | 18:6a4db94011d3 | 130 | __data_start__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 131 | KEEP( *( .jcr ) ) |
sahilmgandhi | 18:6a4db94011d3 | 132 | *( .got.plt ) *( .got ) |
sahilmgandhi | 18:6a4db94011d3 | 133 | *( .shdata ) |
sahilmgandhi | 18:6a4db94011d3 | 134 | *( .data .data.* .gnu.linkonce.d.* ) |
sahilmgandhi | 18:6a4db94011d3 | 135 | *( .ram ) |
sahilmgandhi | 18:6a4db94011d3 | 136 | . = ALIGN( 8 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 137 | __data_end__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 138 | } >Ram AT>Flash |
sahilmgandhi | 18:6a4db94011d3 | 139 | |
sahilmgandhi | 18:6a4db94011d3 | 140 | __data_init_start__ = LOADADDR( .data ) ; |
sahilmgandhi | 18:6a4db94011d3 | 141 | |
sahilmgandhi | 18:6a4db94011d3 | 142 | /* Heap starts here and grows up in memory */ |
sahilmgandhi | 18:6a4db94011d3 | 143 | . = ALIGN( 8 ) ; |
sahilmgandhi | 18:6a4db94011d3 | 144 | __heap_start__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 145 | end = . ; |
sahilmgandhi | 18:6a4db94011d3 | 146 | __end__ = . ; |
sahilmgandhi | 18:6a4db94011d3 | 147 | |
sahilmgandhi | 18:6a4db94011d3 | 148 | .stab 0 (NOLOAD) : { *(.stab) } |
sahilmgandhi | 18:6a4db94011d3 | 149 | .stabstr 0 (NOLOAD) : { *(.stabstr) } |
sahilmgandhi | 18:6a4db94011d3 | 150 | /* DWARF debug sections. */ |
sahilmgandhi | 18:6a4db94011d3 | 151 | /* Symbols in the DWARF debugging sections are relative to the */ |
sahilmgandhi | 18:6a4db94011d3 | 152 | /* beginning of the section so we begin them at 0. */ |
sahilmgandhi | 18:6a4db94011d3 | 153 | /* DWARF 1 */ |
sahilmgandhi | 18:6a4db94011d3 | 154 | .debug 0 : { *(.debug) } |
sahilmgandhi | 18:6a4db94011d3 | 155 | .line 0 : { *(.line) } |
sahilmgandhi | 18:6a4db94011d3 | 156 | /* GNU DWARF 1 extensions */ |
sahilmgandhi | 18:6a4db94011d3 | 157 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
sahilmgandhi | 18:6a4db94011d3 | 158 | .debug_sfnames 0 : { *(.debug_sfnames) } |
sahilmgandhi | 18:6a4db94011d3 | 159 | /* DWARF 1.1 and DWARF 2 */ |
sahilmgandhi | 18:6a4db94011d3 | 160 | .debug_aranges 0 : { *(.debug_aranges) } |
sahilmgandhi | 18:6a4db94011d3 | 161 | .debug_pubnames 0 : { *(.debug_pubnames) } |
sahilmgandhi | 18:6a4db94011d3 | 162 | /* DWARF 2 */ |
sahilmgandhi | 18:6a4db94011d3 | 163 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
sahilmgandhi | 18:6a4db94011d3 | 164 | .debug_abbrev 0 : { *(.debug_abbrev) } |
sahilmgandhi | 18:6a4db94011d3 | 165 | .debug_line 0 : { *(.debug_line) } |
sahilmgandhi | 18:6a4db94011d3 | 166 | .debug_frame 0 : { *(.debug_frame) } |
sahilmgandhi | 18:6a4db94011d3 | 167 | .debug_str 0 : { *(.debug_str) } |
sahilmgandhi | 18:6a4db94011d3 | 168 | .debug_loc 0 : { *(.debug_loc) } |
sahilmgandhi | 18:6a4db94011d3 | 169 | .debug_macinfo 0 : { *(.debug_macinfo) } |
sahilmgandhi | 18:6a4db94011d3 | 170 | /* SGI/MIPS DWARF 2 extensions */ |
sahilmgandhi | 18:6a4db94011d3 | 171 | .debug_weaknames 0 : { *(.debug_weaknames) } |
sahilmgandhi | 18:6a4db94011d3 | 172 | .debug_funcnames 0 : { *(.debug_funcnames) } |
sahilmgandhi | 18:6a4db94011d3 | 173 | .debug_typenames 0 : { *(.debug_typenames) } |
sahilmgandhi | 18:6a4db94011d3 | 174 | .debug_varnames 0 : { *(.debug_varnames) } |
sahilmgandhi | 18:6a4db94011d3 | 175 | /* DWARF 3 */ |
sahilmgandhi | 18:6a4db94011d3 | 176 | .debug_pubtypes 0 : { *(.debug_pubtypes) } |
sahilmgandhi | 18:6a4db94011d3 | 177 | .debug_ranges 0 : { *(.debug_ranges) } |
sahilmgandhi | 18:6a4db94011d3 | 178 | |
sahilmgandhi | 18:6a4db94011d3 | 179 | .note.gnu.arm.ident 0 : { KEEP( *( .note.gnu.arm.ident ) ) } |
sahilmgandhi | 18:6a4db94011d3 | 180 | .ARM.attributes 0 : { |
sahilmgandhi | 18:6a4db94011d3 | 181 | KEEP( *( .ARM.attributes ) ) |
sahilmgandhi | 18:6a4db94011d3 | 182 | KEEP( *( .gnu.attributes ) ) |
sahilmgandhi | 18:6a4db94011d3 | 183 | } |
sahilmgandhi | 18:6a4db94011d3 | 184 | /DISCARD/ : { *( .note.GNU-stack ) } |
sahilmgandhi | 18:6a4db94011d3 | 185 | |
sahilmgandhi | 18:6a4db94011d3 | 186 | /* C data can be defined as being in special purpose RAMs using |
sahilmgandhi | 18:6a4db94011d3 | 187 | * __attribute__ ((section ("ethram"))) for example. */ |
sahilmgandhi | 18:6a4db94011d3 | 188 | .usbram (NOLOAD): |
sahilmgandhi | 18:6a4db94011d3 | 189 | { |
sahilmgandhi | 18:6a4db94011d3 | 190 | *( .usbram ) |
sahilmgandhi | 18:6a4db94011d3 | 191 | *( .usbram.* ) |
sahilmgandhi | 18:6a4db94011d3 | 192 | } > UsbRam |
sahilmgandhi | 18:6a4db94011d3 | 193 | .ethram (NOLOAD): |
sahilmgandhi | 18:6a4db94011d3 | 194 | { |
sahilmgandhi | 18:6a4db94011d3 | 195 | *( .ethram ) |
sahilmgandhi | 18:6a4db94011d3 | 196 | *( .ethram.* ) |
sahilmgandhi | 18:6a4db94011d3 | 197 | } > EthRam |
sahilmgandhi | 18:6a4db94011d3 | 198 | .canram (NOLOAD): |
sahilmgandhi | 18:6a4db94011d3 | 199 | { |
sahilmgandhi | 18:6a4db94011d3 | 200 | *( .canram ) |
sahilmgandhi | 18:6a4db94011d3 | 201 | *( .canram.* ) |
sahilmgandhi | 18:6a4db94011d3 | 202 | } > CanRam |
sahilmgandhi | 18:6a4db94011d3 | 203 | .batram (NOLOAD): |
sahilmgandhi | 18:6a4db94011d3 | 204 | { |
sahilmgandhi | 18:6a4db94011d3 | 205 | *( .batram ) |
sahilmgandhi | 18:6a4db94011d3 | 206 | *( .batram.* ) |
sahilmgandhi | 18:6a4db94011d3 | 207 | } > BatRam |
sahilmgandhi | 18:6a4db94011d3 | 208 | } |