<!--
	LSC
 
	Copyright 2010-2021 IS2T. All rights reserved.
	Modification and distribution is permitted under certain conditions.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->
<lscFragment>
	<!--
		Linker file for converting ELF SOAR relocatable file to target ELF relocatable.
		This file defines the default SOAR layout for both static and dynamic link. 	
	-->

	<!-- 
		Soar image code. Fixed position due to _java_SOAR_BASE_ADDRESS fixed.
	-->	
 	<defSection name=".rodata.microej.soar" start="0" end="0x7fffffff" align="16"/>
 	
 	<defSymbol name=".rodata.microej.soar$$Base" value="START(.rodata.microej.soar)" rootSymbol="true"/>

 	<!-- 
 		Soar runtime linked in RAM (statics). Floating position.
 	-->
 	<defSection name=".bss.microej.statics" start="0" end="0x7fffffff" align="8"/>	
 
	<!-- Symbol needed when calling start(.bss.soar.xxx) -->
	<defSymbol name=".bss.soar.BT1$$Base" value="START(SOAR_STATICS_BT1)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.BT1$$Limit" value="END(SOAR_STATICS_BT1)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.BT2$$Base" value="START(SOAR_STATICS_BT2)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.BT2$$Limit" value="END(SOAR_STATICS_BT2)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.BT4$$Base" value="START(SOAR_STATICS_BT4)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.BT4$$Limit" value="END(SOAR_STATICS_BT4)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.BT8$$Base" value="START(SOAR_STATICS_BT8)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.BT8$$Limit" value="END(SOAR_STATICS_BT8)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.REF$$Base" value="START(SOAR_STATICS_REF)" rootSymbol="true"/>
	<defSymbol name=".bss.soar.REF$$Limit" value="END(SOAR_STATICS_REF)" rootSymbol="true"/>
	
	<memoryLayout ranges=".bss.microej.statics">
	    <!-- 
	    	Static areas : 5 sections of statics. 
	    	Wrapped in a group because sections are not generated if no statics found of the given type 
	    -->	    
	    <group name="SOAR_STATICS_BT1"> 
			<sectionRef name=".bss.soar.BT1*"/>
		</group>
	    <group name="SOAR_STATICS_BT2"> 
			<sectionRef name=".bss.soar.BT2*" />
		</group>
	    <group name="SOAR_STATICS_BT4"> 
			<sectionRef name=".bss.soar.BT4*"/>
		</group>
	    <group name="SOAR_STATICS_BT8"> 
			<sectionRef name=".bss.soar.BT8*"/>
		</group>
	    <group name="SOAR_STATICS_REF"> 
	    	<group name="SOAR_STATICS_REF_DEFAULT">
				<sectionRef name=".bss.soar.REF"/>		
				<sectionRef name=".bss.soar.REFLS"/>		
	    	</group>
			<sectionRef name=".bss.soar.REF*"/>		
		</group>
	</memoryLayout>
	
	<defSection name=".rodata.microej.soar.startpadding" size="4">
		<u4 value="0"/>
	</defSection>
	
	<memoryLayout ranges=".rodata.microej.soar" image="true">
	 	<!-- Just add a padding at the beginning of the soar section to avoid to get a relative address equals to 0 (tiny) -->
		<sectionRef name=".rodata.microej.soar.startpadding" force="true"/>
	
		<group name="SOAR_RUNTIME">
			<sectionRef name=".soar.runtime.types"/>
		</group>
		
		<sectionRef name=".soar.runtime*"/>
		<sectionRef name=".soar.rodata.packagenames"/>
		
		<group name="SOAR_RESOURCES_NAMES">
			<sectionRef name=".soar.rodata.resourcenames"/>
		</group>
		
		<group name="SOAR_CLASS_NAMES">
			<sectionRef name=".soar.rodata.classnames"/>
		</group>
		
		<sectionRef name=".soar.text*"/>
		<sectionRef name=".soar.rodata*"/>
	</memoryLayout>
	
	<!-- Immutables -->
	<defSection name=".rodata.microej.immutables" start="0" end="0x7fffffff" align="8"/>	
	<memoryLayout ranges=".rodata.microej.immutables" image="true">
		<group name="SOAR_IMMUTABLES">
			<sectionRef name=".soar.rodata.immutable"/>
		</group>
	</memoryLayout>

	<!-- Intern Strings -->
	<defSection name=".rodata.microej.strings" start="0" end="0x7fffffff" align="8"/>	
	<memoryLayout ranges=".rodata.microej.strings" image="true">
		<group name="SOAR_INTERN_STRINGS">
			<sectionRef name=".soar.*" symbol="_java_internStrings_start"/>
		</group>
	</memoryLayout>
	
	<!-- Define '.rodata.microej.runtime' grouped section -->
	<defSection name=".rodata.microej.runtime" start="0" size="0x7fffffff" align="8" rootSection="true"/>
	<memoryLayout ranges=".rodata.microej.runtime" image="true">
		<sectionRef name=".rodata.microej.runtime.*"/>
	</memoryLayout>	
		
</lscFragment>