1d2201f2fSdrahncat <<EOF
2d2201f2fSdrahnOUTPUT_FORMAT("mmo")
3d2201f2fSdrahnOUTPUT_ARCH(mmix)
4d2201f2fSdrahnENTRY(Main)
5d2201f2fSdrahnSECTIONS
6d2201f2fSdrahn{
7d2201f2fSdrahn  .text ${RELOCATING+ ${TEXT_START_ADDR}}:
8d2201f2fSdrahn  {
9d2201f2fSdrahn    *(.text)
10d2201f2fSdrahn    ${RELOCATING+*(.text.*)}
11d2201f2fSdrahn    ${RELOCATING+*(.gnu.linkonce.t*)}
12d2201f2fSdrahn    ${RELOCATING+*(.rodata)}
13d2201f2fSdrahn    ${RELOCATING+*(.rodata.*)}
14d2201f2fSdrahn    ${RELOCATING+*(.gnu.linkonce.r*)}
15d2201f2fSdrahn
16d2201f2fSdrahn    /* FIXME: Move .init, .fini, .ctors and .dtors to their own sections.  */
17d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_init_start = .);}
18d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_init = .);}
19d2201f2fSdrahn    ${RELOCATING+ KEEP (*(.init))}
20d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_init_end = .);}
21d2201f2fSdrahn
22d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_fini_start = .);}
23d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_fini = .);}
24d2201f2fSdrahn    ${RELOCATING+ KEEP (*(.fini))}
25d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_fini_end = .);}
26d2201f2fSdrahn
27d2201f2fSdrahn    /* FIXME: Align ctors, dtors, ehframe.  */
28d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_ctors_start = .);}
29d2201f2fSdrahn    ${RELOCATING+ PROVIDE (__ctors_start = .);}
30d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_ctors = .);}
31d2201f2fSdrahn    ${RELOCATING+ PROVIDE (__ctors = .);}
32d2201f2fSdrahn    ${RELOCATING+ KEEP (*crtbegin*.o(.ctors))}
33d2201f2fSdrahn    ${RELOCATING+ KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors))}
34d2201f2fSdrahn    ${RELOCATING+ KEEP (*(SORT(.ctors.*)))}
35d2201f2fSdrahn    ${RELOCATING+ KEEP (*(.ctors))}
36d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_ctors_end = .);}
37d2201f2fSdrahn    ${RELOCATING+ PROVIDE (__ctors_end = .);}
38d2201f2fSdrahn
39d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_dtors_start = .);}
40d2201f2fSdrahn    ${RELOCATING+ PROVIDE (__dtors_start = .);}
41d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_dtors = .);}
42d2201f2fSdrahn    ${RELOCATING+ PROVIDE (__dtors = .);}
43d2201f2fSdrahn    ${RELOCATING+ KEEP (*crtbegin*.o(.dtors))}
44d2201f2fSdrahn    ${RELOCATING+ KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors))}
45d2201f2fSdrahn    ${RELOCATING+ KEEP (*(SORT(.dtors.*)))}
46d2201f2fSdrahn    ${RELOCATING+ KEEP (*(.dtors))}
47d2201f2fSdrahn    ${RELOCATING+ PROVIDE (_dtors_end = .);}
48d2201f2fSdrahn    ${RELOCATING+ PROVIDE (__dtors_end = .);}
49d2201f2fSdrahn
50d2201f2fSdrahn    ${RELOCATING+KEEP (*(.jcr))}
51d2201f2fSdrahn    ${RELOCATING+KEEP (*(.eh_frame))}
52d2201f2fSdrahn    ${RELOCATING+*(.gcc_except_table)}
53d2201f2fSdrahn
54d2201f2fSdrahn    ${RELOCATING+ PROVIDE(etext = .);}
55d2201f2fSdrahn    ${RELOCATING+ PROVIDE(_etext = .);}
56d2201f2fSdrahn    ${RELOCATING+ PROVIDE(__etext = .);}
57d2201f2fSdrahn  }
58*cf2f2c56Smiod  ${RELOCATING+Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : ADDR (.text));}
59d2201f2fSdrahn
60d2201f2fSdrahn  .stab 0 : { *(.stab) }
61d2201f2fSdrahn  .stabstr 0 : { *(.stabstr) }
62d2201f2fSdrahn  .stab.excl 0 : { *(.stab.excl) }
63d2201f2fSdrahn  .stab.exclstr 0 : { *(.stab.exclstr) }
64d2201f2fSdrahn  .stab.index 0 : { *(.stab.index) }
65d2201f2fSdrahn  .stab.indexstr 0 : { *(.stab.indexstr) }
66d2201f2fSdrahn  .debug_aranges  0 : { *(.debug_aranges) }
67d2201f2fSdrahn  .debug_pubnames 0 : { *(.debug_pubnames) }
68d2201f2fSdrahn  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
69d2201f2fSdrahn  .debug_abbrev   0 : { *(.debug_abbrev) }
70d2201f2fSdrahn  .debug_line     0 : { *(.debug_line) }
71d2201f2fSdrahn  .debug_frame    0 : { *(.debug_frame) }
72d2201f2fSdrahn  .debug_str      0 : { *(.debug_str) }
73d2201f2fSdrahn  .debug_loc      0 : { *(.debug_loc) }
74d2201f2fSdrahn  .debug_macinfo  0 : { *(.debug_macinfo) }
75d2201f2fSdrahn  .debug_ranges   0 : { *(.debug_ranges) }
76d2201f2fSdrahn
77d2201f2fSdrahn  .data ${RELOCATING+ ${DATA_ADDR}}:
78d2201f2fSdrahn  {
79d2201f2fSdrahn    ${RELOCATING+ PROVIDE(__Sdata = .);}
80d2201f2fSdrahn
81d2201f2fSdrahn    *(.data);
82d2201f2fSdrahn    ${RELOCATING+*(.data.*)}
83d2201f2fSdrahn    ${RELOCATING+*(.gnu.linkonce.d*)}
84d2201f2fSdrahn
85d2201f2fSdrahn    ${RELOCATING+ PROVIDE(__Edata = .);}
86d2201f2fSdrahn
87d2201f2fSdrahn    /* Deprecated, use __Edata.  */
88d2201f2fSdrahn    ${RELOCATING+ PROVIDE(edata = .);}
89d2201f2fSdrahn    ${RELOCATING+ PROVIDE(_edata = .);}
90d2201f2fSdrahn    ${RELOCATING+ PROVIDE(__edata = .);}
91d2201f2fSdrahn  }
92d2201f2fSdrahn
93d2201f2fSdrahn  /* At the moment, although perhaps we should, we can't map sections
94d2201f2fSdrahn     without contents to sections *with* contents due to FIXME: a BFD bug.
95d2201f2fSdrahn     Anyway, the mmo back-end ignores sections without contents when
96d2201f2fSdrahn     writing out sections, so this works fine.   */
97d2201f2fSdrahn  .bss :
98d2201f2fSdrahn  {
99d2201f2fSdrahn    ${RELOCATING+ PROVIDE(__Sbss = .);}
100d2201f2fSdrahn    ${RELOCATING+ PROVIDE(__bss_start = .);}
101d2201f2fSdrahn    ${RELOCATING+ *(.sbss);}
102d2201f2fSdrahn    ${RELOCATING+ *(.bss);}
103d2201f2fSdrahn    ${RELOCATING+*(.bss.*)}
104d2201f2fSdrahn    ${RELOCATING+ *(COMMON);}
105d2201f2fSdrahn    ${RELOCATING+ PROVIDE(__Ebss = .);}
106d2201f2fSdrahn  }
107d2201f2fSdrahn
108d2201f2fSdrahn  /* Deprecated, use __Ebss or __Eall as appropriate.  */
109d2201f2fSdrahn  ${RELOCATING+ PROVIDE(end = .);}
110d2201f2fSdrahn  ${RELOCATING+ PROVIDE(_end = .);}
111d2201f2fSdrahn  ${RELOCATING+ PROVIDE(__end = .);}
112d2201f2fSdrahn  ${RELOCATING+ PROVIDE(__Eall = .);}
113d2201f2fSdrahn
114d2201f2fSdrahn  .MMIX.reg_contents :
115d2201f2fSdrahn  {
116d2201f2fSdrahn    /* Note that this section always has a fixed VMA - that of its
117d2201f2fSdrahn       first register * 8.  */
118d2201f2fSdrahn    *(.MMIX.reg_contents.linker_allocated);
119d2201f2fSdrahn    *(.MMIX.reg_contents);
120d2201f2fSdrahn  }
121d2201f2fSdrahn
122d2201f2fSdrahn  /* By default, put the high end of the stack where the register stack
123d2201f2fSdrahn     begins.  They grow in opposite directions.  */
124d2201f2fSdrahn  PROVIDE (__Stack_start = 0x6000000000000000);
125d2201f2fSdrahn
126d2201f2fSdrahn  /* Unfortunately, stabs are not mappable from ELF to MMO.
127d2201f2fSdrahn     It can probably be fixed with some amount of work.  */
128d2201f2fSdrahn  /DISCARD/ :
129d2201f2fSdrahn  { *(.gnu.warning.*); }
130d2201f2fSdrahn}
131d2201f2fSdrahnEOF
132