提交 88b31992 编写于 作者: B bernard.xiong

update the GNU GCC link script.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1283 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 ceda7d87
...@@ -26,7 +26,7 @@ Export('rtconfig') ...@@ -26,7 +26,7 @@ Export('rtconfig')
objs = PrepareBuilding(env, RTT_ROOT) objs = PrepareBuilding(env, RTT_ROOT)
# STM32 firemare library building script # 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 # build program
env.Program(TARGET, objs) env.Program(TARGET, objs)
......
# toolchains options # toolchains options
ARCH='arm' ARCH='arm'
CPU='stm32' CPU='stm32'
CROSS_TOOL='keil' CROSS_TOOL='gcc'
if CROSS_TOOL == 'gcc': if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc' PLATFORM = 'gcc'
...@@ -28,7 +28,7 @@ if PLATFORM == 'gcc': ...@@ -28,7 +28,7 @@ if PLATFORM == 'gcc':
OBJDUMP = PREFIX + 'objdump' OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m3 -mthumb' DEVICE = ' -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -DRT_USING_MINILIBC' CFLAGS = DEVICE + ' -DRT_USING_MINILIBC'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-stm32.map,-cref,-u,Reset_Handler -T stm32_rom.ld' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-stm32.map,-cref,-u,Reset_Handler -T stm32_rom.ld'
...@@ -110,7 +110,6 @@ elif PLATFORM == 'iar': ...@@ -110,7 +110,6 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config stm32f10x_flash.icf' LFLAGS = ' --config stm32f10x_flash.icf'
LFLAGS += ' --redirect _Printf=_PrintfTiny' LFLAGS += ' --redirect _Printf=_PrintfTiny'
LFLAGS += ' --redirect _Scanf=_ScanfSmall' LFLAGS += ' --redirect _Scanf=_ScanfSmall'
# LFLAGS = ' --map I:\RTT\20110219\rt-thread\bsp\stm3210\Debug\List\project.map
LFLAGS += ' --entry __iar_program_start' LFLAGS += ' --entry __iar_program_start'
EXEC_PATH = IAR_PATH + '/arm/bin/' EXEC_PATH = IAR_PATH + '/arm/bin/'
......
...@@ -6,111 +6,121 @@ ...@@ -6,111 +6,121 @@
/* Program Entry, set to mark it as "used" and avoid gc */ /* Program Entry, set to mark it as "used" and avoid gc */
MEMORY MEMORY
{ {
CODE (rx) : ORIGIN = 0x08000000, LENGTH = 0x00080000 CODE (rx) : ORIGIN = 0x08000000, LENGTH = 0x00080000
DATA (rw) : ORIGIN = 0x20000000, LENGTH = 0x00010000 DATA (rw) : ORIGIN = 0x20000000, LENGTH = 0x00010000
} }
ENTRY(Reset_Handler) ENTRY(Reset_Handler)
SECTIONS SECTIONS
{ {
.text : .text :
{ {
. = ALIGN(4); . = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */ KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4); . = ALIGN(4);
*(.text) /* remaining code */ *(.text) /* remaining code */
*(.text.*) /* remaining code */ *(.text.*) /* remaining code */
*(.rodata) /* read-only data (constants) */ *(.rodata) /* read-only data (constants) */
*(.rodata*) *(.rodata*)
*(.glue_7) *(.glue_7)
*(.glue_7t) *(.glue_7t)
*(.gnu.linkonce.t*)
/* section information for finsh shell */ /* section information for finsh shell */
. = ALIGN(4); . = ALIGN(4);
__fsymtab_start = .; __fsymtab_start = .;
KEEP(*(FSymTab)) KEEP(*(FSymTab))
__fsymtab_end = .; __fsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
__vsymtab_start = .; __vsymtab_start = .;
KEEP(*(VSymTab)) KEEP(*(VSymTab))
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0
/* This is used by the startup in order to initialize the .data secion */ /* .ARM.exidx is sorted, so has to go in its own output section. */
_sidata = _etext; __exidx_start = .;
} > CODE = 0 .ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
/* .data section which is used for initialized data */ /* This is used by the startup in order to initialize the .data secion */
_sidata = .;
} > CODE
__exidx_end = .;
.data : AT (_sidata) /* .data section which is used for initialized data */
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_sdata = . ;
*(.data) .data : AT (_sidata)
*(.data.*) {
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_sdata = . ;
. = ALIGN(4); *(.data)
/* This is used by the startup in order to initialize the .data secion */ *(.data.*)
_edata = . ; *(.gnu.linkonce.d*)
} >DATA
__bss_start = .; . = ALIGN(4);
.bss : /* This is used by the startup in order to initialize the .data secion */
{ _edata = . ;
. = ALIGN(4); } >DATA
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .;
*(.bss) __bss_start = .;
*(COMMON) .bss :
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .;
. = ALIGN(4); *(.bss)
/* This is used by the startup in order to initialize the .bss secion */ *(COMMON)
_ebss = . ;
_estack = .;
*(.bss.init)
} > DATA
__bss_end = .;
_end = .; . = ALIGN(4);
/* This is used by the startup in order to initialize the .bss secion */
_ebss = . ;
_estack = .;
*(.bss.init)
} > DATA
__bss_end = .;
/* Stabs debugging sections. */ _end = .;
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) } /* Stabs debugging sections. */
.stab.excl 0 : { *(.stab.excl) } .stab 0 : { *(.stab) }
.stab.exclstr 0 : { *(.stab.exclstr) } .stabstr 0 : { *(.stabstr) }
.stab.index 0 : { *(.stab.index) } .stab.excl 0 : { *(.stab.excl) }
.stab.indexstr 0 : { *(.stab.indexstr) } .stab.exclstr 0 : { *(.stab.exclstr) }
.comment 0 : { *(.comment) } .stab.index 0 : { *(.stab.index) }
/* DWARF debug sections. .stab.indexstr 0 : { *(.stab.indexstr) }
* Symbols in the DWARF debugging sections are relative to the beginning .comment 0 : { *(.comment) }
* of the section so we begin them at 0. */ /* DWARF debug sections.
/* DWARF 1 */ * Symbols in the DWARF debugging sections are relative to the beginning
.debug 0 : { *(.debug) } * of the section so we begin them at 0. */
.line 0 : { *(.line) } /* DWARF 1 */
/* GNU DWARF 1 extensions */ .debug 0 : { *(.debug) }
.debug_srcinfo 0 : { *(.debug_srcinfo) } .line 0 : { *(.line) }
.debug_sfnames 0 : { *(.debug_sfnames) } /* GNU DWARF 1 extensions */
/* DWARF 1.1 and DWARF 2 */ .debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_aranges 0 : { *(.debug_aranges) } .debug_sfnames 0 : { *(.debug_sfnames) }
.debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 1.1 and DWARF 2 */
/* DWARF 2 */ .debug_aranges 0 : { *(.debug_aranges) }
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_pubnames 0 : { *(.debug_pubnames) }
.debug_abbrev 0 : { *(.debug_abbrev) } /* DWARF 2 */
.debug_line 0 : { *(.debug_line) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_frame 0 : { *(.debug_frame) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_str 0 : { *(.debug_str) } .debug_line 0 : { *(.debug_line) }
.debug_loc 0 : { *(.debug_loc) } .debug_frame 0 : { *(.debug_frame) }
.debug_macinfo 0 : { *(.debug_macinfo) } .debug_str 0 : { *(.debug_str) }
/* SGI/MIPS DWARF 2 extensions */ .debug_loc 0 : { *(.debug_loc) }
.debug_weaknames 0 : { *(.debug_weaknames) } .debug_macinfo 0 : { *(.debug_macinfo) }
.debug_funcnames 0 : { *(.debug_funcnames) } /* SGI/MIPS DWARF 2 extensions */
.debug_typenames 0 : { *(.debug_typenames) } .debug_weaknames 0 : { *(.debug_weaknames) }
.debug_varnames 0 : { *(.debug_varnames) } .debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册