Linker Script参考

/*

  • STACK SIZE MACRO DEFINITIONS
    /
    #define M_USER_STACK_SIZE 0x2800 /
    Multiple of 8 bytes - 6KB /
    #define M_PREV_STACK_SIZE 0x50 /
    Multiple of 8 bytes - 16B */

/*

  • LINKER OPTIONS
    /
    –entry_point=_c_int00 /
    ENTRY POINT /
    -stack 0x2800 /
    SOFTWARE STACK SIZE /
    -heap 0x2800 /
    HEAP AREA SIZE /
    –retain="
    (.intvecs)"

/* SPECIFY THE SYSTEM MEMORY MAP */

MEMORY
{
PROG_VEC_TCMA_RAM : org = 0x00000000 len = 0x00000100 /* PROGRAM MEMORY (ROM) (256 Bytes)- 8 BYTE ALIGNED /
MSS_TCMA_RAM : org = 0x00000100 len = 0x0004FF00 /
PROGRAM MEMORY (RAM : TCMA) (320k Bytes) /
MSS_TCMA_L3SH : org = 0x00050000 len = 0x00010000 /
PROGRAM MEMORY (RAM : TCMA) (64k Bytes) /
MSS_TCMB : org = 0x08000000 len = 0x00024000 /
DATA MEMORY (RAM : TCMB) (144k Bytes) /
MSS_TCMB_RE : org = 0x08024000 len = 0xC000 /
DATA MEMORY (RAM : DSS_L3) (48k Bytes) */

}

--define=MCAL_CODE1=MSS_TCMA_RAM
--define=MCAL_CODE2=MSS_TCMA_RAM
--define=MCAL_DATA=MSS_TCMB
--define=MCAL_BSS=MSS_TCMB
--define=MCAL_NOINIT=MSS_TCMA_RAM
--define=MCAL_CONST=MSS_TCMA_RAM
--define FILL_PATTERN=0xFEAA55EF
--define FILL_LENGTH=0x100

/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

SECTIONS
{
.intvecs : { (.intvecs) } > PROG_VEC_TCMA_RAM ALIGN(8) / INTERRUPT VECTORS */
.startup : { (.startup) } > MSS_TCMA_RAM ALIGN(8) / STARTUP CODE - 8 BYTE ALIGNED */
.systcmsysvimRam : > MSS_TCMA_RAM

/* TEXT SECTION - Executable Code */
.text               :                    >  MSS_TCMA_RAM, fill=FILL_PATTERN
{
    .=align(4);
    __linker_text_start = .;
    . += FILL_LENGTH;
    *(.text)
    .=align(4);
    . += FILL_LENGTH;
    __linker_text_end = .;
}

/* DATA SECTION - Initialized Data */
.data       :                     		 > MSS_TCMB_RE
{
    .=align(4);
    __linker_data_start = .;
    . += FILL_LENGTH;
    *(.data)
    .=align(4);
    . += FILL_LENGTH;
    __linker_data_end = .;
}

/* CONST SECTION - Initialized Global Variables */
.const      :  						> MSS_TCMA_L3SH, fill=FILL_PATTERN
{
    .=align(4);
    __linker_const_start = .;
    . += FILL_LENGTH;
    *(.const)
    .=align(4);
    . += FILL_LENGTH;
    __linker_const_end = .;
}

/* BSS SECTION - Contains Uninitialized Global variables */
.bss        : load 						> MSS_TCMB
                RUN_START(bss_start)
                RUN_END(bss_end)
{
    .=align(4);
    __linker_bss_start = .;
    . += FILL_LENGTH;
    *(.bss)
    .=align(4);
    . += FILL_LENGTH;
    __linker_bss_end = .;
}

/* CINIT SECTION - Tables which initializes global variables */
.cinit      : load > MSS_TCMA_RAM

/* STACK - System Stack */
.stack      : load > MSS_TCMA_RAM, fill=FILL_PATTERN

/* SYSMEM - Heap Memory */
.sysmem     : load > MSS_TCMA_RAM

}

你可能感兴趣的:(编译链接)