|
| 1 | +/***************************************************************************** |
| 2 | +* Product: Linker script for EK-TM4C123GXL, GNU-ARM linker |
| 3 | +* Last Updated for Version: 5.9.8 |
| 4 | +* Date of the Last Update: 2017-09-13 |
| 5 | +* |
| 6 | +* Q u a n t u m L e a P s |
| 7 | +* --------------------------- |
| 8 | +* innovating embedded systems |
| 9 | +* |
| 10 | +* Copyright (C) Quantum Leaps, LLC. All rights reserved. |
| 11 | +* |
| 12 | +*****************************************************************************/ |
| 13 | +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") |
| 14 | +OUTPUT_ARCH(arm) |
| 15 | +ENTRY(Reset_Handler) /* entry Point */ |
| 16 | + |
| 17 | +MEMORY { /* memory map of Tiva TM4C123GH6PM */ |
| 18 | + ROM (rx) : ORIGIN = 0x00000000, LENGTH = 256K |
| 19 | + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K |
| 20 | +} |
| 21 | + |
| 22 | +/* The size of the stack used by the application. NOTE: you need to adjust */ |
| 23 | +STACK_SIZE = 2048; |
| 24 | + |
| 25 | +/* The size of the heap used by the application. NOTE: you need to adjust */ |
| 26 | +HEAP_SIZE = 0; |
| 27 | + |
| 28 | +SECTIONS { |
| 29 | + |
| 30 | + .isr_vector : { /* the vector table goes FIRST into ROM */ |
| 31 | + KEEP(*(.isr_vector)) /* vector table */ |
| 32 | + . = ALIGN(4); |
| 33 | + } >ROM |
| 34 | + |
| 35 | + .text : { /* code and constants */ |
| 36 | + . = ALIGN(4); |
| 37 | + *(.text) /* .text sections (code) */ |
| 38 | + *(.text*) /* .text* sections (code) */ |
| 39 | + *(.rodata) /* .rodata sections (constants, strings, etc.) */ |
| 40 | + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ |
| 41 | + |
| 42 | + KEEP (*(.init)) |
| 43 | + KEEP (*(.fini)) |
| 44 | + |
| 45 | + . = ALIGN(4); |
| 46 | + } >ROM |
| 47 | + |
| 48 | + .preinit_array : { |
| 49 | + PROVIDE_HIDDEN (__preinit_array_start = .); |
| 50 | + KEEP (*(.preinit_array*)) |
| 51 | + PROVIDE_HIDDEN (__preinit_array_end = .); |
| 52 | + } >ROM |
| 53 | + |
| 54 | + .init_array : { |
| 55 | + PROVIDE_HIDDEN (__init_array_start = .); |
| 56 | + KEEP (*(SORT(.init_array.*))) |
| 57 | + KEEP (*(.init_array*)) |
| 58 | + PROVIDE_HIDDEN (__init_array_end = .); |
| 59 | + } >ROM |
| 60 | + |
| 61 | + .fini_array : { |
| 62 | + PROVIDE_HIDDEN (__fini_array_start = .); |
| 63 | + KEEP (*(.fini_array*)) |
| 64 | + KEEP (*(SORT(.fini_array.*))) |
| 65 | + PROVIDE_HIDDEN (__fini_array_end = .); |
| 66 | + } >ROM |
| 67 | + |
| 68 | + _etext = .; /* global symbols at end of code */ |
| 69 | + |
| 70 | + .stack : { |
| 71 | + __stack_start__ = .; |
| 72 | + . = . + STACK_SIZE; |
| 73 | + . = ALIGN(4); |
| 74 | + __stack_end__ = .; |
| 75 | + } >RAM |
| 76 | + |
| 77 | + .data : AT (_etext) { |
| 78 | + __data_load = LOADADDR (.data); |
| 79 | + __data_start = .; |
| 80 | + *(.data) /* .data sections */ |
| 81 | + *(.data*) /* .data* sections */ |
| 82 | + . = ALIGN(4); |
| 83 | + __data_end__ = .; |
| 84 | + _edata = __data_end__; |
| 85 | + } >RAM |
| 86 | + |
| 87 | + .bss : { |
| 88 | + __bss_start__ = .; |
| 89 | + *(.bss) |
| 90 | + *(.bss*) |
| 91 | + *(COMMON) |
| 92 | + . = ALIGN(4); |
| 93 | + _ebss = .; /* define a global symbol at bss end */ |
| 94 | + __bss_end__ = .; |
| 95 | + } >RAM |
| 96 | + |
| 97 | + __exidx_start = .; |
| 98 | + .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >RAM |
| 99 | + __exidx_end = .; |
| 100 | + |
| 101 | + PROVIDE ( end = _ebss ); |
| 102 | + PROVIDE ( _end = _ebss ); |
| 103 | + PROVIDE ( __end__ = _ebss ); |
| 104 | + |
| 105 | + .heap : { |
| 106 | + __heap_start__ = .; |
| 107 | + . = . + HEAP_SIZE; |
| 108 | + . = ALIGN(4); |
| 109 | + __heap_end__ = .; |
| 110 | + } >RAM |
| 111 | + |
| 112 | + /* Remove information from the standard libraries */ |
| 113 | + /DISCARD/ : { |
| 114 | + libc.a ( * ) |
| 115 | + libm.a ( * ) |
| 116 | + libgcc.a ( * ) |
| 117 | + } |
| 118 | +} |
0 commit comments