+TORS="
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
-MEMORY {
- rom : o = 0x0000, l = 0x7fe0
- duart : o = 0x7fe0, l = 16
- ram : o = 0x8000, l = 28k
- topram : o = 0x8000+28k, l = 1k
- hmsram : o = 0xfb80, l = 512
- }
+/* Code and data 64k total */
-SECTIONS
-{
-.text :
- {
- *(.text)
- *(.strings)
- ${RELOCATING+ _etext = . ; }
- } ${RELOCATING+ > ram}
-.data :
+SECTIONS
+{
+.text ${RELOCATING+ 0x0000} :
{
- *(.data)
- ${RELOCATING+ _edata = . ; }
- } ${RELOCATING+ > ram}
-.bss :
+ *(.text)
+ ${RELOCATING+ _etext = . ; }
+ }
+
+.data ${RELOCATING+ . } :
{
- ${RELOCATING+ _bss_start = . ;}
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
- } ${RELOCATING+ >ram}
-.stack :
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
+ }
+
+.rdata ${RELOCATING+ . } :
{
- ${RELOCATING+ _stack = . ; }
- *(.stack)
- } ${RELOCATING+ > topram}
-}
-EOF
+ *(.rdata);
+ *(.strings)
+
+ ${CONSTRUCTING+${TORS}}
+ }
+.bss ${RELOCATING+ . } :
+ {
+ ${RELOCATING+ __start_bss = . ; }
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
+ }
+.stack ${RELOCATING+ 0xfff0} :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
+ }
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+}
+EOF