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