...
Dependents: 2doejemplo Labo_TRSE_Drone
Fork of mbed by
TARGET_LPC4088_EA/TOOLCHAIN_GCC_ARM/LPC4088.ld@71:7ec3cb6bbcc4, 2013-11-29 (annotated)
- Committer:
- jalp89
- Date:
- Fri Nov 29 09:39:46 2013 +0000
- Revision:
- 71:7ec3cb6bbcc4
- Parent:
- 70:673126e12c73
...
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 70:673126e12c73 | 1 | /* Linker script for mbed LPC1768 */ |
bogdanm | 70:673126e12c73 | 2 | |
bogdanm | 70:673126e12c73 | 3 | /* Linker script to configure memory regions. */ |
bogdanm | 70:673126e12c73 | 4 | MEMORY |
bogdanm | 70:673126e12c73 | 5 | { |
bogdanm | 70:673126e12c73 | 6 | FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K |
bogdanm | 70:673126e12c73 | 7 | RAM (rwx) : ORIGIN = 0x100000E8, LENGTH = (32K - 0xE8) |
bogdanm | 70:673126e12c73 | 8 | |
bogdanm | 70:673126e12c73 | 9 | USB_RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 16K |
bogdanm | 70:673126e12c73 | 10 | ETH_RAM(rwx) : ORIGIN = 0x20004000, LENGTH = 16K |
bogdanm | 70:673126e12c73 | 11 | } |
bogdanm | 70:673126e12c73 | 12 | |
bogdanm | 70:673126e12c73 | 13 | /* Linker script to place sections and symbol values. Should be used together |
bogdanm | 70:673126e12c73 | 14 | * with other linker script that defines memory regions FLASH and RAM. |
bogdanm | 70:673126e12c73 | 15 | * It references following symbols, which must be defined in code: |
bogdanm | 70:673126e12c73 | 16 | * Reset_Handler : Entry of reset handler |
bogdanm | 70:673126e12c73 | 17 | * |
bogdanm | 70:673126e12c73 | 18 | * It defines following symbols, which code can use without definition: |
bogdanm | 70:673126e12c73 | 19 | * __exidx_start |
bogdanm | 70:673126e12c73 | 20 | * __exidx_end |
bogdanm | 70:673126e12c73 | 21 | * __etext |
bogdanm | 70:673126e12c73 | 22 | * __data_start__ |
bogdanm | 70:673126e12c73 | 23 | * __preinit_array_start |
bogdanm | 70:673126e12c73 | 24 | * __preinit_array_end |
bogdanm | 70:673126e12c73 | 25 | * __init_array_start |
bogdanm | 70:673126e12c73 | 26 | * __init_array_end |
bogdanm | 70:673126e12c73 | 27 | * __fini_array_start |
bogdanm | 70:673126e12c73 | 28 | * __fini_array_end |
bogdanm | 70:673126e12c73 | 29 | * __data_end__ |
bogdanm | 70:673126e12c73 | 30 | * __bss_start__ |
bogdanm | 70:673126e12c73 | 31 | * __bss_end__ |
bogdanm | 70:673126e12c73 | 32 | * __end__ |
bogdanm | 70:673126e12c73 | 33 | * end |
bogdanm | 70:673126e12c73 | 34 | * __HeapLimit |
bogdanm | 70:673126e12c73 | 35 | * __StackLimit |
bogdanm | 70:673126e12c73 | 36 | * __StackTop |
bogdanm | 70:673126e12c73 | 37 | * __stack |
bogdanm | 70:673126e12c73 | 38 | */ |
bogdanm | 70:673126e12c73 | 39 | ENTRY(Reset_Handler) |
bogdanm | 70:673126e12c73 | 40 | |
bogdanm | 70:673126e12c73 | 41 | SECTIONS |
bogdanm | 70:673126e12c73 | 42 | { |
bogdanm | 70:673126e12c73 | 43 | .text : |
bogdanm | 70:673126e12c73 | 44 | { |
bogdanm | 70:673126e12c73 | 45 | KEEP(*(.isr_vector)) |
bogdanm | 70:673126e12c73 | 46 | *(.text*) |
bogdanm | 70:673126e12c73 | 47 | |
bogdanm | 70:673126e12c73 | 48 | KEEP(*(.init)) |
bogdanm | 70:673126e12c73 | 49 | KEEP(*(.fini)) |
bogdanm | 70:673126e12c73 | 50 | |
bogdanm | 70:673126e12c73 | 51 | /* .ctors */ |
bogdanm | 70:673126e12c73 | 52 | *crtbegin.o(.ctors) |
bogdanm | 70:673126e12c73 | 53 | *crtbegin?.o(.ctors) |
bogdanm | 70:673126e12c73 | 54 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
bogdanm | 70:673126e12c73 | 55 | *(SORT(.ctors.*)) |
bogdanm | 70:673126e12c73 | 56 | *(.ctors) |
bogdanm | 70:673126e12c73 | 57 | |
bogdanm | 70:673126e12c73 | 58 | /* .dtors */ |
bogdanm | 70:673126e12c73 | 59 | *crtbegin.o(.dtors) |
bogdanm | 70:673126e12c73 | 60 | *crtbegin?.o(.dtors) |
bogdanm | 70:673126e12c73 | 61 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
bogdanm | 70:673126e12c73 | 62 | *(SORT(.dtors.*)) |
bogdanm | 70:673126e12c73 | 63 | *(.dtors) |
bogdanm | 70:673126e12c73 | 64 | |
bogdanm | 70:673126e12c73 | 65 | *(.rodata*) |
bogdanm | 70:673126e12c73 | 66 | |
bogdanm | 70:673126e12c73 | 67 | KEEP(*(.eh_frame*)) |
bogdanm | 70:673126e12c73 | 68 | } > FLASH |
bogdanm | 70:673126e12c73 | 69 | |
bogdanm | 70:673126e12c73 | 70 | .ARM.extab : |
bogdanm | 70:673126e12c73 | 71 | { |
bogdanm | 70:673126e12c73 | 72 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
bogdanm | 70:673126e12c73 | 73 | } > FLASH |
bogdanm | 70:673126e12c73 | 74 | |
bogdanm | 70:673126e12c73 | 75 | __exidx_start = .; |
bogdanm | 70:673126e12c73 | 76 | .ARM.exidx : |
bogdanm | 70:673126e12c73 | 77 | { |
bogdanm | 70:673126e12c73 | 78 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
bogdanm | 70:673126e12c73 | 79 | } > FLASH |
bogdanm | 70:673126e12c73 | 80 | __exidx_end = .; |
bogdanm | 70:673126e12c73 | 81 | |
bogdanm | 70:673126e12c73 | 82 | __etext = .; |
bogdanm | 70:673126e12c73 | 83 | |
bogdanm | 70:673126e12c73 | 84 | .data : AT (__etext) |
bogdanm | 70:673126e12c73 | 85 | { |
bogdanm | 70:673126e12c73 | 86 | __data_start__ = .; |
bogdanm | 70:673126e12c73 | 87 | Image$$RW_IRAM1$$Base = .; |
bogdanm | 70:673126e12c73 | 88 | *(vtable) |
bogdanm | 70:673126e12c73 | 89 | *(.data*) |
bogdanm | 70:673126e12c73 | 90 | |
bogdanm | 70:673126e12c73 | 91 | . = ALIGN(4); |
bogdanm | 70:673126e12c73 | 92 | /* preinit data */ |
bogdanm | 70:673126e12c73 | 93 | PROVIDE (__preinit_array_start = .); |
bogdanm | 70:673126e12c73 | 94 | KEEP(*(.preinit_array)) |
bogdanm | 70:673126e12c73 | 95 | PROVIDE (__preinit_array_end = .); |
bogdanm | 70:673126e12c73 | 96 | |
bogdanm | 70:673126e12c73 | 97 | . = ALIGN(4); |
bogdanm | 70:673126e12c73 | 98 | /* init data */ |
bogdanm | 70:673126e12c73 | 99 | PROVIDE (__init_array_start = .); |
bogdanm | 70:673126e12c73 | 100 | KEEP(*(SORT(.init_array.*))) |
bogdanm | 70:673126e12c73 | 101 | KEEP(*(.init_array)) |
bogdanm | 70:673126e12c73 | 102 | PROVIDE (__init_array_end = .); |
bogdanm | 70:673126e12c73 | 103 | |
bogdanm | 70:673126e12c73 | 104 | |
bogdanm | 70:673126e12c73 | 105 | . = ALIGN(4); |
bogdanm | 70:673126e12c73 | 106 | /* finit data */ |
bogdanm | 70:673126e12c73 | 107 | PROVIDE (__fini_array_start = .); |
bogdanm | 70:673126e12c73 | 108 | KEEP(*(SORT(.fini_array.*))) |
bogdanm | 70:673126e12c73 | 109 | KEEP(*(.fini_array)) |
bogdanm | 70:673126e12c73 | 110 | PROVIDE (__fini_array_end = .); |
bogdanm | 70:673126e12c73 | 111 | |
bogdanm | 70:673126e12c73 | 112 | . = ALIGN(4); |
bogdanm | 70:673126e12c73 | 113 | /* All data end */ |
bogdanm | 70:673126e12c73 | 114 | __data_end__ = .; |
bogdanm | 70:673126e12c73 | 115 | |
bogdanm | 70:673126e12c73 | 116 | } > RAM |
bogdanm | 70:673126e12c73 | 117 | |
bogdanm | 70:673126e12c73 | 118 | |
bogdanm | 70:673126e12c73 | 119 | .bss : |
bogdanm | 70:673126e12c73 | 120 | { |
bogdanm | 70:673126e12c73 | 121 | __bss_start__ = .; |
bogdanm | 70:673126e12c73 | 122 | *(.bss*) |
bogdanm | 70:673126e12c73 | 123 | *(COMMON) |
bogdanm | 70:673126e12c73 | 124 | __bss_end__ = .; |
bogdanm | 70:673126e12c73 | 125 | Image$$RW_IRAM1$$ZI$$Limit = . ; |
bogdanm | 70:673126e12c73 | 126 | } > RAM |
bogdanm | 70:673126e12c73 | 127 | |
bogdanm | 70:673126e12c73 | 128 | |
bogdanm | 70:673126e12c73 | 129 | .heap : |
bogdanm | 70:673126e12c73 | 130 | { |
bogdanm | 70:673126e12c73 | 131 | __end__ = .; |
bogdanm | 70:673126e12c73 | 132 | end = __end__; |
bogdanm | 70:673126e12c73 | 133 | *(.heap*) |
bogdanm | 70:673126e12c73 | 134 | __HeapLimit = .; |
bogdanm | 70:673126e12c73 | 135 | } > RAM |
bogdanm | 70:673126e12c73 | 136 | |
bogdanm | 70:673126e12c73 | 137 | /* .stack_dummy section doesn't contains any symbols. It is only |
bogdanm | 70:673126e12c73 | 138 | * used for linker to calculate size of stack sections, and assign |
bogdanm | 70:673126e12c73 | 139 | * values to stack symbols later */ |
bogdanm | 70:673126e12c73 | 140 | .stack_dummy : |
bogdanm | 70:673126e12c73 | 141 | { |
bogdanm | 70:673126e12c73 | 142 | *(.stack) |
bogdanm | 70:673126e12c73 | 143 | } > RAM |
bogdanm | 70:673126e12c73 | 144 | |
bogdanm | 70:673126e12c73 | 145 | /* Set stack top to end of RAM, and stack limit move down by |
bogdanm | 70:673126e12c73 | 146 | * size of stack_dummy section */ |
bogdanm | 70:673126e12c73 | 147 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
bogdanm | 70:673126e12c73 | 148 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
bogdanm | 70:673126e12c73 | 149 | PROVIDE(__stack = __StackTop); |
bogdanm | 70:673126e12c73 | 150 | |
bogdanm | 70:673126e12c73 | 151 | /* Check if data + heap + stack exceeds RAM limit */ |
bogdanm | 70:673126e12c73 | 152 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
bogdanm | 70:673126e12c73 | 153 | |
bogdanm | 70:673126e12c73 | 154 | |
bogdanm | 70:673126e12c73 | 155 | /* Code can explicitly ask for data to be |
bogdanm | 70:673126e12c73 | 156 | placed in these higher RAM banks where |
bogdanm | 70:673126e12c73 | 157 | they will be left uninitialized. |
bogdanm | 70:673126e12c73 | 158 | */ |
bogdanm | 70:673126e12c73 | 159 | .AHBSRAM0 (NOLOAD): |
bogdanm | 70:673126e12c73 | 160 | { |
bogdanm | 70:673126e12c73 | 161 | Image$$RW_IRAM2$$Base = . ; |
bogdanm | 70:673126e12c73 | 162 | *(AHBSRAM0) |
bogdanm | 70:673126e12c73 | 163 | Image$$RW_IRAM2$$ZI$$Limit = .; |
bogdanm | 70:673126e12c73 | 164 | } > USB_RAM |
bogdanm | 70:673126e12c73 | 165 | |
bogdanm | 70:673126e12c73 | 166 | .AHBSRAM1 (NOLOAD): |
bogdanm | 70:673126e12c73 | 167 | { |
bogdanm | 70:673126e12c73 | 168 | Image$$RW_IRAM3$$Base = . ; |
bogdanm | 70:673126e12c73 | 169 | *(AHBSRAM1) |
bogdanm | 70:673126e12c73 | 170 | Image$$RW_IRAM3$$ZI$$Limit = .; |
bogdanm | 70:673126e12c73 | 171 | } > ETH_RAM |
bogdanm | 70:673126e12c73 | 172 | } |