1
/* Default linker script, for normal executables */
2
OUTPUT_FORMAT("elf32-tricore")
6
/* __TC1766__ __TC13__ with Core TC1.3 */
7
__TRICORE_DERIVATE_MEMORY_MAP__ = 0x1766;
8
/* the internal FLASH description */
9
__EXT_CODE_RAM_BEGIN = 0xa0000000;
10
__EXT_CODE_RAM_SIZE = 1504K ;
11
/* the internal ram description */
12
__INT_CODE_RAM_BEGIN = 0xd4000000;
13
__INT_CODE_RAM_SIZE = 16K;
14
__INT_DATA_RAM_BEGIN = 0xd0000000;
15
__INT_DATA_RAM_SIZE = 56K;
16
__RAM_END = __INT_DATA_RAM_BEGIN + __INT_DATA_RAM_SIZE;
17
/* the pcp memory description */
18
__PCP_CODE_RAM_BEGIN = 0xf0060000;
19
__PCP_CODE_RAM_SIZE = 12K;
20
__PCP_DATA_RAM_BEGIN = 0xf0050000;
21
__PCP_DATA_RAM_SIZE = 8K;
26
ext_cram (rx!p): org = 0xa0000000, len = 1504K
27
int_cram (rx!p): org = 0xd4000000, len = 16K
28
int_dram (w!xp): org = 0xd0002000, len = 48K
29
pcp_data (wp!x): org = 0xf0050000, len = 8K
30
pcp_text (rxp): org = 0xf0060000, len = 12K
33
* Define the sizes of the user and system stacks.
35
__ISTACK_SIZE = DEFINED (__ISTACK_SIZE) ? __ISTACK_SIZE : 64 ;
36
__USTACK_SIZE = DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ;
38
* The heap is the memory between the top of the user stack and
39
* __RAM_END (as defined above); programs can dynamically allocate
40
* space in this area using malloc() and various other functions.
41
* Below you can define the minimum amount of memory that the heap
44
__HEAP_MIN = DEFINED (__HEAP_MIN) ? __HEAP_MIN : 512 ;
46
* Define the start address and the size of the context save area.
48
__CSA_BEGIN = DEFINED (__CSA_BEGIN) ? __CSA_BEGIN : 0xd0000000 ;
49
__CSA_SIZE = DEFINED (__CSA_SIZE) ? __CSA_SIZE : 8k ;
50
__CSA_END = __CSA_BEGIN + __CSA_SIZE ;
55
* The startup code should be placed where the CPU expects it after a reset,
56
* so we try to locate it first, no matter where it appears in the list of
57
* objects and libraries (note: because the wildcard pattern doesn't match
58
* directories, we'll try to find crt0.o in various (sub)directories).
62
KEEP (*(.startup_code))
66
* Allocate space for absolute addressable sections; this requires that
67
* "int_dram" starts at a TriCore segment (256M) and points to
68
* some RAM area! If these conditions are not met by your particular
69
* hardware setup, you should either not use absolute data, or you
70
* must move .zdata*,.zbss*,.bdata*,.bbss* input sections to some appropriate
96
} > int_dram AT> int_cram
99
* Allocate trap and interrupt vector tables.
121
* Allocate .text and other read-only sections.
131
* .gnu.warning sections are handled specially by elf32.em.
146
* Create the clear and copy tables that tell the startup code
147
* which memory areas to clear and to copy, respectively.
150
PROVIDE(__clear_table = .) ;
151
LONG(0 + ADDR(.bss)); LONG(SIZEOF(.bss));
152
LONG(0 + ADDR(.sbss)); LONG(SIZEOF(.sbss));
153
LONG(0 + ADDR(.zbss)); LONG(SIZEOF(.zbss));
155
PROVIDE(__copy_table = .) ;
156
LONG(LOADADDR(.data)); LONG(0 + ADDR(.data)); LONG(SIZEOF(.data));
157
LONG(LOADADDR(.sdata)); LONG(0 + ADDR(.sdata)); LONG(SIZEOF(.sdata));
158
LONG(LOADADDR(.zdata)); LONG(0 + ADDR(.zdata)); LONG(SIZEOF(.zdata));
159
LONG(LOADADDR(.pcpdata)); LONG(0 + ADDR(.pcpdata)); LONG(SIZEOF(.pcpdata));
160
LONG(LOADADDR(.pcptext)); LONG(0 + ADDR(.pcptext)); LONG(SIZEOF(.pcptext));
161
LONG(-1); LONG(-1); LONG(-1);
171
* C++ exception handling tables. NOTE: gcc emits .eh_frame
172
* sections when compiling C sources with debugging enabled (-g).
173
* If you can be sure that your final application consists
174
* exclusively of C objects (i.e., no C++ objects), you may use
175
* the -R option of the "strip" and "objcopy" utilities to remove
176
* the .eh_frame section from the executable.
181
__EH_FRAME_BEGIN__ = . ;
183
__EH_FRAME_END__ = . ;
187
* Constructors and destructors.
192
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2);
201
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2);
208
* We're done now with the text part of the executable. The
209
* following sections are special in that their initial code or
210
* data (if any) must also be stored in said text part of an
211
* executable, but they "live" at completely different addresses
212
* at runtime -- usually in RAM areas. NOTE: This is not really
213
* necessary if you use a special program loader (e.g., a debugger)
214
* to load a complete executable consisting of code, data, BSS, etc.
215
* into the RAM of some target hardware or a simulator, but it *is*
216
* necessary if you want to burn your application into non-volatile
217
* memories such as EPROM or FLASH.
226
} > pcp_text AT> int_cram
234
} > pcp_data AT> int_cram
245
} > int_dram AT> int_cram
250
PROVIDE(__sdata_start = .);
255
} > int_dram AT> int_cram
258
PROVIDE(__sbss_start = .);
261
*(.gnu.linkonce.sb.*)
265
* Allocate space for BSS sections.
275
__ISTACK = . + __ISTACK_SIZE ;
276
__USTACK = __ISTACK + __USTACK_SIZE ;
278
__HEAP_END = __RAM_END ;
281
PROVIDE(end = _end) ;
282
/* Make sure CSA, stack and heap addresses are properly aligned. */
283
_. = ASSERT ((__CSA_BEGIN & 0x3f) == 0 , "illegal CSA start address") ;
284
_. = ASSERT ((__CSA_SIZE & 0x3f) == 0 , "illegal CSA size") ;
285
_. = ASSERT ((__ISTACK & 7) == 0 , "ISTACK not doubleword aligned") ;
286
_. = ASSERT ((__USTACK & 7) == 0 , "USTACK not doubleword aligned") ;
287
_. = ASSERT ((__HEAP_END & 7) == 0 , "HEAP not doubleword aligned") ;
289
/* Define a default symbol for address 0. */
290
NULL = DEFINED (NULL) ? NULL : 0 ;
292
* DWARF debug sections.
293
* Symbols in the DWARF debugging sections are relative to the
294
* beginning of the section, so we begin them at 0.
299
.comment 0 : { *(.comment) }
300
.debug 0 : { *(.debug) }
301
.line 0 : { *(.line) }
303
* GNU DWARF 1 extensions
305
.debug_srcinfo 0 : { *(.debug_srcinfo) }
306
.debug_sfnames 0 : { *(.debug_sfnames) }
308
* DWARF 1.1 and DWARF 2
310
.debug_aranges 0 : { *(.debug_aranges) }
311
.debug_pubnames 0 : { *(.debug_pubnames) }
315
.debug_info 0 : { *(.debug_info) }
316
.debug_abbrev 0 : { *(.debug_abbrev) }
317
.debug_line 0 : { *(.debug_line) }
318
.debug_frame 0 : { *(.debug_frame) }
319
.debug_str 0 : { *(.debug_str) }
320
.debug_loc 0 : { *(.debug_loc) }
321
.debug_macinfo 0 : { *(.debug_macinfo) }
322
.debug_ranges 0 : { *(.debug_ranges) }
324
* SGI/MIPS DWARF 2 extensions
326
.debug_weaknames 0 : { *(.debug_weaknames) }
327
.debug_funcnames 0 : { *(.debug_funcnames) }
328
.debug_typenames 0 : { *(.debug_typenames) }
329
.debug_varnames 0 : { *(.debug_varnames) }
331
* Optional sections that may only appear when relocating.
334
* Optional sections that may appear regardless of relocating.
336
.version_info 0 : { *(.version_info) }
337
.boffs 0 : { KEEP (*(.boffs)) }