1*2159047fSniklas# These are substituted in as variables in order to get '}' in a shell
2*2159047fSniklas# conditional expansion.
3*2159047fSniklasINIT='.init : { *(.init) }'
4*2159047fSniklasFINI='.fini : { *(.fini) }'
5*2159047fSniklascat <<EOF
6*2159047fSniklasOUTPUT_FORMAT("${OUTPUT_FORMAT}")
7*2159047fSniklasOUTPUT_ARCH(${ARCH})
8*2159047fSniklasENTRY(__start)
9*2159047fSniklas${RELOCATING+${LIB_SEARCH_DIRS}}
10*2159047fSniklas
11*2159047fSniklasSECTIONS
12*2159047fSniklas{
13*2159047fSniklas  .text ${RELOCATING+ (0x20007 + SIZEOF_HEADERS) &~ 7} :
14*2159047fSniklas    {
15*2159047fSniklas      ${RELOCATING+ __.text.start = .};
16*2159047fSniklas      ${RELOCATING+ __.init.start = .};
17*2159047fSniklas      ${RELOCATING+ *(.init)}
18*2159047fSniklas      ${RELOCATING+ __.init.end = .};
19*2159047fSniklas      *(.text)
20*2159047fSniklas      ${RELOCATING+ __.tdesc_start = .};
21*2159047fSniklas      ${RELOCATING+ *(.tdesc)}
22*2159047fSniklas      ${RELOCATING+ __.text_end = .}	;
23*2159047fSniklas      ${RELOCATING+ __.initp.start = .};
24*2159047fSniklas      ${RELOCATING+ __.initp.end = .};
25*2159047fSniklas      ${RELOCATING+ __.fini_start = .};
26*2159047fSniklas      ${RELOCATING+ *(.fini) }
27*2159047fSniklas      ${RELOCATING+ __.fini_end = .};
28*2159047fSniklas      ${RELOCATING+_etext = .};
29*2159047fSniklas    }
30*2159047fSniklas  .data ${RELOCATING+ NEXT (0x400000) + ((SIZEOF(.text) + ADDR(.text)) % 0x2000)} :
31*2159047fSniklas    {
32*2159047fSniklas      *(.data)
33*2159047fSniklas      ${RELOCATING+_edata  =  .};
34*2159047fSniklas    }
35*2159047fSniklas  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
36*2159047fSniklas    {
37*2159047fSniklas      *(.bss)
38*2159047fSniklas      *(COMMON)
39*2159047fSniklas      ${RELOCATING+ _end = .};
40*2159047fSniklas      ${RELOCATING+ __end = .};
41*2159047fSniklas    }
42*2159047fSniklas  ${RELOCATING- ${INIT}}
43*2159047fSniklas  ${RELOCATING- ${FINI}}
44*2159047fSniklas  .comment  0 ${RELOCATING+(NOLOAD)} :
45*2159047fSniklas  {
46*2159047fSniklas    *(.comment)
47*2159047fSniklas  }
48*2159047fSniklas}
49*2159047fSniklasEOF
50