1
/* Default linker script, for normal executables */
2
OUTPUT_FORMAT("elf32-tricore")
6
/* __TC1762__ __TC13__ with Core TC1.3 */
7
__TRICORE_DERIVATE_MEMORY_MAP__ = 0x1762;
9
/* the internal FLASH description */
10
__EXT_CODE_RAM_BEGIN = 0xa0000000;
11
__EXT_CODE_RAM_SIZE = 1024K ;
12
/* the internal ram description */
13
__INT_CODE_RAM_BEGIN = 0xd4000000;
14
__INT_CODE_RAM_SIZE = 8K;
15
__INT_DATA_RAM_BEGIN = 0xd0000000;
16
__INT_DATA_RAM_SIZE = 32K;
17
__RAM_END = __INT_DATA_RAM_BEGIN + __INT_DATA_RAM_SIZE;
22
ext_cram (rx!p): org = 0xa0000000, len = 1024K
23
int_cram (rx!p): org = 0xd4000000, len = 8K
24
int_dram (w!xp): org = 0xd0002000, len = 24K
27
* Define the sizes of the user and system stacks.
29
__ISTACK_SIZE = DEFINED (__ISTACK_SIZE) ? __ISTACK_SIZE : 64 ;
30
__USTACK_SIZE = DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ;
32
* The heap is the memory between the top of the user stack and
33
* __RAM_END (as defined above); programs can dynamically allocate
34
* space in this area using malloc() and various other functions.
35
* Below you can define the minimum amount of memory that the heap
38
__HEAP_MIN = DEFINED (__HEAP_MIN) ? __HEAP_MIN : 512 ;
40
* Define the start address and the size of the context save area.
42
__CSA_BEGIN = DEFINED (__CSA_BEGIN) ? __CSA_BEGIN : 0xd0000000 ;
43
__CSA_SIZE = DEFINED (__CSA_SIZE) ? __CSA_SIZE : 8k ;
44
__CSA_END = __CSA_BEGIN + __CSA_SIZE ;
49
* The startup code should be placed where the CPU expects it after a reset,
50
* so we try to locate it first, no matter where it appears in the list of
51
* objects and libraries (note: because the wildcard pattern doesn't match
52
* directories, we'll try to find crt0.o in various (sub)directories).
56
KEEP (*(.startup_code))
60
* Allocate space for absolute addressable sections; this requires that
61
* "int_dram" starts at a TriCore segment (256M) and points to
62
* some RAM area! If these conditions are not met by your particular
63
* hardware setup, you should either not use absolute data, or you
64
* must move .zdata*,.zbss*,.bdata*,.bbss* input sections to some appropriate
90
} > int_dram AT> int_cram
93
* Allocate trap and interrupt vector tables.
115
* Allocate .text and other read-only sections.
123
* .gnu.warning sections are handled specially by elf32.em.
138
* Create the clear and copy tables that tell the startup code
139
* which memory areas to clear and to copy, respectively.
142
PROVIDE(__clear_table = .) ;
143
LONG(0 + ADDR(.bss)); LONG(SIZEOF(.bss));
144
LONG(0 + ADDR(.sbss)); LONG(SIZEOF(.sbss));
145
LONG(0 + ADDR(.zbss)); LONG(SIZEOF(.zbss));
147
PROVIDE(__copy_table = .) ;
148
LONG(LOADADDR(.data)); LONG(0 + ADDR(.data)); LONG(SIZEOF(.data));
149
LONG(LOADADDR(.sdata)); LONG(0 + ADDR(.sdata)); LONG(SIZEOF(.sdata));
150
LONG(LOADADDR(.zdata)); LONG(0 + ADDR(.zdata)); LONG(SIZEOF(.zdata));
151
LONG(-1); LONG(-1); LONG(-1);
161
* C++ exception handling tables. NOTE: gcc emits .eh_frame
162
* sections when compiling C sources with debugging enabled (-g).
163
* If you can be sure that your final application consists
164
* exclusively of C objects (i.e., no C++ objects), you may use
165
* the -R option of the "strip" and "objcopy" utilities to remove
166
* the .eh_frame section from the executable.
171
__EH_FRAME_BEGIN__ = . ;
173
__EH_FRAME_END__ = . ;
177
* Constructors and destructors.
182
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2);
191
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2);
198
* We're done now with the text part of the executable. The
199
* following sections are special in that their initial code or
200
* data (if any) must also be stored in said text part of an
201
* executable, but they "live" at completely different addresses
202
* at runtime -- usually in RAM areas. NOTE: This is not really
203
* necessary if you use a special program loader (e.g., a debugger)
204
* to load a complete executable consisting of code, data, BSS, etc.
205
* into the RAM of some target hardware or a simulator, but it *is*
206
* necessary if you want to burn your application into non-volatile
207
* memories such as EPROM or FLASH.
219
} > int_dram AT> int_cram
224
PROVIDE(__sdata_start = .);
229
} > int_dram AT> int_cram
232
PROVIDE(__sbss_start = .);
235
*(.gnu.linkonce.sb.*)
239
* Allocate space for BSS sections.
249
__ISTACK = . + __ISTACK_SIZE ;
250
__USTACK = __ISTACK + __USTACK_SIZE ;
252
__HEAP_END = __RAM_END ;
255
PROVIDE(end = _end) ;
256
/* Make sure CSA, stack and heap addresses are properly aligned. */
257
_. = ASSERT ((__CSA_BEGIN & 0x3f) == 0 , "illegal CSA start address") ;
258
_. = ASSERT ((__CSA_SIZE & 0x3f) == 0 , "illegal CSA size") ;
259
_. = ASSERT ((__ISTACK & 7) == 0 , "ISTACK not doubleword aligned") ;
260
_. = ASSERT ((__USTACK & 7) == 0 , "USTACK not doubleword aligned") ;
261
_. = ASSERT ((__HEAP_END & 7) == 0 , "HEAP not doubleword aligned") ;
263
/* Define a default symbol for address 0. */
264
NULL = DEFINED (NULL) ? NULL : 0 ;
266
* DWARF debug sections.
267
* Symbols in the DWARF debugging sections are relative to the
268
* beginning of the section, so we begin them at 0.
273
.comment 0 : { *(.comment) }
274
.debug 0 : { *(.debug) }
275
.line 0 : { *(.line) }
277
* GNU DWARF 1 extensions
279
.debug_srcinfo 0 : { *(.debug_srcinfo) }
280
.debug_sfnames 0 : { *(.debug_sfnames) }
282
* DWARF 1.1 and DWARF 2
284
.debug_aranges 0 : { *(.debug_aranges) }
285
.debug_pubnames 0 : { *(.debug_pubnames) }
289
.debug_info 0 : { *(.debug_info) }
290
.debug_abbrev 0 : { *(.debug_abbrev) }
291
.debug_line 0 : { *(.debug_line) }
292
.debug_frame 0 : { *(.debug_frame) }
293
.debug_str 0 : { *(.debug_str) }
294
.debug_loc 0 : { *(.debug_loc) }
295
.debug_macinfo 0 : { *(.debug_macinfo) }
296
.debug_ranges 0 : { *(.debug_ranges) }
298
* SGI/MIPS DWARF 2 extensions
300
.debug_weaknames 0 : { *(.debug_weaknames) }
301
.debug_funcnames 0 : { *(.debug_funcnames) }
302
.debug_typenames 0 : { *(.debug_typenames) }
303
.debug_varnames 0 : { *(.debug_varnames) }
305
* Optional sections that may only appear when relocating.
308
* Optional sections that may appear regardless of relocating.
310
.version_info 0 : { *(.version_info) }
311
.boffs 0 : { KEEP (*(.boffs)) }