xref: /btstack/port/msp432p401lp-cc256x/linker_script_gcc.ld (revision f7529f1d2431b7f584bf8a875d1f2c4baaa3134c)
1*f7529f1dSMatthias Ringwald/******************************************************************************
2*f7529f1dSMatthias Ringwald*
3*f7529f1dSMatthias Ringwald* Copyright (C) 2012 - 2015 Texas Instruments Incorporated - http://www.ti.com/
4*f7529f1dSMatthias Ringwald*
5*f7529f1dSMatthias Ringwald* Redistribution and use in source and binary forms, with or without
6*f7529f1dSMatthias Ringwald* modification, are permitted provided that the following conditions
7*f7529f1dSMatthias Ringwald* are met:
8*f7529f1dSMatthias Ringwald*
9*f7529f1dSMatthias Ringwald*  Redistributions of source code must retain the above copyright
10*f7529f1dSMatthias Ringwald*  notice, this list of conditions and the following disclaimer.
11*f7529f1dSMatthias Ringwald*
12*f7529f1dSMatthias Ringwald*  Redistributions in binary form must reproduce the above copyright
13*f7529f1dSMatthias Ringwald*  notice, this list of conditions and the following disclaimer in the
14*f7529f1dSMatthias Ringwald*  documentation and/or other materials provided with the
15*f7529f1dSMatthias Ringwald*  distribution.
16*f7529f1dSMatthias Ringwald*
17*f7529f1dSMatthias Ringwald*  Neither the name of Texas Instruments Incorporated nor the names of
18*f7529f1dSMatthias Ringwald*  its contributors may be used to endorse or promote products derived
19*f7529f1dSMatthias Ringwald*  from this software without specific prior written permission.
20*f7529f1dSMatthias Ringwald*
21*f7529f1dSMatthias Ringwald* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22*f7529f1dSMatthias Ringwald* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23*f7529f1dSMatthias Ringwald* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24*f7529f1dSMatthias Ringwald* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25*f7529f1dSMatthias Ringwald* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26*f7529f1dSMatthias Ringwald* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27*f7529f1dSMatthias Ringwald* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28*f7529f1dSMatthias Ringwald* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29*f7529f1dSMatthias Ringwald* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30*f7529f1dSMatthias Ringwald* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31*f7529f1dSMatthias Ringwald* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32*f7529f1dSMatthias Ringwald*
33*f7529f1dSMatthias Ringwald* GCC linker script for Texas Instruments MSP432P401R
34*f7529f1dSMatthias Ringwald*
35*f7529f1dSMatthias Ringwald* File creation date: 2015-09-03
36*f7529f1dSMatthias Ringwald*
37*f7529f1dSMatthias Ringwald******************************************************************************/
38*f7529f1dSMatthias Ringwald
39*f7529f1dSMatthias RingwaldMEMORY
40*f7529f1dSMatthias Ringwald{
41*f7529f1dSMatthias Ringwald    MAIN_FLASH (RX) : ORIGIN = 0x00000000, LENGTH = 0x00040000
42*f7529f1dSMatthias Ringwald    INFO_FLASH (RX) : ORIGIN = 0x00200000, LENGTH = 0x00004000
43*f7529f1dSMatthias Ringwald    SRAM_CODE  (RWX): ORIGIN = 0x01000000, LENGTH = 0x00010000
44*f7529f1dSMatthias Ringwald    SRAM_DATA  (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
45*f7529f1dSMatthias Ringwald}
46*f7529f1dSMatthias Ringwald
47*f7529f1dSMatthias RingwaldREGION_ALIAS("REGION_TEXT", MAIN_FLASH);
48*f7529f1dSMatthias RingwaldREGION_ALIAS("REGION_BSS", SRAM_DATA);
49*f7529f1dSMatthias RingwaldREGION_ALIAS("REGION_DATA", SRAM_DATA);
50*f7529f1dSMatthias RingwaldREGION_ALIAS("REGION_STACK", SRAM_DATA);
51*f7529f1dSMatthias RingwaldREGION_ALIAS("REGION_HEAP", SRAM_DATA);
52*f7529f1dSMatthias RingwaldREGION_ALIAS("REGION_ARM_EXIDX", MAIN_FLASH);
53*f7529f1dSMatthias RingwaldREGION_ALIAS("REGION_ARM_EXTAB", MAIN_FLASH);
54*f7529f1dSMatthias Ringwald
55*f7529f1dSMatthias RingwaldSECTIONS {
56*f7529f1dSMatthias Ringwald
57*f7529f1dSMatthias Ringwald    PROVIDE (_intvecs_base_address =
58*f7529f1dSMatthias Ringwald        DEFINED(_intvecs_base_address) ? _intvecs_base_address : 0x0);
59*f7529f1dSMatthias Ringwald
60*f7529f1dSMatthias Ringwald    .intvecs (_intvecs_base_address) : AT (_intvecs_base_address) {
61*f7529f1dSMatthias Ringwald        KEEP (*(.intvecs))
62*f7529f1dSMatthias Ringwald    } > REGION_TEXT
63*f7529f1dSMatthias Ringwald
64*f7529f1dSMatthias Ringwald    PROVIDE (_vtable_base_address =
65*f7529f1dSMatthias Ringwald        DEFINED(_vtable_base_address) ? _vtable_base_address : 0x20000000);
66*f7529f1dSMatthias Ringwald
67*f7529f1dSMatthias Ringwald    .vtable (_vtable_base_address) : AT (_vtable_base_address) {
68*f7529f1dSMatthias Ringwald        KEEP (*(.vtable))
69*f7529f1dSMatthias Ringwald    } > REGION_DATA
70*f7529f1dSMatthias Ringwald
71*f7529f1dSMatthias Ringwald    .text : {
72*f7529f1dSMatthias Ringwald        CREATE_OBJECT_SYMBOLS
73*f7529f1dSMatthias Ringwald        KEEP (*(.text))
74*f7529f1dSMatthias Ringwald        *(.text.*)
75*f7529f1dSMatthias Ringwald        . = ALIGN(0x4);
76*f7529f1dSMatthias Ringwald        KEEP (*(.ctors))
77*f7529f1dSMatthias Ringwald        . = ALIGN(0x4);
78*f7529f1dSMatthias Ringwald        KEEP (*(.dtors))
79*f7529f1dSMatthias Ringwald        . = ALIGN(0x4);
80*f7529f1dSMatthias Ringwald        __init_array_start = .;
81*f7529f1dSMatthias Ringwald        KEEP (*(.init_array*))
82*f7529f1dSMatthias Ringwald        __init_array_end = .;
83*f7529f1dSMatthias Ringwald        *(.init)
84*f7529f1dSMatthias Ringwald        *(.fini*)
85*f7529f1dSMatthias Ringwald    } > REGION_TEXT AT> REGION_TEXT
86*f7529f1dSMatthias Ringwald
87*f7529f1dSMatthias Ringwald    .rodata : {
88*f7529f1dSMatthias Ringwald        *(.rodata)
89*f7529f1dSMatthias Ringwald        *(.rodata.*)
90*f7529f1dSMatthias Ringwald    } > REGION_TEXT AT> REGION_TEXT
91*f7529f1dSMatthias Ringwald
92*f7529f1dSMatthias Ringwald    .ARM.exidx : {
93*f7529f1dSMatthias Ringwald        __exidx_start = .;
94*f7529f1dSMatthias Ringwald        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
95*f7529f1dSMatthias Ringwald        __exidx_end = .;
96*f7529f1dSMatthias Ringwald    } > REGION_ARM_EXIDX AT> REGION_ARM_EXIDX
97*f7529f1dSMatthias Ringwald
98*f7529f1dSMatthias Ringwald    .ARM.extab : {
99*f7529f1dSMatthias Ringwald        *(.ARM.extab* .gnu.linkonce.armextab.*)
100*f7529f1dSMatthias Ringwald    } > REGION_ARM_EXTAB AT> REGION_ARM_EXTAB
101*f7529f1dSMatthias Ringwald
102*f7529f1dSMatthias Ringwald    __etext = .;
103*f7529f1dSMatthias Ringwald
104*f7529f1dSMatthias Ringwald    .data : {
105*f7529f1dSMatthias Ringwald        __data_load__ = LOADADDR (.data);
106*f7529f1dSMatthias Ringwald        __data_start__ = .;
107*f7529f1dSMatthias Ringwald        KEEP (*(.data))
108*f7529f1dSMatthias Ringwald        KEEP (*(.data*))
109*f7529f1dSMatthias Ringwald        . = ALIGN (4);
110*f7529f1dSMatthias Ringwald        __data_end__ = .;
111*f7529f1dSMatthias Ringwald    } > REGION_DATA AT> REGION_TEXT
112*f7529f1dSMatthias Ringwald
113*f7529f1dSMatthias Ringwald    .bss : {
114*f7529f1dSMatthias Ringwald        __bss_start__ = .;
115*f7529f1dSMatthias Ringwald        *(.shbss)
116*f7529f1dSMatthias Ringwald        KEEP (*(.bss))
117*f7529f1dSMatthias Ringwald        *(.bss.*)
118*f7529f1dSMatthias Ringwald        *(COMMON)
119*f7529f1dSMatthias Ringwald        . = ALIGN (4);
120*f7529f1dSMatthias Ringwald        __bss_end__ = .;
121*f7529f1dSMatthias Ringwald    } > REGION_BSS AT> REGION_BSS
122*f7529f1dSMatthias Ringwald
123*f7529f1dSMatthias Ringwald    .heap : {
124*f7529f1dSMatthias Ringwald        __heap_start__ = .;
125*f7529f1dSMatthias Ringwald        end = __heap_start__;
126*f7529f1dSMatthias Ringwald        _end = end;
127*f7529f1dSMatthias Ringwald        __end = end;
128*f7529f1dSMatthias Ringwald        KEEP (*(.heap))
129*f7529f1dSMatthias Ringwald        __heap_end__ = .;
130*f7529f1dSMatthias Ringwald        __HeapLimit = __heap_end__;
131*f7529f1dSMatthias Ringwald    } > REGION_HEAP AT> REGION_HEAP
132*f7529f1dSMatthias Ringwald
133*f7529f1dSMatthias Ringwald    .stack (NOLOAD) : ALIGN(0x8) {
134*f7529f1dSMatthias Ringwald        _stack = .;
135*f7529f1dSMatthias Ringwald        __stack = .;
136*f7529f1dSMatthias Ringwald        KEEP(*(.stack))
137*f7529f1dSMatthias Ringwald    } > REGION_STACK AT> REGION_STACK
138*f7529f1dSMatthias Ringwald}
139*f7529f1dSMatthias Ringwald
140