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