#---------------------------------------------------------------------------
#  Project:  TwlSDK - include
#  File:     ARM9-TS.lcf.template
#
#  Copyright 2007-2009 Nintendo.  All rights reserved.
#
#  These coded instructions, statements, and computer programs contain
#  proprietary information of Nintendo of America Inc. and/or Nintendo
#  Company Ltd., and are protected by Federal copyright law.  They may
#  not be disclosed to third parties or copied or duplicated in any form,
#  in whole or in part, without the prior written consent of Nintendo.
#
#  $Date:: 2010-04-02#$
#  $Rev: 11315 $
#  $Author: kitase_hirotake $
#---------------------------------------------------------------------------
MEMORY
{
	<STATIC.NAME>				(RWX) :	ORIGIN = <STATIC.ADDRESS>,		LENGTH = 0x0	>	<STATIC.NAME><PROPERTY.FLXSUFFIX>

	<FOREACH.AUTOLOADS>
	<AUTOLOAD.NAME>				(RWX) :	ORIGIN = <AUTOLOAD.ADDRESS>,	LENGTH = 0x0	>>	<STATIC.NAME><PROPERTY.FLXSUFFIX>
	<END.AUTOLOADS>
	binary.AUTOLOAD_INFO		(RWX) :	ORIGIN = 0,						LENGTH = 0x0	>>	<STATIC.NAME><PROPERTY.FLXSUFFIX>
	binary.STATIC_FOOTER		(RWX) :	ORIGIN = 0,						LENGTH = 0x0	>>	<STATIC.NAME><PROPERTY.FLXSUFFIX>

	<PROPERTY.OVERLAYDEFS>F		(RW)  :	ORIGIN = 0,						LENGTH = 0x0	>	<PROPERTY.OVERLAYDEFS><PROPERTY.FLXSUFFIX>
	<PROPERTY.OVERLAYTABLE>F	(RW)  :	ORIGIN = 0,						LENGTH = 0x0	>	<PROPERTY.OVERLAYTABLE><PROPERTY.FLXSUFFIX>
	<FOREACH.OVERLAYS>
	<OVERLAY.NAME>				(RWXO):	ORIGIN = <OVERLAY.ADDRESS>,		LENGTH = 0x0	>	<OVERLAY.NAME><PROPERTY.FLXSUFFIX>
	<END.OVERLAYS>

	dummy.MAIN_EX.NITRO			(RW)  :	ORIGIN = 0x023e0000,	LENGTH = 0x0
	arena.MAIN.NITRO			(RW)  :	ORIGIN = AFTER(<STATIC.NAME><FOREACH.OVERLAYS=MAIN>,<OVERLAY.NAME><END.OVERLAYS>),	LENGTH = 0x0
	arena.MAIN_EX.NITRO			(RW)  :	ORIGIN = AFTER(dummy.MAIN_EX.NITRO<FOREACH.OVERLAYS=MAINEX>,<OVERLAY.NAME><END.OVERLAYS>),	LENGTH = 0x0
	arena.ITCM					(RW)  :	ORIGIN = AFTER(ITCM<FOREACH.OVERLAYS=ITCM>,<OVERLAY.NAME><END.OVERLAYS>),	LENGTH = 0x0
	arena.DTCM					(RW)  :	ORIGIN = AFTER(DTCM<FOREACH.OVERLAYS=DTCM>,<OVERLAY.NAME><END.OVERLAYS>),	LENGTH = 0x0

	check.ITCM					(RW)  :	ORIGIN = 0x01ff8000,			LENGTH = 0x08000	>	itcm.check
	check.DTCM					(RW)  :	ORIGIN = 0x02fe0000,			LENGTH = 0x04000	>	dtcm.check
	check.MAIN.NITRO			(RW)  :	ORIGIN = 0x02000000,			LENGTH = 0x03e0000	>	main.nitro.check

	binary.LTDAUTOLOAD_TOP		(RW)  :	ORIGIN = 0,						LENGTH = 0x0	>	<STATIC.NAME><PROPERTY.LTDSUFFIX>
	<FOREACH.LTDAUTOLOADS>
	<LTDAUTOLOAD.NAME>			(RWX) :	ORIGIN = <LTDAUTOLOAD.ADDRESS>,	LENGTH = 0x0	>>	<STATIC.NAME><PROPERTY.LTDSUFFIX>
	<END.LTDAUTOLOADS>
	binary.LTDAUTOLOAD_INFO		(RWX) :	ORIGIN = 0,						LENGTH = 0x0	>>	<STATIC.NAME><PROPERTY.LTDSUFFIX>

	<PROPERTY.LTDOVERLAYDEFS>L	(RW)  :	ORIGIN = 0,						LENGTH = 0x0	>	<PROPERTY.LTDOVERLAYDEFS><PROPERTY.LTDSUFFIX>
	<PROPERTY.LTDOVERLAYTABLE>L	(RW)  :	ORIGIN = 0,						LENGTH = 0x0	>	<PROPERTY.LTDOVERLAYTABLE><PROPERTY.LTDSUFFIX>
	<FOREACH.LTDOVERLAYS>
	<LTDOVERLAY.NAME>			(RWXO):	ORIGIN = <LTDOVERLAY.ADDRESS>,	LENGTH = 0x0	>	<LTDOVERLAY.NAME><PROPERTY.LTDSUFFIX>
	<END.LTDOVERLAYS>

	dummy.MAIN_EX.TWL			(RW)  :	ORIGIN = 0x0d000000,	LENGTH = 0x0
	arena.MAIN.TWL				(RW)  :	ORIGIN = AFTER(<STATIC.NAME><FOREACH.OVERLAYS=MAIN>,<OVERLAY.NAME><END.OVERLAYS>,LTDMAIN<FOREACH.LTDOVERLAYS=MAIN>,<LTDOVERLAY.NAME><END.LTDOVERLAYS>),	LENGTH = 0x0
	arena.MAIN_EX.TWL			(RW)  :	ORIGIN = AFTER(dummy.MAIN_EX.TWL,<STATIC.NAME><FOREACH.OVERLAYS=MAIN>,<OVERLAY.NAME><END.OVERLAYS>,LTDMAIN<FOREACH.LTDOVERLAYS=MAIN>,<LTDOVERLAY.NAME><END.LTDOVERLAYS><FOREACH.AUTOLOADS>,<AUTOLOAD.NAME><END.AUTOLOADS>),	LENGTH = 0x0

	check.MAIN.TWL				(RW)  :	ORIGIN = 0x02000000,			LENGTH = 0x0f80000	>	main.twl.check

	binary.MODULE_FILES			(RW)  :	ORIGIN = 0,						LENGTH = 0x0	>	component.files
	binary.COMP_SPEC_LIST		(RW)  :	ORIGIN = 0,						LENGTH = 0x0	>	compspec.list
	COMMON__		(RW)  : ORIGIN = 0x0, LENGTH = 0x01400 > common.check
	PARENT__		(RW)  : ORIGIN = 0x0, LENGTH = 0x02000 > parent.check
}

FORCE_ACTIVE
{
	SVC_SoftReset
}

KEEP_SECTION
{
	.sinit
}

SECTIONS
{
	############################ STATIC #################################
	.<STATIC.NAME>:
	{
		ALIGNALL(4);
		. = ALIGN(32);	# Fit to cache line
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.STATIC.SEARCHSYMBOLS>
		SEARCH_SYMBOL <STATIC.SEARCHSYMBOL>;
		<END.STATIC.SEARCHSYMBOLS>
	
		#
		#  TEXT BLOCK: READ ONLY
		#
		SDK_STATIC_START		=.;
		SDK_STATIC_TEXT_START		=.;
				#:::::::::: text/rodata
				
					#:: Common A ----- 5KB
		SDK_STATIC_TEXT_COMMON_START	=.;
				libsyscall.a (.text)
				OBJECT(_start,*)
				<STATIC.CRT0.OBJECT=.text>
				<STATIC.CRT0.OBJECT=.rodata>
				#
				# .version セクションを追加しています。
				# このセクションに含まれる情報はロットチェックの際に
				# 必要となりますので、必ずこの位置に残すようにして下さい。
				#
				* (.version)
		SDK_STATIC_TEXT_COMMON_END	=.;
					.= SDK_STATIC_START +  5 * 1024;
					
					#:: Parent Only -- 8KB
		SDK_STATIC_TEXT_PARENT_START	=.;
	#
	# .parentセクションのコードを集める
	# .bss, .data セクションのコードが入らないよう注意！
					* (.parent)
	#
		SDK_STATIC_TEXT_PARENT_END	=.;
					.= SDK_STATIC_START + 13 * 1024;
					
					#:: Common B ----- 3KB + ...
				OBJECT(TwlMain,*)
				<FOREACH.STATIC.FORCES>
				FORCE_OBJECT<STATIC.FORCE>
				<END.STATIC.FORCES>
				<FOREACH.STATIC.OBJECTS=.text>
				<STATIC.OBJECT=.text:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.text>
				<STATIC.LIBRARY=.text:t>
				<END.STATIC.LIBRARIES>
				* (.exception)
		. = ALIGN(4);
		SDK_STATIC_ETABLE_START		=.;
		__exception_table_start__	=.;
				EXCEPTION
		__exception_table_end__		=.;
		SDK_STATIC_ETABLE_END		=.;
				<FOREACH.STATIC.OBJECTS=.rodata>
				<STATIC.OBJECT=.rodata:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.rodata>
				<STATIC.LIBRARY=.rodata:t>
				<END.STATIC.LIBRARIES>
				<FOREACH.STATIC.OBJECTS=.init>
				<STATIC.OBJECT=.init:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.init>
				<STATIC.LIBRARY=.init:t>
				<END.STATIC.LIBRARIES>
		. = ALIGN(4);
		SDK_STATIC_SINIT_START		=.;
				#:::::::::: ctor
				<FOREACH.STATIC.OBJECTS=.ctor>
				<STATIC.OBJECT=.ctor:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.ctor>
				<STATIC.LIBRARY=.ctor:t>
				<END.STATIC.LIBRARIES>
				<FOREACH.STATIC.OBJECTS=.sinit>
				<STATIC.OBJECT=.sinit:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.sinit>
				<STATIC.LIBRARY=.sinit:t>
				<END.STATIC.LIBRARIES>
				WRITEW	0;
				#:::::::::: ctor
		SDK_STATIC_SINIT_END		=.;
				#:::::::::: text/rodata
		SDK_STATIC_TEXT_END		=.;
	
		#
		#  DATA BLOCK: READ WRITE
		#
		. = ALIGN(32);	# Fit to cache line
		SDK_STATIC_DATA_START		=.;
				#:::::::::: data
				<FOREACH.STATIC.OBJECTS=.sdata>
				<STATIC.OBJECT=.sdata:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.sdata>
				<STATIC.LIBRARY=.sdata:t>
				<END.STATIC.LIBRARIES>
				<FOREACH.STATIC.OBJECTS=.data>
				<STATIC.OBJECT=.data:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.data>
				<STATIC.LIBRARY=.data:t>
				<END.STATIC.LIBRARIES>
				. = ALIGN(4);
				
		SDK_LTDOVERLAYTABLE_DIGEST	=.;
				. = . + 20;
		SDK_LTDOVERLAYTABLE_DIGEST_END	=.;
		SDK_OVERLAYTABLE_DIGEST	=.;
				. = . + 20;
		SDK_OVERLAYTABLE_DIGEST_END	=.;
		SDK_OVERLAY_DIGEST		=.;
				. = . + <NUMBER.OVERLAYS> * 20;
				. = . + <NUMBER.LTDOVERLAYS> * 20;
		SDK_OVERLAY_DIGEST_END	=.;
				#:::::::::: data
				. = ALIGN(32);
		SDK_STATIC_DATA_END		=.;
		SDK_STATIC_END			=.;
	
		SDK_STATIC_TEXT_SIZE	= SDK_STATIC_TEXT_END - SDK_STATIC_TEXT_START;
		SDK_STATIC_DATA_SIZE	= SDK_STATIC_DATA_END - SDK_STATIC_DATA_START;
		SDK_STATIC_SIZE			= SDK_STATIC_END      - SDK_STATIC_START;
		__sinit__				= SDK_STATIC_SINIT_START;	# for static initializer
	
	} > <STATIC.NAME>

	.<STATIC.NAME>.bss:
	{
		ALIGNALL(4);
		. = ALIGN(32);	# Fit to cache line
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.STATIC.SEARCHSYMBOLS>
		SEARCH_SYMBOL <STATIC.SEARCHSYMBOL>;
		<END.STATIC.SEARCHSYMBOLS>
	
		#
		#  BSS BLOCK
		#
		SDK_STATIC_BSS_START	=.;
				#:::::::::: bss
				<FOREACH.STATIC.OBJECTS=.sbss>
				<STATIC.OBJECT=.sbss:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.sbss>
				<STATIC.LIBRARY=.sbss:t>
				<END.STATIC.LIBRARIES>
				<FOREACH.STATIC.OBJECTS=.bss>
				<STATIC.OBJECT=.bss:t>
				<END.STATIC.OBJECTS>
				<FOREACH.STATIC.LIBRARIES=.bss>
				<STATIC.LIBRARY=.bss:t>
				<END.STATIC.LIBRARIES>
				#:::::::::: bss
		. = ALIGN(32);
		SDK_STATIC_BSS_END		= .;
	
		SDK_STATIC_BSS_SIZE		= SDK_STATIC_BSS_END - SDK_STATIC_BSS_START;

	} >> <STATIC.NAME>
	
	
	############################ AUTOLOADS ##############################
	SDK_AUTOLOAD.ITCM.START			= 0x01ff8000;
	SDK_AUTOLOAD.ITCM.END			= SDK_AUTOLOAD.ITCM.START;
	SDK_AUTOLOAD.ITCM.BSS_END		= SDK_AUTOLOAD.ITCM.START;
	SDK_AUTOLOAD.ITCM.SIZE			= 0;
	SDK_AUTOLOAD.ITCM.BSS_SIZE		= 0;
	SDK_AUTOLOAD.DTCM.START			= 0x02fe0000;
	SDK_AUTOLOAD.DTCM.END			= SDK_AUTOLOAD.DTCM.START;
	SDK_AUTOLOAD.DTCM.BSS_END		= SDK_AUTOLOAD.DTCM.START;
	SDK_AUTOLOAD.DTCM.SIZE			= 0;
	SDK_AUTOLOAD.DTCM.BSS_SIZE		= 0;
	SDK_AUTOLOAD_START				= SDK_STATIC_END;
	SDK_AUTOLOAD_SIZE				= 0;
	SDK_AUTOLOAD_NUMBER				= <NUMBER.AUTOLOADS>;

<FOREACH.AUTOLOADS>
	.<AUTOLOAD.NAME>:
	{
		ALIGNALL(4);
		. = ALIGN(32);

		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.AUTOLOAD.SEARCHSYMBOLS>
		SEARCH_SYMBOL <AUTOLOAD.SEARCHSYMBOL>;
		<END.AUTOLOAD.SEARCHSYMBOLS>
	
		#
		#   TEXT BLOCK: READ ONLY
		#
		SDK_AUTOLOAD_<AUTOLOAD.NAME>_ID		=<AUTOLOAD.ID>;
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.ID		=<AUTOLOAD.ID>;
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.START	=.;
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.TEXT_START	=.;
				#:::::::::: text/rodata
				<FOREACH.AUTOLOAD.FORCES>
				FORCE_OBJECT<AUTOLOAD.FORCE>
				<END.AUTOLOAD.FORCES>
				<FOREACH.AUTOLOAD.OBJECTS=.text>
				<AUTOLOAD.OBJECT=.text:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.text>
				<AUTOLOAD.LIBRARY=.text:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.rodata>
				<AUTOLOAD.OBJECT=.rodata:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.rodata>
				<AUTOLOAD.LIBRARY=.rodata:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.init>
				<AUTOLOAD.OBJECT=.init:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.init>
				<AUTOLOAD.LIBRARY=.init:t>
				<END.AUTOLOAD.LIBRARIES>
		. = ALIGN(4);
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.SINIT_START	= .;
				#:::::::::: ctor
				<FOREACH.AUTOLOAD.OBJECTS=.ctor>
				<AUTOLOAD.OBJECT=.ctor:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.ctor>
				<AUTOLOAD.LIBRARY=.ctor:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.sinit>
				<AUTOLOAD.OBJECT=.sinit:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.sinit>
				<AUTOLOAD.LIBRARY=.sinit:t>
				<END.AUTOLOAD.LIBRARIES>
				WRITEW 0;
				#:::::::::: ctor
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.SINIT_END	= .;
				#:::::::::: text/rodata
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.TEXT_END	=.;
	
		#
		#  DATA BLOCK: READ WRITE BLOCK
		#
		. = ALIGN(32);
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.DATA_START	=.;
				#:::::::::: data
				<FOREACH.AUTOLOAD.OBJECTS=.itcm>
				<AUTOLOAD.OBJECT=.itcm:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.itcm>
				<AUTOLOAD.LIBRARY=.itcm:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.dtcm>
				<AUTOLOAD.OBJECT=.dtcm:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.dtcm>
				<AUTOLOAD.LIBRARY=.dtcm:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.sdata>
				<AUTOLOAD.OBJECT=.sdata:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.sdata>
				<AUTOLOAD.LIBRARY=.sdata:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.data>
				<AUTOLOAD.OBJECT=.data:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.data>
				<AUTOLOAD.LIBRARY=.data:t>
				<END.AUTOLOAD.LIBRARIES>
				#:::::::::: data
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.DATA_END	=.;
		. = ALIGN(32);
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.END	=.;
	
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.TEXT_SIZE	= SDK_AUTOLOAD.<AUTOLOAD.NAME>.TEXT_END - SDK_AUTOLOAD.<AUTOLOAD.NAME>.TEXT_START;
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.DATA_SIZE	= SDK_AUTOLOAD.<AUTOLOAD.NAME>.DATA_END - SDK_AUTOLOAD.<AUTOLOAD.NAME>.DATA_START;
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.SIZE		= SDK_AUTOLOAD.<AUTOLOAD.NAME>.END      - SDK_AUTOLOAD.<AUTOLOAD.NAME>.START;
		SDK_AUTOLOAD_SIZE			= SDK_AUTOLOAD_SIZE + SDK_AUTOLOAD.<AUTOLOAD.NAME>.SIZE;
	
	} > <AUTOLOAD.NAME>

	.<AUTOLOAD.NAME>.bss:
	{
		ALIGNALL(4);
		. = ALIGN(32);
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.AUTOLOAD.SEARCHSYMBOLS>
		SEARCH_SYMBOL <AUTOLOAD.SEARCHSYMBOL>
		<END.AUTOLOAD.SEARCHSYMBOLS>
	
		#
		#  BSS BLOCK
		#
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.BSS_START	= .;
				#:::::::::: bss
				<FOREACH.AUTOLOAD.OBJECTS=.itcm>
				<AUTOLOAD.OBJECT=.itcm.bss:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.itcm>
				<AUTOLOAD.LIBRARY=.itcm.bss:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.dtcm>
				<AUTOLOAD.OBJECT=.dtcm.bss:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.dtcm>
				<AUTOLOAD.LIBRARY=.dtcm.bss:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.sbss>
				<AUTOLOAD.OBJECT=.sbss:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.sbss>
				<AUTOLOAD.LIBRARY=.sbss:t>
				<END.AUTOLOAD.LIBRARIES>
				<FOREACH.AUTOLOAD.OBJECTS=.bss>
				<AUTOLOAD.OBJECT=.bss:t>
				<END.AUTOLOAD.OBJECTS>
				<FOREACH.AUTOLOAD.LIBRARIES=.bss>
				<AUTOLOAD.LIBRARY=.bss:t>
				<END.AUTOLOAD.LIBRARIES>
				#:::::::::: bss
		. = ALIGN(32);
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.BSS_END	= .;
	
		SDK_AUTOLOAD.<AUTOLOAD.NAME>.BSS_SIZE	= SDK_AUTOLOAD.<AUTOLOAD.NAME>.BSS_END - SDK_AUTOLOAD.<AUTOLOAD.NAME>.BSS_START;
	
	} >> <AUTOLOAD.NAME>

<END.AUTOLOADS>

	SDK_AUTOLOAD_ITCM_START			= SDK_AUTOLOAD.ITCM.START;
	SDK_AUTOLOAD_ITCM_END			= SDK_AUTOLOAD.ITCM.END;
	SDK_AUTOLOAD_ITCM_BSS_END		= SDK_AUTOLOAD.ITCM.BSS_END;
	SDK_AUTOLOAD_ITCM_SIZE			= SDK_AUTOLOAD.ITCM.SIZE;
	SDK_AUTOLOAD_ITCM_BSS_SIZE		= SDK_AUTOLOAD.ITCM.BSS_SIZE;
	SDK_AUTOLOAD_DTCM_START			= SDK_AUTOLOAD.DTCM.START;
	SDK_AUTOLOAD_DTCM_END			= SDK_AUTOLOAD.DTCM.END;
	SDK_AUTOLOAD_DTCM_BSS_END		= SDK_AUTOLOAD.DTCM.BSS_END;
	SDK_AUTOLOAD_DTCM_SIZE			= SDK_AUTOLOAD.DTCM.SIZE;
	SDK_AUTOLOAD_DTCM_BSS_SIZE		= SDK_AUTOLOAD.DTCM.BSS_SIZE;

	############################ AUTOLOAD_INFO ##########################
	.binary.AUTOLOAD_INFO:
	{
		<FOREACH.AUTOLOADS>
				WRITEW ADDR(.<AUTOLOAD.NAME>);
				WRITEW SDK_AUTOLOAD.<AUTOLOAD.NAME>.SIZE;
				WRITEW SDK_AUTOLOAD.<AUTOLOAD.NAME>.SINIT_START;
				WRITEW SDK_AUTOLOAD.<AUTOLOAD.NAME>.BSS_SIZE;
		<END.AUTOLOADS>
	
	} > binary.AUTOLOAD_INFO
	
	SDK_AUTOLOAD_LIST		= SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE;
	SDK_AUTOLOAD_LIST_END	= SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE + SIZEOF(.binary.AUTOLOAD_INFO);
	SDK_AUTOLOAD_SIZE		= SDK_AUTOLOAD_SIZE  + SIZEOF(.binary.AUTOLOAD_INFO);

	############################ STATIC_FOOTER ##########################
	.binary.STATIC_FOOTER:
	{
		WRITEW 0xdec00621;		# LE(0x2106C0DE) = NITRO CODE
		WRITEW _start_ModuleParams - ADDR(.<STATIC.NAME>);
		WRITEW SDK_OVERLAY_DIGEST  - ADDR(.<STATIC.NAME>);
		WRITEW _start_LtdModuleParams - ADDR(.<STATIC.NAME>);
	} > binary.STATIC_FOOTER

	############################ OVERLAYS ###############################
	SDK_OVERLAY_NUMBER			= <NUMBER.OVERLAYS>;

<FOREACH.OVERLAYS>
	.<OVERLAY.NAME>:<OVERLAY.NAME>
	{
		ALIGNALL(4);
		. = ALIGN(32);	# Fit to cache line
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.OVERLAY.SEARCHSYMBOLS>
		SEARCH_SYMBOL <OVERLAY.SEARCHSYMBOL>;
		<END.OVERLAY.SEARCHSYMBOLS>
	
		#
		#   TEXT BLOCK: READ ONLY
		#
		SDK_OVERLAY_<OVERLAY.NAME>_ID		=<OVERLAY.ID>;	### SEGMENT <OVERLAY.NAME> OVERLAY ID
		SDK_OVERLAY.<OVERLAY.NAME>.ID		=<OVERLAY.ID>;
		SDK_OVERLAY.<OVERLAY.NAME>.START	=.;
		SDK_OVERLAY.<OVERLAY.NAME>.TEXT_START	=.;
				#:::::::::: text/rodata
				<FOREACH.OVERLAY.FORCES>
				FORCE_OBJECT<OVERLAY.FORCE>
				<END.OVERLAY.FORCES>
				<FOREACH.OVERLAY.OBJECTS=.text>
				<OVERLAY.OBJECT=.text:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.text>
				<OVERLAY.LIBRARY=.text:t>
				<END.OVERLAY.LIBRARIES>
				<FOREACH.OVERLAY.OBJECTS=.rodata>
				<OVERLAY.OBJECT=.rodata:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.rodata>
				<OVERLAY.LIBRARY=.rodata:t>
				<END.OVERLAY.LIBRARIES>
				<FOREACH.OVERLAY.OBJECTS=.init>
				<OVERLAY.OBJECT=.init:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.init>
				<OVERLAY.LIBRARY=.init:t>
				<END.OVERLAY.LIBRARIES>
		. = ALIGN(4);
		SDK_OVERLAY.<OVERLAY.NAME>.SINIT_START	=.;
				#:::::::::: ctor
				<FOREACH.OVERLAY.OBJECTS=.ctor>
				<OVERLAY.OBJECT=.ctor:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.ctor>
				<OVERLAY.LIBRARY=.ctor:t>
				<END.OVERLAY.LIBRARIES>
				<FOREACH.OVERLAY.OBJECTS=.sinit>
				<OVERLAY.OBJECT=.sinit:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.sinit>
				<OVERLAY.LIBRARY=.sinit:t>
				<END.OVERLAY.LIBRARIES>
				WRITEW	0;
				#:::::::::: ctor
		SDK_OVERLAY.<OVERLAY.NAME>.SINIT_END	=.;
				#:::::::::: text/rodata
		SDK_OVERLAY.<OVERLAY.NAME>.TEXT_END	=.;

		#
		#  DATA BLOCK: READ WRITE
		#
		. = ALIGN(32);
		SDK_OVERLAY.<OVERLAY.NAME>.DATA_START	=.;
				#:::::::::: data
				<FOREACH.OVERLAY.OBJECTS=.sdata>
				<OVERLAY.OBJECT=.sdata:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.sdata>
				<OVERLAY.LIBRARY=.sdata:t>
				<END.OVERLAY.LIBRARIES>
				<FOREACH.OVERLAY.OBJECTS=.data>
				<OVERLAY.OBJECT=.data:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.data>
				<OVERLAY.LIBRARY=.data:t>
				<END.OVERLAY.LIBRARIES>
				#:::::::::: data
		SDK_OVERLAY.<OVERLAY.NAME>.DATA_END	=.;
		. = ALIGN(32);
		SDK_OVERLAY.<OVERLAY.NAME>.END		=.;
	
		SDK_OVERLAY.<OVERLAY.NAME>.TEXT_SIZE	= SDK_OVERLAY.<OVERLAY.NAME>.TEXT_END - SDK_OVERLAY.<OVERLAY.NAME>.TEXT_START;
		SDK_OVERLAY.<OVERLAY.NAME>.DATA_SIZE	= SDK_OVERLAY.<OVERLAY.NAME>.DATA_END - SDK_OVERLAY.<OVERLAY.NAME>.DATA_START;
		SDK_OVERLAY.<OVERLAY.NAME>.SIZE			= SDK_OVERLAY.<OVERLAY.NAME>.END      - SDK_OVERLAY.<OVERLAY.NAME>.START;

	} > <OVERLAY.NAME>

	.<OVERLAY.NAME>.bss:<OVERLAY.NAME>
	{
		ALIGNALL(4);
		. = ALIGN(32);
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.OVERLAY.SEARCHSYMBOLS>
		SEARCH_SYMBOL <OVERLAY.SEARCHSYMBOL>;
		<END.OVERLAY.SEARCHSYMBOLS>
	
		#
		#  BSS BLOCK
		#
		SDK_OVERLAY.<OVERLAY.NAME>.BSS_START	= .;
				#:::::::::: bss
				<FOREACH.OVERLAY.OBJECTS=.bss>
				<OVERLAY.OBJECT=.bss:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.bss>
				<OVERLAY.LIBRARY=.bss:t>
				<END.OVERLAY.LIBRARIES>
				<FOREACH.OVERLAY.OBJECTS=.sbss>
				<OVERLAY.OBJECT=.sbss:t>
				<END.OVERLAY.OBJECTS>
				<FOREACH.OVERLAY.LIBRARIES=.sbss>
				<OVERLAY.LIBRARY=.sbss:t>
				<END.OVERLAY.LIBRARIES>
				#:::::::::: bss
		. = ALIGN(32);
		SDK_OVERLAY.<OVERLAY.NAME>.BSS_END	= .;
	
		SDK_OVERLAY.<OVERLAY.NAME>.BSS_SIZE	= SDK_OVERLAY.<OVERLAY.NAME>.BSS_END - SDK_OVERLAY.<OVERLAY.NAME>.BSS_START;
	
	} >> <OVERLAY.NAME>

<END.OVERLAYS>

	############################ OVERLAYDEFS ############################
	.<PROPERTY.OVERLAYDEFS>F:
	{
		###  <STATIC.NAME> module information 
				WRITEW ADDR(.<STATIC.NAME>);				# load address
				WRITEW _start;								# entry address
				WRITEW SDK_STATIC_SIZE + SDK_AUTOLOAD_SIZE;	# size of module
				WRITEW _start_AutoloadDoneCallback;			# callback autoload done
		
		###  overlay filename 
				<FOREACH.OVERLAYS>
				WRITES ("<OVERLAY.NAME><PROPERTY.FLXSUFFIX>");	# Overlay <OVERLAY.ID>
				<END.OVERLAYS>
	
	} > <PROPERTY.OVERLAYDEFS>F

	############################ OVERLAYTABLE ###########################
	.<PROPERTY.OVERLAYTABLE>F:
	{
		<FOREACH.OVERLAYS>
				WRITEW <OVERLAY.ID>;							# overlay ID
				WRITEW ADDR(.<OVERLAY.NAME>);					# load address
				WRITEW SDK_OVERLAY.<OVERLAY.NAME>.SIZE;			# size of module
				WRITEW SDK_OVERLAY.<OVERLAY.NAME>.BSS_SIZE;		# size of bss
				WRITEW SDK_OVERLAY.<OVERLAY.NAME>.SINIT_START;	# start address of static init
				WRITEW SDK_OVERLAY.<OVERLAY.NAME>.SINIT_END;	# end address of static init
				WRITEW <OVERLAY.ID>;							# ROM file ID
				WRITEW 0;										# compressed state
		<END.OVERLAYS>
	
	} > <PROPERTY.OVERLAYTABLE>F

	############################ ARENA ##################################
	.dummy.MAIN_EX.NITRO:
	{
		. = ALIGN(32);
	
	} > dummy.MAIN_EX.NITRO
	
	.arena.MAIN.NITRO:
	{
		. = ALIGN(32);
		SDK_SECTION_ARENA_START		=.;
	
	} > arena.MAIN.NITRO
	
	.arena.MAIN_EX.NITRO:
	{
		. = ALIGN(32);
		SDK_SECTION_ARENA_EX_START	=.;
	
	} > arena.MAIN_EX.NITRO
	
	.arena.ITCM:
	{
		. = ALIGN(32);
		SDK_SECTION_ARENA_ITCM_START	=.;
	
	} > arena.ITCM
	
	.arena.DTCM:
	{
		. = ALIGN(32);
		SDK_SECTION_ARENA_DTCM_START	=.;
	
	} > arena.DTCM

	############################ OTHERS #################################
	SDK_MAIN_ARENA_LO = SDK_SECTION_ARENA_START;
	SDK_IRQ_STACKSIZE = <STATIC.IRQSTACKSIZE>;	# allocated in DTCM
	SDK_SYS_STACKSIZE = <STATIC.STACKSIZE>;		# when 0 means all remains of DTCM
	SDK_SYS_STACKSIZE_SIGN = (SDK_SYS_STACKSIZE < 0x80000000) * 2 - 1;

	.check.ITCM:
	{
		. = SDK_SECTION_ARENA_ITCM_START;
	} > check.ITCM

	.check.DTCM:
	{
		. = SDK_SECTION_ARENA_DTCM_START;
		. = . + 0x080 + SDK_IRQ_STACKSIZE + SDK_SYS_STACKSIZE * SDK_SYS_STACKSIZE_SIGN;
	} > check.DTCM

	.check.MAIN.NITRO:
	{
		. = SDK_SECTION_ARENA_START;
	
	} > check.MAIN.NITRO
	
	.COMMON__:
	{
		. = . + SDK_STATIC_TEXT_COMMON_END - SDK_STATIC_TEXT_COMMON_START;
	} > COMMON__

	.PARENT__:
	{
		. = . + SDK_STATIC_TEXT_PARENT_END - SDK_STATIC_TEXT_PARENT_START;
	} > PARENT__

	########################### LTDAUTOLOADS ############################
	SDK_LTDAUTOLOAD.LTDMAIN.START		= SDK_STATIC_BSS_END;
	SDK_LTDAUTOLOAD.LTDMAIN.END			= SDK_LTDAUTOLOAD.LTDMAIN.START;
	SDK_LTDAUTOLOAD.LTDMAIN.BSS_END		= SDK_LTDAUTOLOAD.LTDMAIN.START;
	SDK_LTDAUTOLOAD.LTDMAIN.SIZE		= 0;
	SDK_LTDAUTOLOAD.LTDMAIN.BSS_SIZE	= 0;
	SDK_LTDAUTOLOAD_TOP_START			= 0x02400000;
	SDK_LTDAUTOLOAD_TOP_SIZE			= 4;	# STATIC 領域が無い代わりに 4 bytes のダミーがバイナリファイルの先頭に入る #
	SDK_LTDAUTOLOAD_START				= SDK_LTDAUTOLOAD_TOP_START + SDK_LTDAUTOLOAD_TOP_SIZE;
	SDK_LTDAUTOLOAD_SIZE				= 0;
	SDK_LTDAUTOLOAD_NUMBER				= <NUMBER.LTDAUTOLOADS>;

	.binary.LTDAUTOLOAD_TOP:
	{
				WRITEW 0;
	
	} > binary.LTDAUTOLOAD_TOP

<FOREACH.LTDAUTOLOADS>
	.<LTDAUTOLOAD.NAME>:
	{
		ALIGNALL(4);
		. = ALIGN(32);	# Fit to cache line
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.LTDAUTOLOAD.SEARCHSYMBOLS>
		SEARCH_SYMBOL <LTDAUTOLOAD.SEARCHSYMBOL>;
		<END.LTDAUTOLOAD.SEARCHSYMBOLS>
	
		SDK_LTDAUTOLOAD_<LTDAUTOLOAD.NAME>_ID		=<LTDAUTOLOAD.ID>;
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.ID		=<LTDAUTOLOAD.ID>;
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.START	=.;
		#
		#   TEXT BLOCK: READ ONLY
		#
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.TEXT_START	=.;
				#:::::::::: text/rodata
				<FOREACH.LTDAUTOLOAD.FORCES>
				FORCE_OBJECT<LTDAUTOLOAD.FORCE>
				<END.LTDAUTOLOAD.FORCES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.text>
				<LTDAUTOLOAD.OBJECT=.text:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.text>
				<LTDAUTOLOAD.LIBRARY=.text:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.rodata>
				<LTDAUTOLOAD.OBJECT=.rodata:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.rodata>
				<LTDAUTOLOAD.LIBRARY=.rodata:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.init>
				<LTDAUTOLOAD.OBJECT=.init:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.init>
				<LTDAUTOLOAD.LIBRARY=.init:t>
				<END.LTDAUTOLOAD.LIBRARIES>
		. = ALIGN(4);
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.SINIT_START	= .;
				#:::::::::: ctor
				<FOREACH.LTDAUTOLOAD.OBJECTS=.ctor>
				<LTDAUTOLOAD.OBJECT=.ctor:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.ctor>
				<LTDAUTOLOAD.LIBRARY=.ctor:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.sinit>
				<LTDAUTOLOAD.OBJECT=.sinit:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.sinit>
				<LTDAUTOLOAD.LIBRARY=.sinit:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				WRITEW 0;
				#:::::::::: ctor
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.SINIT_END	= .;
				#:::::::::: text/rodata
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.TEXT_END	=.;
	
		#
		#  DATA BLOCK: READ WRITE
		#
		. = ALIGN(32);
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.DATA_START	=.;
				#:::::::::: data
				<FOREACH.LTDAUTOLOAD.OBJECTS=.ltdmain>
				<LTDAUTOLOAD.OBJECT=.ltdmain:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.ltdmain>
				<LTDAUTOLOAD.LIBRARY=.ltdmain:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.sdata>
				<LTDAUTOLOAD.OBJECT=.sdata:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.sdata>
				<LTDAUTOLOAD.LIBRARY=.sdata:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.data>
				<LTDAUTOLOAD.OBJECT=.data:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.data>
				<LTDAUTOLOAD.LIBRARY=.data:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				#:::::::::: data
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.DATA_END	=.;
		. = ALIGN(32);
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.END	=.;
	
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.TEXT_SIZE	= SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.TEXT_END - SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.TEXT_START;
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.DATA_SIZE	= SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.DATA_END - SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.DATA_START;
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.SIZE			= SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.END      - SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.START;
		SDK_LTDAUTOLOAD_SIZE							= SDK_LTDAUTOLOAD_SIZE + SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.SIZE;
	
	} > <LTDAUTOLOAD.NAME>

	.<LTDAUTOLOAD.NAME>.bss:
	{
		ALIGNALL(4);
		. = ALIGN(32);
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.LTDAUTOLOAD.SEARCHSYMBOLS>
		SEARCH_SYMBOL <LTDAUTOLOAD.SEARCHSYMBOL>;
		<END.LTDAUTOLOAD.SEARCHSYMBOLS>
	
		#
		#  BSS BLOCK
		#
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.BSS_START	=.;
				#:::::::::: bss
				<FOREACH.LTDAUTOLOAD.OBJECTS=.ltdmain>
				<LTDAUTOLOAD.OBJECT=.ltdmain.bss:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.ltdmain>
				<LTDAUTOLOAD.LIBRARY=.ltdmain.bss:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.sbss>
				<LTDAUTOLOAD.OBJECT=.sbss:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.sbss>
				<LTDAUTOLOAD.LIBRARY=.sbss:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				<FOREACH.LTDAUTOLOAD.OBJECTS=.bss>
				<LTDAUTOLOAD.OBJECT=.bss:t>
				<END.LTDAUTOLOAD.OBJECTS>
				<FOREACH.LTDAUTOLOAD.LIBRARIES=.bss>
				<LTDAUTOLOAD.LIBRARY=.bss:t>
				<END.LTDAUTOLOAD.LIBRARIES>
				#:::::::::: bss
		. = ALIGN(32);
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.BSS_END	=.;
	
		SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.BSS_SIZE		= SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.BSS_END - SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.BSS_START;
	
	} >> <LTDAUTOLOAD.NAME>

<END.LTDAUTOLOADS>

	SDK_LTDAUTOLOAD_LTDMAIN_START		= SDK_LTDAUTOLOAD.LTDMAIN.START;
	SDK_LTDAUTOLOAD_LTDMAIN_END			= SDK_LTDAUTOLOAD.LTDMAIN.END;
	SDK_LTDAUTOLOAD_LTDMAIN_BSS_END		= SDK_LTDAUTOLOAD.LTDMAIN.BSS_END;
	SDK_LTDAUTOLOAD_LTDMAIN_SIZE		= SDK_LTDAUTOLOAD.LTDMAIN.SIZE;
	SDK_LTDAUTOLOAD_LTDMAIN_BSS_SIZE	= SDK_LTDAUTOLOAD.LTDMAIN.BSS_SIZE;

	######################### LTDAUTOLOAD_INFO ##########################
	.binary.LTDAUTOLOAD_INFO:
	{
		<FOREACH.LTDAUTOLOADS>
				WRITEW ADDR(.<LTDAUTOLOAD.NAME>);
				WRITEW SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.SIZE;
				WRITEW SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.SINIT_START;
				WRITEW SDK_LTDAUTOLOAD.<LTDAUTOLOAD.NAME>.BSS_SIZE;
		<END.LTDAUTOLOADS>
	
	} > binary.LTDAUTOLOAD_INFO

	SDK_LTDAUTOLOAD_LIST		= SDK_LTDAUTOLOAD_START + SDK_LTDAUTOLOAD_SIZE;
	SDK_LTDAUTOLOAD_LIST_END	= SDK_LTDAUTOLOAD_LIST + SIZEOF(.binary.LTDAUTOLOAD_INFO);
	SDK_LTDAUTOLOAD_SIZE		= SDK_LTDAUTOLOAD_SIZE + SIZEOF(.binary.LTDAUTOLOAD_INFO);

	########################### LTDOVERLAYS #############################
	SDK_LTDOVERLAY_NUMBER			= <NUMBER.LTDOVERLAYS>;

<FOREACH.LTDOVERLAYS>
	.<LTDOVERLAY.NAME>:<LTDOVERLAY.NAME>
	{
		ALIGNALL(4);
		. = ALIGN(32);
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.LTDOVERLAY.SEARCHSYMBOLS>
		SEARCH_SYMBOL <LTDOVERLAY.SEARCHSYMBOL>;
		<END.LTDOVERLAY.SEARCHSYMBOLS>
	
		SDK_LTDOVERLAY_<LTDOVERLAY.NAME>_ID			=<LTDOVERLAY.ID>;
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.ID			=<LTDOVERLAY.ID>;
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.START		=.;
		#
		#  TEXT BLOCK: READ ONLY
		#
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.TEXT_START	=.;
				#:::::::::: text/rodata
				<FOREACH.LTDOVERLAY.FORCES>
				FORCE_OBJECT<LTDOVERLAY.FORCE>
				<END.LTDOVERLAY.FORCES>
				<FOREACH.LTDOVERLAY.OBJECTS=.text>
				<LTDOVERLAY.OBJECT=.text:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.text>
				<LTDOVERLAY.LIBRARY=.text:t>
				<END.LTDOVERLAY.LIBRARIES>
				<FOREACH.LTDOVERLAY.OBJECTS=.rodata>
				<LTDOVERLAY.OBJECT=.rodata:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.rodata>
				<LTDOVERLAY.LIBRARY=.rodata:t>
				<END.LTDOVERLAY.LIBRARIES>
				<FOREACH.LTDOVERLAY.OBJECTS=.init>
				<LTDOVERLAY.OBJECT=.init:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.init>
				<LTDOVERLAY.LIBRARY=.init:t>
				<END.LTDOVERLAY.LIBRARIES>
		. = ALIGN(4);
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.SINIT_START	=.;
				#:::::::::: ctor
				<FOREACH.LTDOVERLAY.OBJECTS=.ctor>
				<LTDOVERLAY.OBJECT=.ctor:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.ctor>
				<LTDOVERLAY.LIBRARY=.ctor:t>
				<END.LTDOVERLAY.LIBRARIES>
				<FOREACH.LTDOVERLAY.OBJECTS=.sinit>
				<LTDOVERLAY.OBJECT=.sinit:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.sinit>
				<LTDOVERLAY.LIBRARY=.sinit:t>
				<END.LTDOVERLAY.LIBRARIES>
				WRITEW	0;
				#:::::::::: ctor
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.SINIT_END	=.;
				#:::::::::: text/rodata
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.TEXT_END	=.;
	
		#
		#  DATA BLOCK: READ WRITE
		#
		. = ALIGN(32);
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.DATA_START	=.;
				#:::::::::: data
				<FOREACH.LTDOVERLAY.OBJECTS=.sdata>
				<LTDOVERLAY.OBJECT=.sdata:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.sdata>
				<LTDOVERLAY.LIBRARY=.sdata:t>
				<END.LTDOVERLAY.LIBRARIES>
				<FOREACH.LTDOVERLAY.OBJECTS=.data>
				<LTDOVERLAY.OBJECT=.data:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.data>
				<LTDOVERLAY.LIBRARY=.data:t>
				<END.LTDOVERLAY.LIBRARIES>
				#:::::::::: data
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.DATA_END	=.;
		. = ALIGN(32);
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.END		=.;
	
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.TEXT_SIZE	= SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.TEXT_END - SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.TEXT_START;
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.DATA_SIZE	= SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.DATA_END - SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.DATA_START;
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.SIZE		= SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.END      - SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.START;
	
	} > <LTDOVERLAY.NAME>

	.<LTDOVERLAY.NAME>.bss:<LTDOVERLAY.NAME>
	{
		ALIGNALL(4);
		. = ALIGN(32);
	
		#
		#  Definition to refer overlay segment, when same name symbols exist in multiple overlays.
		#
		<FOREACH.LTDOVERLAY.SEARCHSYMBOLS>
		SEARCH_SYMBOL <LTDOVERLAY.SEARCHSYMBOL>;
		<END.LTDOVERLAY.SEARCHSYMBOLS>
	
		#
		#  BSS BLOCK
		#
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.BSS_START	=.;
				#:::::::::: bss
				<FOREACH.LTDOVERLAY.OBJECTS=.bss>
				<LTDOVERLAY.OBJECT=.bss:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.bss>
				<LTDOVERLAY.LIBRARY=.bss:t>
				<END.LTDOVERLAY.LIBRARIES>
				<FOREACH.LTDOVERLAY.OBJECTS=.sbss>
				<LTDOVERLAY.OBJECT=.sbss:t>
				<END.LTDOVERLAY.OBJECTS>
				<FOREACH.LTDOVERLAY.LIBRARIES=.sbss>
				<LTDOVERLAY.LIBRARY=.sbss:t>
				<END.LTDOVERLAY.LIBRARIES>
				#:::::::::: bss
		. = ALIGN(32);
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.BSS_END	=.;
	
		SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.BSS_SIZE	= SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.BSS_END - SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.BSS_START;
	
	} >> <LTDOVERLAY.NAME>

<END.LTDOVERLAYS>

	########################## LTDOVERLAYDEFS ###########################
	.<PROPERTY.LTDOVERLAYDEFS>L:
	{
		###  TWL limited extended static module information
				WRITEW SDK_LTDAUTOLOAD_TOP_START;						# load address
				WRITEW 0;												# padding
				WRITEW SDK_LTDAUTOLOAD_SIZE + SDK_LTDAUTOLOAD_TOP_SIZE;	# size of module
				WRITEW 0;												# padding
		
		###  TWL limited overlay filename
				<FOREACH.LTDOVERLAYS>
				WRITES ("<LTDOVERLAY.NAME><PROPERTY.LTDSUFFIX>");
				<END.LTDOVERLAYS>
	
	} > <PROPERTY.LTDOVERLAYDEFS>L

	######################### LTDOVERLAYTABLE ###########################
	.<PROPERTY.LTDOVERLAYTABLE>L:
	{
		<FOREACH.LTDOVERLAYS>
				WRITEW <LTDOVERLAY.ID>;									# overlay ID
				WRITEW ADDR(.<LTDOVERLAY.NAME>);						# load address
				WRITEW SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.SIZE;			# size of module
				WRITEW SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.BSS_SIZE;		# size of bss
				WRITEW SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.SINIT_START;	# start address of static init
				WRITEW SDK_LTDOVERLAY.<LTDOVERLAY.NAME>.SINIT_END;		# end address of static init
				WRITEW <LTDOVERLAY.ID>;									# ROM file ID
				WRITEW 0;												# compressed state
		<END.LTDOVERLAYS>
	
	} > <PROPERTY.LTDOVERLAYTABLE>L

	############################ ARENA ##################################
	.dummy.MAIN_EX.TWL:
	{
		. = ALIGN(32);
	
	} > dummy.MAIN_EX.TWL

	.arena.MAIN.TWL:
	{
		. = ALIGN(32);
		SDK_LTDMAIN_ARENA_LO	=.;
	
	} > arena.MAIN.TWL

	.arena.MAIN_EX.TWL:
	{
		. = ALIGN(32);
		SDK_LTDMAIN_EX_ARENA_LO	=.;
	
	} > arena.MAIN_EX.TWL

	.check.MAIN.TWL:
	{
		. = SDK_LTDMAIN_ARENA_LO;
	
	} > check.MAIN.TWL

	############################ OTHERS #################################
	# Module filelist
	.binary.MODULE_FILES:
	{
		WRITES ("<STATIC.NAME><PROPERTY.FLXSUFFIX>");
		WRITES ("<PROPERTY.OVERLAYDEFS><PROPERTY.FLXSUFFIX>");
		WRITES ("<PROPERTY.OVERLAYTABLE><PROPERTY.FLXSUFFIX>");
		WRITES ("<STATIC.NAME><PROPERTY.LTDSUFFIX>");
		WRITES ("<PROPERTY.LTDOVERLAYDEFS><PROPERTY.LTDSUFFIX>");
		WRITES ("<PROPERTY.LTDOVERLAYTABLE><PROPERTY.LTDSUFFIX>");
	
	} > binary.MODULE_FILES

	# Compression Spec List
	.binary.COMP_SPEC_LIST:
	{
		<FOREACH.OVERLAYS>
		WRITES ("<OVERLAY.NAME><PROPERTY.FLXSUFFIX>,<OVERLAY.COMPRESS>");	# Overlay <OVERLAY.ID>
		<END.OVERLAYS>
		<FOREACH.LTDOVERLAYS>
		WRITES ("<LTDOVERLAY.NAME><PROPERTY.LTDSUFFIX>,<LTDOVERLAY.COMPRESS>");	# Overlay <LTDOVERLAY.ID>
		<END.LTDOVERLAYS>
	} > binary.COMP_SPEC_LIST

}
