aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/tricore/link.ld
blob: 364bcdc00a605c602548cde00a510f5186e17585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-tricore")
OUTPUT_ARCH(tricore)
ENTRY(_start)

/* the internal ram description */
MEMORY
{
  text_ram (rx!p): org = 0x80000000, len = 15K
  data_ram (w!xp): org = 0xd0000000, len = 130K
}
/*
 * Define the sizes of the user and system stacks.
 */
__USTACK_SIZE = DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ;
/*
 * Define the start address and the size of the context save area.
 */
__CSA_BEGIN =  0xd0000000 ;
__CSA_SIZE =  8k ;
__CSA_END = __CSA_BEGIN + __CSA_SIZE ;

SECTIONS
{
  .text  :
  {
    *(.text)
    . = ALIGN(8);
  } > text_ram

  .rodata :
  {
    *(.rodata)
    *(.rodata1)
  } > data_ram

  .data :
  {
    . = ALIGN(8) ;
    *(.data)
    *(.data.*)
    . = ALIGN(8) ;
    __USTACK = . + __USTACK_SIZE -768;

  } > data_ram
  /*
   * Allocate space for BSS sections.
   */
  .bss  :
  {
    BSS_BASE = . ;
    *(.bss)
    *(COMMON)
    . = ALIGN(8) ;
  } > data_ram
  /* Make sure CSA, stack and heap addresses are properly aligned.  */
  _. = ASSERT ((__CSA_BEGIN & 0x3f) == 0 , "illegal CSA start address") ;
  _. = ASSERT ((__CSA_SIZE & 0x3f) == 0 , "illegal CSA size") ;

}