update the GNU GCC link script.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1283 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2011-02-21 06:39:13 +00:00
parent ceda7d874e
commit 88b3199266
3 changed files with 103 additions and 94 deletions

View File

@ -26,7 +26,7 @@ Export('rtconfig')
objs = PrepareBuilding(env, RTT_ROOT)
# STM32 firemare library building script
objs = objs + SConscript(RTT_ROOT + '/bsp/stm3210/Libraries/SConscript', variant_dir='bsp/Libraries', duplicate=0)
objs = objs + SConscript(RTT_ROOT + '/bsp/stm3210/Libraries/SConscript', variant_dir='build/bsp/Libraries', duplicate=0)
# build program
env.Program(TARGET, objs)

View File

@ -1,7 +1,7 @@
# toolchains options
ARCH='arm'
CPU='stm32'
CROSS_TOOL='keil'
CROSS_TOOL='gcc'
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
@ -28,7 +28,7 @@ if PLATFORM == 'gcc':
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m3 -mthumb'
DEVICE = ' -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -DRT_USING_MINILIBC'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-stm32.map,-cref,-u,Reset_Handler -T stm32_rom.ld'
@ -110,7 +110,6 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config stm32f10x_flash.icf'
LFLAGS += ' --redirect _Printf=_PrintfTiny'
LFLAGS += ' --redirect _Scanf=_ScanfSmall'
# LFLAGS = ' --map I:\RTT\20110219\rt-thread\bsp\stm3210\Debug\List\project.map
LFLAGS += ' --entry __iar_program_start'
EXEC_PATH = IAR_PATH + '/arm/bin/'

View File

@ -24,6 +24,7 @@ SECTIONS
*(.rodata*)
*(.glue_7)
*(.glue_7t)
*(.gnu.linkonce.t*)
/* section information for finsh shell */
. = ALIGN(4);
@ -38,10 +39,18 @@ SECTIONS
. = ALIGN(4);
_etext = .;
} > CODE = 0
/* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
/* This is used by the startup in order to initialize the .data secion */
_sidata = _etext;
} > CODE = 0
_sidata = .;
} > CODE
__exidx_end = .;
/* .data section which is used for initialized data */
@ -53,6 +62,7 @@ SECTIONS
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */