1 # 32 interrupt vectors + 32 trap vectors each of 4 bytes
2 # The .bss and .data sections need to be contiguous for direct addressing
3 # The data page pointer gets loaded with the start of .bss
4 # TI C compiler uses .cinit to initialise variables in .bss
6 test -z "$ENTRY" && ENTRY=_start
7 # These are substituted in as variables in order to get '}' in a shell
8 # conditional expansion.
9 INIT='.init : { *(.init) }'
10 FINI='.fini : { *(.fini) }'
12 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
13 OUTPUT_ARCH("${OUTPUT_ARCH}")
17 ${RELOCATING+ __SYSMEM_SIZE = DEFINED(__SYSMEM_SIZE) ? __SYSMEM_SIZE : 0x4000;}
18 ${RELOCATING+ __STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 0x1000;}
22 .comms ${RELOCATING+ 64} : {
25 .bss ${RELOCATING+ SIZEOF(.comms) + ADDR(.comms)} : {
26 ${RELOCATING+ .bss = .;}
29 ${RELOCATING+ end = .;}
30 ${RELOCATING+ _end = end;}
32 .data ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
34 ${RELOCATING+ .data = .;}
36 ${RELOCATING+ edata = .;}
38 .const ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
42 .cinit ${RELOCATING+ SIZEOF(.const) + ADDR(.const)} :
44 ${RELOCATING+ cinit = .;}
48 .text ${RELOCATING+ SIZEOF(.cinit) + ADDR(.cinit)} : {
49 ${RELOCATING+ .text = .;}
50 ${RELOCATING+ *(.init)}
52 ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
53 ${CONSTRUCTING+ LONG(___CTOR_END__ - ___CTOR_LIST__ - 2)}
54 ${CONSTRUCTING+ *(.ctors)}
55 ${CONSTRUCTING+ LONG(0);}
56 ${CONSTRUCTING+ ___CTOR_END__ = .;}
57 ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
58 ${CONSTRUCTING+ LONG(___DTOR_END__ - ___DTOR_LIST__ - 2)}
59 ${CONSTRUCTING+ *(.dtors)}
60 ${CONSTRUCTING+ LONG(0)}
61 ${CONSTRUCTING+ ___DTOR_END__ = .;}
62 ${RELOCATING+ *(.fini)}
63 ${RELOCATING+ etext = .;}
64 ${RELOCATING+ _etext = etext;}
66 .stack ${RELOCATING+ SIZEOF(.text) + ADDR(.text)} :
69 ${RELOCATING+ . = . + __STACK_SIZE};
71 .sysmem ${RELOCATING+ SIZEOF(.stack) + ADDR(.stack)} :
75 .heap ${RELOCATING+ SIZEOF(.sysmem) + ADDR(.sysmem)} :
77 ${RELOCATING+ . += __SYSMEM_SIZE - SIZEOF(.sysmem)};
79 ${RELOCATING- ${INIT}}
80 ${RELOCATING- ${FINI}}
81 .stab 0 ${RELOCATING+(NOLOAD)} :
85 .stabstr 0 ${RELOCATING+(NOLOAD)} :
89 /* The TI tools sets cinit to -1 if the ram model is used. */
90 ${RELOCATING+ cinit = SIZEOF(.cinit) == 1 ? cinit : -1;}