diff --git a/bsp/at91sam9260/SConstruct b/bsp/at91sam9260/SConstruct index 681018554c..7ce3af43b6 100755 --- a/bsp/at91sam9260/SConstruct +++ b/bsp/at91sam9260/SConstruct @@ -34,8 +34,5 @@ if GetDepend('RT_USING_RTGUI'): # libc testsuite objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/at91sam9260/at91sam9260_ram.ld b/bsp/at91sam9260/at91sam9260_ram.ld index 9f3fbfc45c..501287d981 100755 --- a/bsp/at91sam9260/at91sam9260_ram.ld +++ b/bsp/at91sam9260/at91sam9260_ram.ld @@ -3,83 +3,89 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { - . = 0x20000000; + . = 0x20000000; - . = ALIGN(4); - .text : - { - *(.init) - *(.text) - *(.gnu.linkonce.t*) - - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - . = ALIGN(4); + . = ALIGN(4); + .text : + { + *(.init) + *(.text) + *(.gnu.linkonce.t*) + + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + . = ALIGN(4); - /* section information for modules */ - . = ALIGN(4); - __rtmsymtab_start = .; - KEEP(*(RTMSymTab)) - __rtmsymtab_end = .; - } + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); - . = ALIGN(4); - .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) } + /* section information for modules */ + . = ALIGN(4); + __rtmsymtab_start = .; + KEEP(*(RTMSymTab)) + __rtmsymtab_end = .; + } - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(__ctors_end__ = .); - } + . = ALIGN(4); + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) } - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(__dtors_end__ = .); - } + . = ALIGN(4); + .ctors : + { + PROVIDE(__ctors_start__ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(__ctors_end__ = .); + } - . = ALIGN(4); - .data : - { - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - } + .dtors : + { + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(__dtors_end__ = .); + } - . = ALIGN(4); - .nobss : { *(.nobss) } + . = ALIGN(4); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + } - . = 0x20300000; - . = ALIGN(4); - __bss_start = .; - .bss : { *(.bss) } - __bss_end = .; + . = ALIGN(4); + .nobss : { *(.nobss) } - /* stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } + . = 0x20300000; + . = ALIGN(4); + __bss_start = .; + .bss : { *(.bss) } + __bss_end = .; - _end = .; + /* stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } + + _end = .; } diff --git a/bsp/avr32uc3b0/SConstruct b/bsp/avr32uc3b0/SConstruct index c5abee498a..834d66615f 100644 --- a/bsp/avr32uc3b0/SConstruct +++ b/bsp/avr32uc3b0/SConstruct @@ -28,8 +28,5 @@ objs = PrepareBuilding(env, RTT_ROOT) # AVR32 software framework building script objs = objs + SConscript(RTT_ROOT + '/bsp/avr32uc3b0/SOFTWARE_FRAMEWORK/SConscript', variant_dir='bsp/SOFTWARE_FRAMEWORK', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) \ No newline at end of file +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/dev3210/SConstruct b/bsp/dev3210/SConstruct index 8246fe46c9..c885c34448 100644 --- a/bsp/dev3210/SConstruct +++ b/bsp/dev3210/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/efm32/SConstruct b/bsp/efm32/SConstruct index 22b0a34a49..4849771bf0 100644 --- a/bsp/efm32/SConstruct +++ b/bsp/efm32/SConstruct @@ -31,8 +31,5 @@ objs = objs + SConscript(RTT_ROOT + '/bsp/efm32/EFM32GG_DK3750/SConscript', vari objs = objs + SConscript(RTT_ROOT + '/bsp/efm32/graphics/SConscript', variant_dir='build/graphics', duplicate=0) objs = objs + SConscript(RTT_ROOT + '/bsp/efm32/Libraries/SConscript', variant_dir='build/Libraries', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/efm32/efm32g_rom.ld b/bsp/efm32/efm32g_rom.ld index ce3a6a408f..6279e63571 100644 --- a/bsp/efm32/efm32g_rom.ld +++ b/bsp/efm32/efm32g_rom.ld @@ -1,8 +1,8 @@ /***************************************************************************//** - * @file efm32_rom_g.ld - * @brief Linker script for EFM32 gecko - * COPYRIGHT (C) 2012, RT-Thread Development Team - * @author Bernard, onelife + * @file efm32_rom_g.ld + * @brief Linker script for EFM32 gecko + * COPYRIGHT (C) 2012, RT-Thread Development Team + * @author Bernard, onelife * @version 1.0 ******************************************************************************* * @section License @@ -10,11 +10,11 @@ * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE ******************************************************************************* * @section Change Logs - * Date Author Notes - * 2009-10-14 Bernard first version - * 2010-12-22 onelife Modify for EFM32 - * 2011-07-06 onelife Modify to make use the start code in libraries - * 2012-05-15 onelife Modified to compatible with CMSIS v3 + * Date Author Notes + * 2009-10-14 Bernard first version + * 2010-12-22 onelife Modify for EFM32 + * 2011-07-06 onelife Modify to make use the start code in libraries + * 2012-05-15 onelife Modified to compatible with CMSIS v3 ******************************************************************************/ MEMORY { @@ -53,122 +53,129 @@ ENTRY(Reset_Handler) SECTIONS { - .text : - { - KEEP(*(.isr_vector)) - *(.text*) + .text : + { + KEEP(*(.isr_vector)) + *(.text*) - KEEP(*(.init)) - KEEP(*(.fini)) + KEEP(*(.init)) + KEEP(*(.fini)) - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) - *(.rodata*) + *(.rodata*) - KEEP(*(.eh_frame*)) + KEEP(*(.eh_frame*)) - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - } > FLASH = 0 + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; + } > FLASH = 0 - __etext = .; + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - *(.ram) + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); + __etext = .; - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + *(.ram) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - /* All data end */ - __data_end__ = .; + . = ALIGN(4); + /* All data end */ + __data_end__ = .; - } > RAM + } > RAM - .bss : - { - __bss_start__ = .; - *(.bss*) - *(COMMON) - __bss_end__ = .; - } > RAM + .bss : + { + __bss_start__ = .; + *(.bss*) + *(COMMON) + __bss_end__ = .; + } > RAM - .heap : - { - __end__ = .; - end = __end__; - _end = __end__; - *(.heap*) - __HeapLimit = .; - } > RAM + .heap : + { + __end__ = .; + end = __end__; + _end = __end__; + *(.heap*) + __HeapLimit = .; + } > RAM - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy : - { - *(.stack) - } > RAM + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy : + { + *(.stack) + } > RAM - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") } diff --git a/bsp/jz47xx/SConscript b/bsp/jz47xx/SConscript index a6b0ebb6de..a5ba6927af 100644 --- a/bsp/jz47xx/SConscript +++ b/bsp/jz47xx/SConscript @@ -6,7 +6,7 @@ src_bsp = ['application.c', 'startup.c', 'board.c'] src_drv = ['uart.c'] src = File(src_bsp + src_drv) -CPPPATH = Dir('#') +CPPPATH = str(Dir('#')) group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/bsp/jz47xx/SConstruct b/bsp/jz47xx/SConstruct index 09eeb0944a..ca6bdbb5d2 100644 --- a/bsp/jz47xx/SConstruct +++ b/bsp/jz47xx/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/lm3s8962/SConstruct b/bsp/lm3s8962/SConstruct index efef1e77ba..3542c5c40c 100644 --- a/bsp/lm3s8962/SConstruct +++ b/bsp/lm3s8962/SConstruct @@ -25,7 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/lm3s8962/lm3s_rom.ld b/bsp/lm3s8962/lm3s_rom.ld index 607c400193..5572ae4186 100644 --- a/bsp/lm3s8962/lm3s_rom.ld +++ b/bsp/lm3s8962/lm3s_rom.ld @@ -37,6 +37,12 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + _etext = .; } > CODE = 0 diff --git a/bsp/lm3s9b9x/SConstruct b/bsp/lm3s9b9x/SConstruct index 037fda4608..3542c5c40c 100644 --- a/bsp/lm3s9b9x/SConstruct +++ b/bsp/lm3s9b9x/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/lm3s9b9x/lm3s_rom.ld b/bsp/lm3s9b9x/lm3s_rom.ld index 607c400193..5572ae4186 100644 --- a/bsp/lm3s9b9x/lm3s_rom.ld +++ b/bsp/lm3s9b9x/lm3s_rom.ld @@ -37,6 +37,12 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + _etext = .; } > CODE = 0 diff --git a/bsp/lm4f232/SConstruct b/bsp/lm4f232/SConstruct index 340e555201..16877dd5b4 100644 --- a/bsp/lm4f232/SConstruct +++ b/bsp/lm4f232/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/lm4f232/lm4f_rom.ld b/bsp/lm4f232/lm4f_rom.ld index fe66bc9e34..16bb52b569 100644 --- a/bsp/lm4f232/lm4f_rom.ld +++ b/bsp/lm4f232/lm4f_rom.ld @@ -50,7 +50,13 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); - } > FLASH + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + + } > FLASH .data : AT(ADDR(.text) + SIZEOF(.text)) { diff --git a/bsp/lpc176x/rtthread-lpc17xx.ld b/bsp/lpc176x/rtthread-lpc17xx.ld index 3eb7f962ef..928a27fa02 100644 --- a/bsp/lpc176x/rtthread-lpc17xx.ld +++ b/bsp/lpc176x/rtthread-lpc17xx.ld @@ -36,9 +36,10 @@ SECTIONS __vsymtab_start = .; KEEP(*(VSymTab)) __vsymtab_end = .; + . = ALIGN(4); __rt_init_start = .; - KEEP(*(.rti_fn*)) + KEEP(*(SORT(.rti_fn*))) __rt_init_end = .; . = ALIGN(4); diff --git a/bsp/lpc178x/SConstruct b/bsp/lpc178x/SConstruct index 71dd05e508..8503d8053c 100644 --- a/bsp/lpc178x/SConstruct +++ b/bsp/lpc178x/SConstruct @@ -28,8 +28,5 @@ objs = PrepareBuilding(env, RTT_ROOT) if GetDepend('RT_USING_RTGUI'): objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/lpc178x/rtthread-lpc178x.ld b/bsp/lpc178x/rtthread-lpc178x.ld index 021d51a504..fd28d382c3 100644 --- a/bsp/lpc178x/rtthread-lpc178x.ld +++ b/bsp/lpc178x/rtthread-lpc178x.ld @@ -38,6 +38,12 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 diff --git a/bsp/lpc2148/SConstruct b/bsp/lpc2148/SConstruct index 68d18e4642..e1d4c19aac 100644 --- a/bsp/lpc2148/SConstruct +++ b/bsp/lpc2148/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/lpc2148/lpc2148_rom.ld b/bsp/lpc2148/lpc2148_rom.ld index 2dbe82514f..3bcd1c7165 100644 --- a/bsp/lpc2148/lpc2148_rom.ld +++ b/bsp/lpc2148/lpc2148_rom.ld @@ -4,8 +4,8 @@ OUTPUT_ARCH(arm) MEMORY { - CODE (rx) : ORIGIN = 0x00000000, LENGTH = 512k /* 512KB flash */ - DATA (rw) : ORIGIN = 0x40000000, LENGTH = 32k /* 32K sram */ + CODE (rx) : ORIGIN = 0x00000000, LENGTH = 512k /* 512KB flash */ + DATA (rw) : ORIGIN = 0x40000000, LENGTH = 32k /* 32K sram */ } ENTRY(_start) @@ -18,49 +18,55 @@ _svc_tack_size = 0x400; SECTIONS { - . = 0; + . = 0; - . = ALIGN(4); - .text : - { - *(.init) - *(.text) - *(.rodata) - *(.rodata*) - *(.glue_7) - *(.glue_7t) + . = ALIGN(4); + .text : + { + *(.init) + *(.text) + *(.rodata) + *(.rodata*) + *(.glue_7) + *(.glue_7t) - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - . = ALIGN(4); + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + . = ALIGN(4); - } >CODE + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(__ctors_end__ = .); - } > CODE + } >CODE - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(__dtors_end__ = .); - } > CODE + . = ALIGN(4); + .ctors : + { + PROVIDE(__ctors_start__ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(__ctors_end__ = .); + } > CODE - __end_of_text__ = .; + .dtors : + { + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(__dtors_end__ = .); + } > CODE + + __end_of_text__ = .; /* .ARM.exidx is sorted, so has to go in its own output section. */ __exidx_start = .; @@ -73,7 +79,7 @@ SECTIONS } > CODE __exidx_end = .; - /* .data section which is used for initialized data */ + /* .data section which is used for initialized data */ .data : AT (_sidata) { . = ALIGN(4); @@ -88,36 +94,36 @@ SECTIONS /* This is used by the startup in order to initialize the .data secion */ _edata = . ; } >DATA - __data_end = .; + __data_end = .; - .noinit : - { - *(.bss.noinit) - } > DATA + .noinit : + { + *(.bss.noinit) + } > DATA - .stack : - { - . = ALIGN(4); - _undefined_stack_base = .; - . = . + _undefined_tack_size; - _undefined_stack_top = .; - - _abort_stack_base = .; - . = . + _abort_tack_size; - _abort_stack_top = .; - - _fiq_stack_base = .; - . = . + _fiq_tack_size; - _fiq_stack_top = .; - - _irq_stack_base = .; - . = . + _irq_tack_size; - _irq_stack_top = .; - - _svc_stack_base = .; - . = . + _svc_tack_size; - _svc_stack_top = .; - } >DATA + .stack : + { + . = ALIGN(4); + _undefined_stack_base = .; + . = . + _undefined_tack_size; + _undefined_stack_top = .; + + _abort_stack_base = .; + . = . + _abort_tack_size; + _abort_stack_top = .; + + _fiq_stack_base = .; + . = . + _fiq_tack_size; + _fiq_stack_top = .; + + _irq_stack_base = .; + . = . + _irq_tack_size; + _irq_stack_top = .; + + _svc_stack_base = .; + . = . + _svc_tack_size; + _svc_stack_top = .; + } >DATA __bss_start = .; .bss : @@ -135,8 +141,8 @@ SECTIONS } > DATA __bss_end = .; - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ - . = ALIGN(32 / 8); + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); } diff --git a/bsp/lpc2478/SConstruct b/bsp/lpc2478/SConstruct index b80592ba29..b209a1a2ec 100644 --- a/bsp/lpc2478/SConstruct +++ b/bsp/lpc2478/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/lpc2478/lpc2478_rom.lds b/bsp/lpc2478/lpc2478_rom.lds index ced52b9fc8..f6e3672ff1 100644 --- a/bsp/lpc2478/lpc2478_rom.lds +++ b/bsp/lpc2478/lpc2478_rom.lds @@ -15,8 +15,8 @@ SECTIONS { .text : { - *(.init) - *(.text) + *(.init) + *(.text) *(.text.*) /* remaining code */ *(.rodata) /* read-only data (constants) */ *(.rodata*) @@ -35,26 +35,32 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(__ctors_end__ = .); - } > CODE + . = ALIGN(4); + .ctors : + { + PROVIDE(__ctors_start__ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(__ctors_end__ = .); + } > CODE - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(__dtors_end__ = .); - } > CODE + .dtors : + { + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(__dtors_end__ = .); + } > CODE /* .ARM.exidx is sorted, so has to go in its own output section. */ __exidx_start = .; @@ -82,12 +88,12 @@ SECTIONS /* This is used by the startup in order to initialize the .data secion */ _edata = . ; } >DATA - __data_end = .; + __data_end = .; - .noinit : - { - *(.bss.noinit) - } > DATA + .noinit : + { + *(.bss.noinit) + } > DATA __bss_start = .; .bss : diff --git a/bsp/ls1bdev/SConstruct b/bsp/ls1bdev/SConstruct index d578392b1e..17e1d15db3 100644 --- a/bsp/ls1bdev/SConstruct +++ b/bsp/ls1bdev/SConstruct @@ -28,8 +28,5 @@ objs = PrepareBuilding(env, RTT_ROOT) if GetDepend('RT_USING_RTGUI'): objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/m16c62p/SConstruct b/bsp/m16c62p/SConstruct index 12642dd58d..02b05a150c 100644 --- a/bsp/m16c62p/SConstruct +++ b/bsp/m16c62p/SConstruct @@ -39,8 +39,5 @@ if GetDepend('RT_USING_RTGUI'): # libc testsuite # objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/mb9bf500r/SConstruct b/bsp/mb9bf500r/SConstruct index da3cfa04c5..1deefb8ffd 100644 --- a/bsp/mb9bf500r/SConstruct +++ b/bsp/mb9bf500r/SConstruct @@ -32,8 +32,5 @@ objs = PrepareBuilding(env, RTT_ROOT) objs = objs + SConscript('CMSIS/SConscript', variant_dir='build/bsp/CMSIS', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/mb9bf500r/fm3_rom.ld b/bsp/mb9bf500r/fm3_rom.ld index f5f204d35e..67f1a973b3 100644 --- a/bsp/mb9bf500r/fm3_rom.ld +++ b/bsp/mb9bf500r/fm3_rom.ld @@ -32,6 +32,12 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 diff --git a/bsp/mb9bf506r/SConstruct b/bsp/mb9bf506r/SConstruct index d3d392a19a..8c58439102 100644 --- a/bsp/mb9bf506r/SConstruct +++ b/bsp/mb9bf506r/SConstruct @@ -30,8 +30,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/mb9bf506r/rtthread-mb9bf506.ld b/bsp/mb9bf506r/rtthread-mb9bf506.ld index 0676c45251..b407d22ddf 100644 --- a/bsp/mb9bf506r/rtthread-mb9bf506.ld +++ b/bsp/mb9bf506r/rtthread-mb9bf506.ld @@ -41,76 +41,76 @@ PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram); SECTIONS { - .text : - { - CREATE_OBJECT_SYMBOLS - __cs3_region_start_rom = .; - *(.cs3.region-head.rom) - __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m; - *(.cs3.interrupt_vector) - /* Make sure we pulled in an interrupt vector. */ - ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector"); - *(.rom) - *(.rom.b) + .text : + { + CREATE_OBJECT_SYMBOLS + __cs3_region_start_rom = .; + *(.cs3.region-head.rom) + __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m; + *(.cs3.interrupt_vector) + /* Make sure we pulled in an interrupt vector. */ + ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector"); + *(.rom) + *(.rom.b) - __cs3_reset = __cs3_reset_cortex_m; - *(.cs3.reset) - /* Make sure we pulled in some reset code. */ - ASSERT (. != __cs3_reset, "No reset code"); + __cs3_reset = __cs3_reset_cortex_m; + *(.cs3.reset) + /* Make sure we pulled in some reset code. */ + ASSERT (. != __cs3_reset, "No reset code"); - *(.text .text.* .gnu.linkonce.t.*) - *(.plt) - *(.gnu.warning) - *(.glue_7t) *(.glue_7) *(.vfp11_veneer) + *(.text .text.* .gnu.linkonce.t.*) + *(.plt) + *(.gnu.warning) + *(.glue_7t) *(.glue_7) *(.vfp11_veneer) - *(.rodata .rodata.* .gnu.linkonce.r.*) + *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.ARM.extab* .gnu.linkonce.armextab.*) - *(.gcc_except_table) - *(.eh_frame_hdr) - *(.eh_frame) + *(.ARM.extab* .gnu.linkonce.armextab.*) + *(.gcc_except_table) + *(.eh_frame_hdr) + *(.eh_frame) - . = ALIGN(4); - KEEP(*(.init)) + . = ALIGN(4); + KEEP(*(.init)) - . = ALIGN(4); - __preinit_array_start = .; - KEEP (*(.preinit_array)) - __preinit_array_end = .; + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; - . = ALIGN(4); - __init_array_start = .; - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array)) - __init_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; - . = ALIGN(0x4); - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*crtend.o(.ctors)) + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) - . = ALIGN(4); - KEEP(*(.fini)) + . = ALIGN(4); + KEEP(*(.fini)) - . = ALIGN(4); - __fini_array_start = .; - KEEP (*(.fini_array)) - KEEP (*(SORT(.fini_array.*))) - __fini_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*crtend.o(.dtors)) + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) - . = ALIGN(4); - __cs3_regions = .; - LONG (0) - LONG (__cs3_region_init_ram) - LONG (__cs3_region_start_ram) - LONG (__cs3_region_init_size_ram) - LONG (__cs3_region_zero_size_ram) + . = ALIGN(4); + __cs3_regions = .; + LONG (0) + LONG (__cs3_region_init_ram) + LONG (__cs3_region_start_ram) + LONG (__cs3_region_init_size_ram) + LONG (__cs3_region_zero_size_ram) /* section information for finsh shell */ . = ALIGN(4); @@ -122,35 +122,43 @@ SECTIONS KEEP(*(VSymTab)) __vsymtab_end = .; . = ALIGN(4); - } - /* .ARM.exidx is sorted, so has to go in its own output section. */ - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } >rom - __exidx_end = .; - .text.align : - { - . = ALIGN(8); - _etext = .; - } >rom - __cs3_region_size_rom = LENGTH(rom); - __cs3_region_num = 1; + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + + } + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >rom + __exidx_end = .; + .text.align : + { + . = ALIGN(8); + _etext = .; + } >rom + __cs3_region_size_rom = LENGTH(rom); + __cs3_region_num = 1; + + .data : + { + __cs3_region_start_ram = .; + *(.cs3.region-head.ram) + KEEP(*(.jcr)) + *(.got.plt) *(.got) + *(.shdata) + *(.data .data.* .gnu.linkonce.d.*) + *(.ram) + . = ALIGN (8); + _edata = .; + } >ram AT>rom - .data : - { - __cs3_region_start_ram = .; - *(.cs3.region-head.ram) - KEEP(*(.jcr)) - *(.got.plt) *(.got) - *(.shdata) - *(.data .data.* .gnu.linkonce.d.*) - *(.ram) - . = ALIGN (8); - _edata = .; - } >ram AT>rom .bss : { *(.shbss) @@ -161,6 +169,7 @@ SECTIONS _end = .; __end = .; } >ram AT>rom + .heap : { *(.heap) diff --git a/bsp/mini2440/SConstruct b/bsp/mini2440/SConstruct index 0ae74732eb..76e219bff3 100644 --- a/bsp/mini2440/SConstruct +++ b/bsp/mini2440/SConstruct @@ -32,8 +32,5 @@ if GetDepend('RT_USING_RTGUI'): # libc testsuite # objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/mini2440/mini2440_ram.ld b/bsp/mini2440/mini2440_ram.ld index 37c06324e0..f5b8bc58a3 100644 --- a/bsp/mini2440/mini2440_ram.ld +++ b/bsp/mini2440/mini2440_ram.ld @@ -3,83 +3,89 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { - . = 0x30000000; + . = 0x30000000; - . = ALIGN(4); - .text : - { - *(.init) - *(.text) - *(.gnu.linkonce.t*) - - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - . = ALIGN(4); + . = ALIGN(4); + .text : + { + *(.init) + *(.text) + *(.gnu.linkonce.t*) + + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + . = ALIGN(4); - /* section information for modules */ - . = ALIGN(4); - __rtmsymtab_start = .; - KEEP(*(RTMSymTab)) - __rtmsymtab_end = .; - } + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); - . = ALIGN(4); - .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) } + /* section information for modules */ + . = ALIGN(4); + __rtmsymtab_start = .; + KEEP(*(RTMSymTab)) + __rtmsymtab_end = .; + } - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(__ctors_end__ = .); - } + . = ALIGN(4); + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) } - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(__dtors_end__ = .); - } + . = ALIGN(4); + .ctors : + { + PROVIDE(__ctors_start__ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(__ctors_end__ = .); + } - . = ALIGN(4); - .data : - { - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - } + .dtors : + { + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(__dtors_end__ = .); + } - . = ALIGN(4); - .nobss : { *(.nobss) } + . = ALIGN(4); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + } - . = 0x30200000; - . = ALIGN(4); - __bss_start = .; - .bss : { *(.bss) } - __bss_end = .; + . = ALIGN(4); + .nobss : { *(.nobss) } - /* stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } + . = 0x30200000; + . = ALIGN(4); + __bss_start = .; + .bss : { *(.bss) } + __bss_end = .; - _end = .; + /* stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } + + _end = .; } diff --git a/bsp/mini4020/SConstruct b/bsp/mini4020/SConstruct index ab4953a152..c40ec891fa 100644 --- a/bsp/mini4020/SConstruct +++ b/bsp/mini4020/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/sam7x/SConstruct b/bsp/sam7x/SConstruct index 512ef55d50..83714f5ad8 100644 --- a/bsp/sam7x/SConstruct +++ b/bsp/sam7x/SConstruct @@ -30,8 +30,5 @@ objs = PrepareBuilding(env, RTT_ROOT) # kernel testsuite #objs = objs + SConscript(RTT_ROOT + '/examples/kernel/SConscript', variant_dir='build/examples/kernel', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/sam7x/sam7x_rom.ld b/bsp/sam7x/sam7x_rom.ld index 41522bc2cd..2ceb8ee9e1 100644 --- a/bsp/sam7x/sam7x_rom.ld +++ b/bsp/sam7x/sam7x_rom.ld @@ -2,48 +2,54 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) MEMORY { - CODE (rx) : ORIGIN = 0x00100000, LENGTH = 0x00040000 - /* DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000 */ - DATA (rw) : ORIGIN = 0x00204000, LENGTH = 0x0000C000 + CODE (rx) : ORIGIN = 0x00100000, LENGTH = 0x00040000 + /* DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000 */ + DATA (rw) : ORIGIN = 0x00204000, LENGTH = 0x0000C000 } ENTRY(_start) SECTIONS { - .text : - { - *(.init) - *(.text) - *(.rodata) + .text : + { + *(.init) + *(.text) + *(.rodata) - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - . = ALIGN(4); + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + . = ALIGN(4); - } > CODE = 0 + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(__ctors_end__ = .); - } > CODE + } > CODE = 0 - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(__dtors_end__ = .); - } > CODE + . = ALIGN(4); + .ctors : + { + PROVIDE(__ctors_start__ = .); + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + PROVIDE(__ctors_end__ = .); + } > CODE + + .dtors : + { + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(__dtors_end__ = .); + } > CODE /* .ARM.exidx is sorted, so has to go in its own output section. */ __exidx_start = .; @@ -71,12 +77,12 @@ SECTIONS /* This is used by the startup in order to initialize the .data secion */ _edata = . ; } >DATA - __data_end = .; + __data_end = .; - .noinit : - { - *(.bss.noinit) - } > DATA + .noinit : + { + *(.bss.noinit) + } > DATA __bss_start = .; .bss : diff --git a/bsp/stm32f0x/SConstruct b/bsp/stm32f0x/SConstruct index 5524a00e6f..5813f6442c 100644 --- a/bsp/stm32f0x/SConstruct +++ b/bsp/stm32f0x/SConstruct @@ -30,8 +30,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/stm32f0x/stm32_rom.ld b/bsp/stm32f0x/stm32_rom.ld index 4eaced033a..6070bf4af6 100644 --- a/bsp/stm32f0x/stm32_rom.ld +++ b/bsp/stm32f0x/stm32_rom.ld @@ -38,6 +38,13 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + /* section information for initial. */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 @@ -70,12 +77,12 @@ SECTIONS _edata = . ; } >DATA - .stack : - { - . = . + _system_stack_size; - . = ALIGN(4); - _estack = .; - } >DATA + .stack : + { + . = . + _system_stack_size; + . = ALIGN(4); + _estack = .; + } >DATA __bss_start = .; .bss : diff --git a/bsp/stm32f107/stm32_rom.ld b/bsp/stm32f107/stm32_rom.ld index c4547e26eb..9b554cbdcf 100644 --- a/bsp/stm32f107/stm32_rom.ld +++ b/bsp/stm32f107/stm32_rom.ld @@ -39,6 +39,13 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + /* section information for initial. */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 @@ -71,12 +78,12 @@ SECTIONS _edata = . ; } >DATA - .stack : - { - . = . + _system_stack_size; - . = ALIGN(4); - _estack = .; - } >DATA + .stack : + { + . = . + _system_stack_size; + . = ALIGN(4); + _estack = .; + } >DATA __bss_start = .; .bss : diff --git a/bsp/stm32f10x/SConstruct b/bsp/stm32f10x/SConstruct index 37d86a7b5f..54df76872b 100644 --- a/bsp/stm32f10x/SConstruct +++ b/bsp/stm32f10x/SConstruct @@ -33,8 +33,5 @@ objs = PrepareBuilding(env, RTT_ROOT) # STM32 firemare library building script objs = objs + SConscript( GetCurrentDir() + '/Libraries/SConscript', variant_dir='build/bsp/Libraries', duplicate=0) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/stm32f10x/stm32_rom.ld b/bsp/stm32f10x/stm32_rom.ld index 0d738fa0d6..20c27f6f1a 100644 --- a/bsp/stm32f10x/stm32_rom.ld +++ b/bsp/stm32f10x/stm32_rom.ld @@ -39,6 +39,13 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + /* section information for initial. */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 @@ -71,12 +78,12 @@ SECTIONS _edata = . ; } >DATA - .stack : - { - . = . + _system_stack_size; - . = ALIGN(4); - _estack = .; - } >DATA + .stack : + { + . = . + _system_stack_size; + . = ALIGN(4); + _estack = .; + } >DATA __bss_start = .; .bss : diff --git a/bsp/stm32f20x/SConstruct b/bsp/stm32f20x/SConstruct index 820f23541b..ae13ebd5bf 100644 --- a/bsp/stm32f20x/SConstruct +++ b/bsp/stm32f20x/SConstruct @@ -30,8 +30,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/stm32f20x/stm32_rom.ld b/bsp/stm32f20x/stm32_rom.ld index 9febc55f76..2c4914fb94 100644 --- a/bsp/stm32f20x/stm32_rom.ld +++ b/bsp/stm32f20x/stm32_rom.ld @@ -7,7 +7,7 @@ MEMORY { CODE (rx) : ORIGIN = 0x08000000, LENGTH = 512k /* 512KB flash */ - DATA (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 64K sram */ + DATA (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 64K sram */ } ENTRY(Reset_Handler) _system_stack_size = 0x100; @@ -39,6 +39,13 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + /* section information for initial. */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 @@ -71,12 +78,12 @@ SECTIONS _edata = . ; } >DATA - .stack : - { - . = . + _system_stack_size; - . = ALIGN(4); - _estack = .; - } >DATA + .stack : + { + . = . + _system_stack_size; + . = ALIGN(4); + _estack = .; + } >DATA __bss_start = .; .bss : diff --git a/bsp/stm32f40x/SConstruct b/bsp/stm32f40x/SConstruct index d479caa4c0..a58e07aa4b 100644 --- a/bsp/stm32f40x/SConstruct +++ b/bsp/stm32f40x/SConstruct @@ -30,8 +30,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/stm32f40x/stm32_rom.ld b/bsp/stm32f40x/stm32_rom.ld index 0d738fa0d6..20c27f6f1a 100644 --- a/bsp/stm32f40x/stm32_rom.ld +++ b/bsp/stm32f40x/stm32_rom.ld @@ -39,6 +39,13 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + /* section information for initial. */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0 @@ -71,12 +78,12 @@ SECTIONS _edata = . ; } >DATA - .stack : - { - . = . + _system_stack_size; - . = ALIGN(4); - _estack = .; - } >DATA + .stack : + { + . = . + _system_stack_size; + . = ALIGN(4); + _estack = .; + } >DATA __bss_start = .; .bss : diff --git a/bsp/taihu/applications/SConscript b/bsp/taihu/applications/SConscript index d73cc9337a..0e743b599a 100644 --- a/bsp/taihu/applications/SConscript +++ b/bsp/taihu/applications/SConscript @@ -4,7 +4,7 @@ from building import * cwd = GetCurrentDir() src = Glob('*.c') -CPPPATH = [cwd, Dir('#')] +CPPPATH = [cwd, str(Dir('#'))] group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/upd70f3454/SConstruct b/bsp/upd70f3454/SConstruct index 66a6dcd1c5..589cdbeb80 100644 --- a/bsp/upd70f3454/SConstruct +++ b/bsp/upd70f3454/SConstruct @@ -30,8 +30,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/x86/SConstruct b/bsp/x86/SConstruct index 8246fe46c9..c885c34448 100644 --- a/bsp/x86/SConstruct +++ b/bsp/x86/SConstruct @@ -25,8 +25,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/xplorer4330/m4/SConstruct b/bsp/xplorer4330/m4/SConstruct index d3abfc5ff1..1554677f62 100644 --- a/bsp/xplorer4330/m4/SConstruct +++ b/bsp/xplorer4330/m4/SConstruct @@ -30,8 +30,5 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -# build program -env.Program(TARGET, objs) - -# end building -EndBuilding(TARGET) +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/xplorer4330/m4/lpc4330_xplorer_spifi32mb.ld b/bsp/xplorer4330/m4/lpc4330_xplorer_spifi32mb.ld index 9437d73135..08dc8f958e 100644 --- a/bsp/xplorer4330/m4/lpc4330_xplorer_spifi32mb.ld +++ b/bsp/xplorer4330/m4/lpc4330_xplorer_spifi32mb.ld @@ -38,6 +38,12 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + . = ALIGN(4); _etext = .; } > CODE = 0