version_2.0
Dependents: cc3000_ping_demo_try_2
Fork of mbed by
TARGET_UBLOX_C027/TOOLCHAIN_GCC_CR/LPC1768.ld@86:4f9a848d74c7, 2014-06-25 (annotated)
- Committer:
- erezi
- Date:
- Wed Jun 25 06:08:49 2014 +0000
- Revision:
- 86:4f9a848d74c7
- Parent:
- 77:869cf507173a
version_2.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 77:869cf507173a | 1 | /* mbed - LPC1768 linker script |
emilmont | 77:869cf507173a | 2 | * Based linker script generated by Code Red Technologies Red Suite 4.1 |
emilmont | 77:869cf507173a | 3 | */ |
emilmont | 77:869cf507173a | 4 | GROUP(libgcc.a libc.a libstdc++.a libm.a libcr_newlib_nohost.a crti.o crtn.o crtbegin.o crtend.o) |
emilmont | 77:869cf507173a | 5 | |
emilmont | 77:869cf507173a | 6 | MEMORY |
emilmont | 77:869cf507173a | 7 | { |
emilmont | 77:869cf507173a | 8 | /* Define each memory region */ |
emilmont | 77:869cf507173a | 9 | MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x80000 /* 512k */ |
emilmont | 77:869cf507173a | 10 | RamLoc32 (rwx) : ORIGIN = 0x100000C8, LENGTH = 0x7F38 /* 32k */ |
emilmont | 77:869cf507173a | 11 | RamAHB32 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x8000 /* 32k */ |
emilmont | 77:869cf507173a | 12 | |
emilmont | 77:869cf507173a | 13 | } |
emilmont | 77:869cf507173a | 14 | /* Define a symbol for the top of each memory region */ |
emilmont | 77:869cf507173a | 15 | __top_MFlash512 = 0x0 + 0x80000; |
emilmont | 77:869cf507173a | 16 | __top_RamLoc32 = 0x10000000 + 0x8000; |
emilmont | 77:869cf507173a | 17 | __top_RamAHB32 = 0x2007c000 + 0x8000; |
emilmont | 77:869cf507173a | 18 | |
emilmont | 77:869cf507173a | 19 | ENTRY(ResetISR) |
emilmont | 77:869cf507173a | 20 | |
emilmont | 77:869cf507173a | 21 | SECTIONS |
emilmont | 77:869cf507173a | 22 | { |
emilmont | 77:869cf507173a | 23 | |
emilmont | 77:869cf507173a | 24 | /* MAIN TEXT SECTION */ |
emilmont | 77:869cf507173a | 25 | .text : ALIGN(4) |
emilmont | 77:869cf507173a | 26 | { |
emilmont | 77:869cf507173a | 27 | FILL(0xff) |
emilmont | 77:869cf507173a | 28 | KEEP(*(.isr_vector)) |
emilmont | 77:869cf507173a | 29 | |
emilmont | 77:869cf507173a | 30 | /* Global Section Table */ |
emilmont | 77:869cf507173a | 31 | . = ALIGN(4) ; |
emilmont | 77:869cf507173a | 32 | __section_table_start = .; |
emilmont | 77:869cf507173a | 33 | __data_section_table = .; |
emilmont | 77:869cf507173a | 34 | LONG(LOADADDR(.data)); |
emilmont | 77:869cf507173a | 35 | LONG( ADDR(.data)) ; |
emilmont | 77:869cf507173a | 36 | LONG( SIZEOF(.data)); |
emilmont | 77:869cf507173a | 37 | LONG(LOADADDR(.data_RAM2)); |
emilmont | 77:869cf507173a | 38 | LONG( ADDR(.data_RAM2)) ; |
emilmont | 77:869cf507173a | 39 | LONG( SIZEOF(.data_RAM2)); |
emilmont | 77:869cf507173a | 40 | __data_section_table_end = .; |
emilmont | 77:869cf507173a | 41 | __bss_section_table = .; |
emilmont | 77:869cf507173a | 42 | LONG( ADDR(.bss)); |
emilmont | 77:869cf507173a | 43 | LONG( SIZEOF(.bss)); |
emilmont | 77:869cf507173a | 44 | LONG( ADDR(.bss_RAM2)); |
emilmont | 77:869cf507173a | 45 | LONG( SIZEOF(.bss_RAM2)); |
emilmont | 77:869cf507173a | 46 | __bss_section_table_end = .; |
emilmont | 77:869cf507173a | 47 | __section_table_end = . ; |
emilmont | 77:869cf507173a | 48 | /* End of Global Section Table */ |
emilmont | 77:869cf507173a | 49 | |
emilmont | 77:869cf507173a | 50 | |
emilmont | 77:869cf507173a | 51 | *(.after_vectors*) |
emilmont | 77:869cf507173a | 52 | |
emilmont | 77:869cf507173a | 53 | *(.text*) |
emilmont | 77:869cf507173a | 54 | *(.rodata .rodata.*) |
emilmont | 77:869cf507173a | 55 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 56 | |
emilmont | 77:869cf507173a | 57 | /* C++ constructors etc */ |
emilmont | 77:869cf507173a | 58 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 59 | KEEP(*(.init)) |
emilmont | 77:869cf507173a | 60 | |
emilmont | 77:869cf507173a | 61 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 62 | __preinit_array_start = .; |
emilmont | 77:869cf507173a | 63 | KEEP (*(.preinit_array)) |
emilmont | 77:869cf507173a | 64 | __preinit_array_end = .; |
emilmont | 77:869cf507173a | 65 | |
emilmont | 77:869cf507173a | 66 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 67 | __init_array_start = .; |
emilmont | 77:869cf507173a | 68 | KEEP (*(SORT(.init_array.*))) |
emilmont | 77:869cf507173a | 69 | KEEP (*(.init_array)) |
emilmont | 77:869cf507173a | 70 | __init_array_end = .; |
emilmont | 77:869cf507173a | 71 | |
emilmont | 77:869cf507173a | 72 | KEEP(*(.fini)); |
emilmont | 77:869cf507173a | 73 | |
emilmont | 77:869cf507173a | 74 | . = ALIGN(0x4); |
emilmont | 77:869cf507173a | 75 | KEEP (*crtbegin.o(.ctors)) |
emilmont | 77:869cf507173a | 76 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) |
emilmont | 77:869cf507173a | 77 | KEEP (*(SORT(.ctors.*))) |
emilmont | 77:869cf507173a | 78 | KEEP (*crtend.o(.ctors)) |
emilmont | 77:869cf507173a | 79 | |
emilmont | 77:869cf507173a | 80 | . = ALIGN(0x4); |
emilmont | 77:869cf507173a | 81 | KEEP (*crtbegin.o(.dtors)) |
emilmont | 77:869cf507173a | 82 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) |
emilmont | 77:869cf507173a | 83 | KEEP (*(SORT(.dtors.*))) |
emilmont | 77:869cf507173a | 84 | KEEP (*crtend.o(.dtors)) |
emilmont | 77:869cf507173a | 85 | /* End C++ */ |
emilmont | 77:869cf507173a | 86 | } > MFlash512 |
emilmont | 77:869cf507173a | 87 | |
emilmont | 77:869cf507173a | 88 | /* |
emilmont | 77:869cf507173a | 89 | * for exception handling/unwind - some Newlib functions (in common |
emilmont | 77:869cf507173a | 90 | * with C++ and STDC++) use this. |
emilmont | 77:869cf507173a | 91 | */ |
emilmont | 77:869cf507173a | 92 | .ARM.extab : ALIGN(4) |
emilmont | 77:869cf507173a | 93 | { |
emilmont | 77:869cf507173a | 94 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
emilmont | 77:869cf507173a | 95 | } > MFlash512 |
emilmont | 77:869cf507173a | 96 | __exidx_start = .; |
emilmont | 77:869cf507173a | 97 | |
emilmont | 77:869cf507173a | 98 | .ARM.exidx : ALIGN(4) |
emilmont | 77:869cf507173a | 99 | { |
emilmont | 77:869cf507173a | 100 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
emilmont | 77:869cf507173a | 101 | } > MFlash512 |
emilmont | 77:869cf507173a | 102 | __exidx_end = .; |
emilmont | 77:869cf507173a | 103 | |
emilmont | 77:869cf507173a | 104 | _etext = .; |
emilmont | 77:869cf507173a | 105 | |
emilmont | 77:869cf507173a | 106 | |
emilmont | 77:869cf507173a | 107 | .data_RAM2 : ALIGN(4) |
emilmont | 77:869cf507173a | 108 | { |
emilmont | 77:869cf507173a | 109 | FILL(0xff) |
emilmont | 77:869cf507173a | 110 | *(.data.$RAM2*) |
emilmont | 77:869cf507173a | 111 | *(.data.$RamAHB32*) |
emilmont | 77:869cf507173a | 112 | . = ALIGN(4) ; |
emilmont | 77:869cf507173a | 113 | } > RamAHB32 AT>MFlash512 |
emilmont | 77:869cf507173a | 114 | |
emilmont | 77:869cf507173a | 115 | /* MAIN DATA SECTION */ |
emilmont | 77:869cf507173a | 116 | |
emilmont | 77:869cf507173a | 117 | .uninit_RESERVED : ALIGN(4) |
emilmont | 77:869cf507173a | 118 | { |
emilmont | 77:869cf507173a | 119 | KEEP(*(.bss.$RESERVED*)) |
emilmont | 77:869cf507173a | 120 | } > RamLoc32 |
emilmont | 77:869cf507173a | 121 | |
emilmont | 77:869cf507173a | 122 | .data : ALIGN(4) |
emilmont | 77:869cf507173a | 123 | { |
emilmont | 77:869cf507173a | 124 | FILL(0xff) |
emilmont | 77:869cf507173a | 125 | _data = .; |
emilmont | 77:869cf507173a | 126 | *(vtable) |
emilmont | 77:869cf507173a | 127 | *(.data*) |
emilmont | 77:869cf507173a | 128 | . = ALIGN(4) ; |
emilmont | 77:869cf507173a | 129 | _edata = .; |
emilmont | 77:869cf507173a | 130 | } > RamLoc32 AT>MFlash512 |
emilmont | 77:869cf507173a | 131 | |
emilmont | 77:869cf507173a | 132 | |
emilmont | 77:869cf507173a | 133 | .bss_RAM2 : ALIGN(4) |
emilmont | 77:869cf507173a | 134 | { |
emilmont | 77:869cf507173a | 135 | *(.bss.$RAM2*) |
emilmont | 77:869cf507173a | 136 | *(.bss.$RamAHB32*) |
emilmont | 77:869cf507173a | 137 | . = ALIGN(4) ; |
emilmont | 77:869cf507173a | 138 | } > RamAHB32 |
emilmont | 77:869cf507173a | 139 | |
emilmont | 77:869cf507173a | 140 | /* MAIN BSS SECTION */ |
emilmont | 77:869cf507173a | 141 | .bss : ALIGN(4) |
emilmont | 77:869cf507173a | 142 | { |
emilmont | 77:869cf507173a | 143 | _bss = .; |
emilmont | 77:869cf507173a | 144 | *(.bss*) |
emilmont | 77:869cf507173a | 145 | *(COMMON) |
emilmont | 77:869cf507173a | 146 | . = ALIGN(4) ; |
emilmont | 77:869cf507173a | 147 | _ebss = .; |
emilmont | 77:869cf507173a | 148 | PROVIDE(end = .); |
emilmont | 77:869cf507173a | 149 | __end__ = .; |
emilmont | 77:869cf507173a | 150 | } > RamLoc32 |
emilmont | 77:869cf507173a | 151 | |
emilmont | 77:869cf507173a | 152 | PROVIDE(_pvHeapStart = .); |
emilmont | 77:869cf507173a | 153 | PROVIDE(_vStackTop = __top_RamLoc32 - 0); |
emilmont | 77:869cf507173a | 154 | } |