aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/tricore/link.ld
blob: acc1758c419dceb85a939b8204020a35f3ef47c9 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* 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.
 */
__ISTACK_SIZE = DEFINED (__ISTACK_SIZE) ? __ISTACK_SIZE : 256 ;
__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 ;

__TESTDEVICE = 0xf0000000 ;

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

  .rodata :
  {
    *(.rodata)
    *(.rodata1)
    /*
     * Create the clear and copy tables that tell the startup code
     * which memory areas to clear and to copy, respectively.
     */
    . = ALIGN(4) ;
    PROVIDE(__clear_table = .) ;
    LONG(0 + ADDR(.bss));     LONG(SIZEOF(.bss));
    LONG(-1);                 LONG(-1);
    PROVIDE(__copy_table = .) ;
    LONG(LOADADDR(.data));    LONG(0 + ADDR(.data));    LONG(SIZEOF(.data));
    LONG(-1);                 LONG(-1);                 LONG(-1);
    . = ALIGN(8);
  } > data_ram

  .data :
  {
    . = ALIGN(8) ;
    *(.data)
    *(.data.*)
    . = ALIGN(8) ;
    __ISTACK = . + __ISTACK_SIZE ;
    __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") ;

}