/****************************************************************************/
/* LNK32.CMD - v4.5.0 COMMAND FILE FOR LINKING TMS470 32BIS C/C++ PROGRAMS  */
/*                                                                          */
/*   Usage:  lnk470 <obj files...>    -o <out file> -m <map file> lnk32.cmd */
/*           cl470 <src files...> -z -o <out file> -m <map file> lnk32.cmd  */
/*                                                                          */
/*   Description: This file is a sample command file that can be used       */
/*                for linking programs built with the TMS470 C/C++          */
/*                Compiler.   Use it as a guideline; you may want to change */
/*                the allocation scheme according to the size of your       */
/*                program and the memory layout of your target system.      */
/*                                                                          */
/*   Notes: (1)   You must specify the directory in which run-time support  */
/*                library is located.  Either add a "-i<directory>" line to */
/*                this file, or use the system environment variable C_DIR   */
/*                to specify a search path for libraries.                   */
/*                                                                          */
/*          (2)   If the run-time support library you are using is not      */
/*                named below, be sure to use the correct name here.        */
/*                                                                          */
/****************************************************************************/
-stack  0x0040                             /* SOFTWARE STACK SIZE           */
-heap   0x2000                             /* HEAP AREA SIZE                */
-e Entry
/* Since we used 'Entry' as the entry-point symbol the compiler issues a    */
/* warning (#10063-D: entry-point symbol other than "_c_int00" specified:   */
/* "Entry"). The CCS Version (5.1.0.08000) stops building from command      */
/* line when there is a warning. So this warning is suppressed with the     */
/* below flag. */

--diag_suppress=10063

/* -l ../../../../../../../binary/armv7a/cgttms470_ccs/am335x/drivers/drivers.lib */
/* -l ../../../../../../../binary/armv7a/cgttms470_ccs/am335x/evmAM335x/platform/platform.lib */
/* -l ../../../../../../../binary/armv7a/cgttms470_ccs/utils/utils.lib */
/* -l ../../../../../../../binary/armv7a/cgttms470_ccs/mmcsdlib/libmmcsd.lib */

-l drivers.lib
-l platform.lib
-l utils.lib
-l libmmcsd.lib


/* SPECIFY THE SYSTEM MEMORY MAP */

MEMORY
{
		NOR_MEM         : org = 0x08000000  len = 0x3D00        // 0x10000 changed            /* RAM */
        IRAM_MEM        : org = 0x402F0400  len = 0x1FBFF       /* RAM */
}

/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

SECTIONS
{
    .init    : { 
                 bl_init.obj (.text) 
               } load > 0x08000000
    .const   : load > NOR_MEM              /* GLOBAL CONSTANTS             */
    .cinit   : load > NOR_MEM
    .text    : load > NOR_MEM              /* CODE  */
	.ram_code: { bl_norexec.obj(.text)} load > NOR_MEM, run > 0x40300000
 				LOAD_START(ram_code_load_start)
 				RUN_START(ram_code_run_start)
 				SIZE(ram_code_size)

    .data    : load > IRAM_MEM              /* INITIALIZED GLOBAL AND STATIC VARIABLES. */
    .bss     : load > IRAM_MEM              /* UNINITIALIZED OR ZERO INITIALIZED */
                                            /* GLOBAL & STATIC VARIABLES.   */
                    RUN_START(bss_start)
                    RUN_END(bss_end)

    .stack   : load > 0x4030FF00            /* SOFTWARE SYSTEM STACK        */

}

