1TORS=".tors :
2  {
3    ___ctors = . ;
4    *(.ctors)
5    ___ctors_end = . ;
6    ___dtors = . ;
7    *(.dtors)
8    ___dtors_end = . ;
9    . = ALIGN(4);
10  } > ram"
11
12cat <<EOF
13OUTPUT_FORMAT("${OUTPUT_FORMAT}")
14OUTPUT_ARCH(${ARCH})
15${LIB_SEARCH_DIRS}
16
17MEMORY
18{
19  /* Note - we cannot use "PROVIDE(len)" ... "LENGTH = len" as
20     PROVIDE statements are not evaluated inside MEMORY blocks.  */
21  flash     (rx)   : ORIGIN = 0, LENGTH = 256K
22  ram       (rw!x) : ORIGIN = 0x800000, LENGTH = 64K
23}
24SECTIONS
25{
26  .text :
27  {
28    *(.text*)
29    *(.strings)
30    *(._pm*)
31    *(.init)
32    *(.fini)
33    ${RELOCATING+ _etext = . ; }
34    . = ALIGN(4);
35  } ${RELOCATING+ > flash}
36  ${CONSTRUCTING+${TORS}}
37  .data	: ${RELOCATING+ AT (ADDR (.text) + SIZEOF (.text))}
38  {
39    *(.data)
40    *(.rodata)
41    *(.rodata*)
42    ${RELOCATING+ _edata = . ; }
43  } ${RELOCATING+ > ram}
44  .bss  ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
45  {
46    ${RELOCATING+ _bss_start = . ; }
47    *(.bss)
48    *(COMMON)
49    ${RELOCATING+ _end = . ;  }
50  } ${RELOCATING+ > ram}
51
52  ${RELOCATING+ __data_load_start = LOADADDR(.data); }
53  ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
54
55  .stab 0 ${RELOCATING+(NOLOAD)} :
56  {
57    *(.stab)
58  }
59  .stabstr 0 ${RELOCATING+(NOLOAD)} :
60  {
61    *(.stabstr)
62  }
63EOF
64
65. $srcdir/scripttempl/DWARF.sc
66
67cat <<EOF
68}
69EOF
70