ads1115 only
Fork of mbed by
TARGET_ARCH_GPRS/TOOLCHAIN_GCC_ARM/LPC11U37.ld@88:9327015d4013, 2014-08-15 (annotated)
- Committer:
- bogdanm
- Date:
- Fri Aug 15 15:28:31 2014 +0100
- Revision:
- 88:9327015d4013
Release 88 of the mbed library
Main changes:
- changed "error.h" to "mbed_error.h" to avoid conflicts with 3rd party code
- LPC1549 SPI driver fixes
- K64F Ethernet TX buffer reclaim mechanism fix
- STDIO initialization fix
- NUCLEO_F334R8 I2C clock fix
- various other fixes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 88:9327015d4013 | 1 | /* Linker script to configure memory regions. */ |
bogdanm | 88:9327015d4013 | 2 | MEMORY |
bogdanm | 88:9327015d4013 | 3 | { |
bogdanm | 88:9327015d4013 | 4 | FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 128K |
bogdanm | 88:9327015d4013 | 5 | RAM (rwx) : ORIGIN = 0x100000C0, LENGTH = 0x1F40 |
bogdanm | 88:9327015d4013 | 6 | USB_RAM (rwx): ORIGIN = 0x20004000, LENGTH = 0x800 |
bogdanm | 88:9327015d4013 | 7 | } |
bogdanm | 88:9327015d4013 | 8 | |
bogdanm | 88:9327015d4013 | 9 | /* Linker script to place sections and symbol values. Should be used together |
bogdanm | 88:9327015d4013 | 10 | * with other linker script that defines memory regions FLASH and RAM. |
bogdanm | 88:9327015d4013 | 11 | * It references following symbols, which must be defined in code: |
bogdanm | 88:9327015d4013 | 12 | * Reset_Handler : Entry of reset handler |
bogdanm | 88:9327015d4013 | 13 | * |
bogdanm | 88:9327015d4013 | 14 | * It defines following symbols, which code can use without definition: |
bogdanm | 88:9327015d4013 | 15 | * __exidx_start |
bogdanm | 88:9327015d4013 | 16 | * __exidx_end |
bogdanm | 88:9327015d4013 | 17 | * __etext |
bogdanm | 88:9327015d4013 | 18 | * __data_start__ |
bogdanm | 88:9327015d4013 | 19 | * __preinit_array_start |
bogdanm | 88:9327015d4013 | 20 | * __preinit_array_end |
bogdanm | 88:9327015d4013 | 21 | * __init_array_start |
bogdanm | 88:9327015d4013 | 22 | * __init_array_end |
bogdanm | 88:9327015d4013 | 23 | * __fini_array_start |
bogdanm | 88:9327015d4013 | 24 | * __fini_array_end |
bogdanm | 88:9327015d4013 | 25 | * __data_end__ |
bogdanm | 88:9327015d4013 | 26 | * __bss_start__ |
bogdanm | 88:9327015d4013 | 27 | * __bss_end__ |
bogdanm | 88:9327015d4013 | 28 | * __end__ |
bogdanm | 88:9327015d4013 | 29 | * end |
bogdanm | 88:9327015d4013 | 30 | * __HeapLimit |
bogdanm | 88:9327015d4013 | 31 | * __StackLimit |
bogdanm | 88:9327015d4013 | 32 | * __StackTop |
bogdanm | 88:9327015d4013 | 33 | * __stack |
bogdanm | 88:9327015d4013 | 34 | */ |
bogdanm | 88:9327015d4013 | 35 | ENTRY(Reset_Handler) |
bogdanm | 88:9327015d4013 | 36 | |
bogdanm | 88:9327015d4013 | 37 | SECTIONS |
bogdanm | 88:9327015d4013 | 38 | { |
bogdanm | 88:9327015d4013 | 39 | .text : |
bogdanm | 88:9327015d4013 | 40 | { |
bogdanm | 88:9327015d4013 | 41 | KEEP(*(.isr_vector)) |
bogdanm | 88:9327015d4013 | 42 | *(.text.Reset_Handler) |
bogdanm | 88:9327015d4013 | 43 | |
bogdanm | 88:9327015d4013 | 44 | /* Only vectors and code running at reset are safe to be in first 512 |
bogdanm | 88:9327015d4013 | 45 | bytes since RAM can be mapped into this area for RAM based interrupt |
bogdanm | 88:9327015d4013 | 46 | vectors. */ |
bogdanm | 88:9327015d4013 | 47 | . = 0x00000200; |
bogdanm | 88:9327015d4013 | 48 | *(.text*) |
bogdanm | 88:9327015d4013 | 49 | |
bogdanm | 88:9327015d4013 | 50 | KEEP(*(.init)) |
bogdanm | 88:9327015d4013 | 51 | KEEP(*(.fini)) |
bogdanm | 88:9327015d4013 | 52 | |
bogdanm | 88:9327015d4013 | 53 | /* .ctors */ |
bogdanm | 88:9327015d4013 | 54 | *crtbegin.o(.ctors) |
bogdanm | 88:9327015d4013 | 55 | *crtbegin?.o(.ctors) |
bogdanm | 88:9327015d4013 | 56 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
bogdanm | 88:9327015d4013 | 57 | *(SORT(.ctors.*)) |
bogdanm | 88:9327015d4013 | 58 | *(.ctors) |
bogdanm | 88:9327015d4013 | 59 | |
bogdanm | 88:9327015d4013 | 60 | /* .dtors */ |
bogdanm | 88:9327015d4013 | 61 | *crtbegin.o(.dtors) |
bogdanm | 88:9327015d4013 | 62 | *crtbegin?.o(.dtors) |
bogdanm | 88:9327015d4013 | 63 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
bogdanm | 88:9327015d4013 | 64 | *(SORT(.dtors.*)) |
bogdanm | 88:9327015d4013 | 65 | *(.dtors) |
bogdanm | 88:9327015d4013 | 66 | |
bogdanm | 88:9327015d4013 | 67 | *(.rodata*) |
bogdanm | 88:9327015d4013 | 68 | |
bogdanm | 88:9327015d4013 | 69 | KEEP(*(.eh_frame*)) |
bogdanm | 88:9327015d4013 | 70 | } > FLASH |
bogdanm | 88:9327015d4013 | 71 | |
bogdanm | 88:9327015d4013 | 72 | .ARM.extab : |
bogdanm | 88:9327015d4013 | 73 | { |
bogdanm | 88:9327015d4013 | 74 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
bogdanm | 88:9327015d4013 | 75 | } > FLASH |
bogdanm | 88:9327015d4013 | 76 | |
bogdanm | 88:9327015d4013 | 77 | __exidx_start = .; |
bogdanm | 88:9327015d4013 | 78 | .ARM.exidx : |
bogdanm | 88:9327015d4013 | 79 | { |
bogdanm | 88:9327015d4013 | 80 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
bogdanm | 88:9327015d4013 | 81 | } > FLASH |
bogdanm | 88:9327015d4013 | 82 | __exidx_end = .; |
bogdanm | 88:9327015d4013 | 83 | |
bogdanm | 88:9327015d4013 | 84 | __etext = .; |
bogdanm | 88:9327015d4013 | 85 | |
bogdanm | 88:9327015d4013 | 86 | .data : AT (__etext) |
bogdanm | 88:9327015d4013 | 87 | { |
bogdanm | 88:9327015d4013 | 88 | __data_start__ = .; |
bogdanm | 88:9327015d4013 | 89 | *(vtable) |
bogdanm | 88:9327015d4013 | 90 | *(.data*) |
bogdanm | 88:9327015d4013 | 91 | |
bogdanm | 88:9327015d4013 | 92 | . = ALIGN(4); |
bogdanm | 88:9327015d4013 | 93 | /* preinit data */ |
bogdanm | 88:9327015d4013 | 94 | PROVIDE (__preinit_array_start = .); |
bogdanm | 88:9327015d4013 | 95 | KEEP(*(.preinit_array)) |
bogdanm | 88:9327015d4013 | 96 | PROVIDE (__preinit_array_end = .); |
bogdanm | 88:9327015d4013 | 97 | |
bogdanm | 88:9327015d4013 | 98 | . = ALIGN(4); |
bogdanm | 88:9327015d4013 | 99 | /* init data */ |
bogdanm | 88:9327015d4013 | 100 | PROVIDE (__init_array_start = .); |
bogdanm | 88:9327015d4013 | 101 | KEEP(*(SORT(.init_array.*))) |
bogdanm | 88:9327015d4013 | 102 | KEEP(*(.init_array)) |
bogdanm | 88:9327015d4013 | 103 | PROVIDE (__init_array_end = .); |
bogdanm | 88:9327015d4013 | 104 | |
bogdanm | 88:9327015d4013 | 105 | |
bogdanm | 88:9327015d4013 | 106 | . = ALIGN(4); |
bogdanm | 88:9327015d4013 | 107 | /* finit data */ |
bogdanm | 88:9327015d4013 | 108 | PROVIDE (__fini_array_start = .); |
bogdanm | 88:9327015d4013 | 109 | KEEP(*(SORT(.fini_array.*))) |
bogdanm | 88:9327015d4013 | 110 | KEEP(*(.fini_array)) |
bogdanm | 88:9327015d4013 | 111 | PROVIDE (__fini_array_end = .); |
bogdanm | 88:9327015d4013 | 112 | |
bogdanm | 88:9327015d4013 | 113 | . = ALIGN(4); |
bogdanm | 88:9327015d4013 | 114 | /* All data end */ |
bogdanm | 88:9327015d4013 | 115 | __data_end__ = .; |
bogdanm | 88:9327015d4013 | 116 | |
bogdanm | 88:9327015d4013 | 117 | } > RAM |
bogdanm | 88:9327015d4013 | 118 | |
bogdanm | 88:9327015d4013 | 119 | .bss : |
bogdanm | 88:9327015d4013 | 120 | { |
bogdanm | 88:9327015d4013 | 121 | __bss_start__ = .; |
bogdanm | 88:9327015d4013 | 122 | *(.bss*) |
bogdanm | 88:9327015d4013 | 123 | *(COMMON) |
bogdanm | 88:9327015d4013 | 124 | __bss_end__ = .; |
bogdanm | 88:9327015d4013 | 125 | } > RAM |
bogdanm | 88:9327015d4013 | 126 | |
bogdanm | 88:9327015d4013 | 127 | .heap : |
bogdanm | 88:9327015d4013 | 128 | { |
bogdanm | 88:9327015d4013 | 129 | __end__ = .; |
bogdanm | 88:9327015d4013 | 130 | end = __end__; |
bogdanm | 88:9327015d4013 | 131 | *(.heap*) |
bogdanm | 88:9327015d4013 | 132 | __HeapLimit = .; |
bogdanm | 88:9327015d4013 | 133 | } > RAM |
bogdanm | 88:9327015d4013 | 134 | |
bogdanm | 88:9327015d4013 | 135 | /* .stack_dummy section doesn't contains any symbols. It is only |
bogdanm | 88:9327015d4013 | 136 | * used for linker to calculate size of stack sections, and assign |
bogdanm | 88:9327015d4013 | 137 | * values to stack symbols later */ |
bogdanm | 88:9327015d4013 | 138 | .stack_dummy : |
bogdanm | 88:9327015d4013 | 139 | { |
bogdanm | 88:9327015d4013 | 140 | *(.stack) |
bogdanm | 88:9327015d4013 | 141 | } > RAM |
bogdanm | 88:9327015d4013 | 142 | |
bogdanm | 88:9327015d4013 | 143 | /* Set stack top to end of RAM, and stack limit move down by |
bogdanm | 88:9327015d4013 | 144 | * size of stack_dummy section */ |
bogdanm | 88:9327015d4013 | 145 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
bogdanm | 88:9327015d4013 | 146 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
bogdanm | 88:9327015d4013 | 147 | PROVIDE(__stack = __StackTop); |
bogdanm | 88:9327015d4013 | 148 | |
bogdanm | 88:9327015d4013 | 149 | /* Check if data + heap + stack exceeds RAM limit */ |
bogdanm | 88:9327015d4013 | 150 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
bogdanm | 88:9327015d4013 | 151 | } |