cat < imem} .data ${RELOCATING-0} : { /* Optional variable that user is prepared to have NULL address. */ ${RELOCATING+ *(.data.atzero*)} /* CRT is prepared for constructor/destructor table to have a "valid" NULL address. */ ${CONSTRUCTING+ _ctors_start = . ; } ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.ctors.*)))} ${CONSTRUCTING+ KEEP (*(.ctors))} ${CONSTRUCTING+ _ctors_end = . ; } ${CONSTRUCTING+ _dtors_start = . ; } ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.dtors.*)))} ${CONSTRUCTING+ KEEP (*(.dtors))} ${CONSTRUCTING+ _dtors_end = . ; } /* DATA memory starts at address 0. So to avoid placing a valid static variable at the invalid NULL address, we introduce the .data.atzero section. If CRT can make some use of it - great. Otherwise skip a word. In all cases .data/.bss sections must start at non-zero. */ . += (. == 0 ? 4 : 0); ${RELOCATING+ PROVIDE (_data_start = .) ; } *(.data) ${RELOCATING+ *(.data*)} ${RELOCATING+ *(.rodata) /* We need to include .rodata here if gcc is used. */} ${RELOCATING+ *(.rodata.*) /* with -fdata-sections. */} ${RELOCATING+*(.gnu.linkonce.d*)} ${RELOCATING+*(.gnu.linkonce.r*)} ${RELOCATING+. = ALIGN(4);} ${RELOCATING+ PROVIDE (_data_end = .) ; } } ${RELOCATING+ > dmem } .resource_table ${RELOCATING-0} : { *(.resource_table) KEEP (*(.resource_table)) } > dmem .bss ${RELOCATING-0} : { ${RELOCATING+ PROVIDE (_bss_start = .) ; } *(.bss) ${RELOCATING+ *(.bss.*)} ${RELOCATING+*(.gnu.linkonce.b*)} *(COMMON) ${RELOCATING+ PROVIDE (_bss_end = .) ; } } ${RELOCATING+ > dmem} /* Global data not cleared after reset. */ .noinit ${RELOCATING-0}: { ${RELOCATING+ PROVIDE (_noinit_start = .) ; } *(.noinit) ${RELOCATING+ PROVIDE (_noinit_end = .) ; } ${RELOCATING+ PROVIDE (_heap_start = .) ; } ${RELOCATING+ . += __HEAP_SIZE ; } /* Stack is not here really. It will be put at the end of DMEM. But we take into account its size here, in order to allow for MEMORY overflow checking during link time. */ ${RELOCATING+ . += __STACK_SIZE ; } } ${RELOCATING+ > dmem} /* Stabs debugging sections. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } .stab.exclstr 0 : { *(.stab.exclstr) } .stab.index 0 : { *(.stab.index) } .stab.indexstr 0 : { *(.stab.indexstr) } .comment 0 : { *(.comment) } .note.gnu.build-id : { *(.note.gnu.build-id) } EOF . $srcdir/scripttempl/DWARF.sc cat <