update linker script for components auto initial.

This commit is contained in:
aozima 2013-07-11 23:07:16 +08:00
parent 51532ae425
commit cc8301d0f1
19 changed files with 613 additions and 495 deletions

View File

@ -3,83 +3,89 @@ OUTPUT_ARCH(arm)
ENTRY(_start) ENTRY(_start)
SECTIONS SECTIONS
{ {
. = 0x20000000; . = 0x20000000;
. = ALIGN(4); . = ALIGN(4);
.text : .text :
{ {
*(.init) *(.init)
*(.text) *(.text)
*(.gnu.linkonce.t*) *(.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);
/* section information for modules */ . = ALIGN(4);
. = ALIGN(4); __rt_init_start = .;
__rtmsymtab_start = .; KEEP(*(SORT(.rti_fn*)))
KEEP(*(RTMSymTab)) __rt_init_end = .;
__rtmsymtab_end = .; . = ALIGN(4);
}
. = ALIGN(4); /* section information for modules */
.rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) } . = ALIGN(4);
__rtmsymtab_start = .;
KEEP(*(RTMSymTab))
__rtmsymtab_end = .;
}
. = ALIGN(4); . = ALIGN(4);
.ctors : .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) }
{
PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);
}
.dtors : . = ALIGN(4);
{ .ctors :
PROVIDE(__dtors_start__ = .); {
KEEP(*(SORT(.dtors.*))) PROVIDE(__ctors_start__ = .);
KEEP(*(.dtors)) KEEP(*(SORT(.ctors.*)))
PROVIDE(__dtors_end__ = .); KEEP(*(.ctors))
} PROVIDE(__ctors_end__ = .);
}
. = ALIGN(4); .dtors :
.data : {
{ PROVIDE(__dtors_start__ = .);
*(.data) KEEP(*(SORT(.dtors.*)))
*(.data.*) KEEP(*(.dtors))
*(.gnu.linkonce.d*) PROVIDE(__dtors_end__ = .);
} }
. = ALIGN(4); . = ALIGN(4);
.nobss : { *(.nobss) } .data :
{
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
}
. = 0x20300000; . = ALIGN(4);
. = ALIGN(4); .nobss : { *(.nobss) }
__bss_start = .;
.bss : { *(.bss) }
__bss_end = .;
/* stabs debugging sections. */ . = 0x20300000;
.stab 0 : { *(.stab) } . = ALIGN(4);
.stabstr 0 : { *(.stabstr) } __bss_start = .;
.stab.excl 0 : { *(.stab.excl) } .bss : { *(.bss) }
.stab.exclstr 0 : { *(.stab.exclstr) } __bss_end = .;
.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 = .; /* 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 = .;
} }

View File

@ -1,8 +1,8 @@
/***************************************************************************//** /***************************************************************************//**
* @file efm32_rom_g.ld * @file efm32_rom_g.ld
* @brief Linker script for EFM32 gecko * @brief Linker script for EFM32 gecko
* COPYRIGHT (C) 2012, RT-Thread Development Team * COPYRIGHT (C) 2012, RT-Thread Development Team
* @author Bernard, onelife * @author Bernard, onelife
* @version 1.0 * @version 1.0
******************************************************************************* *******************************************************************************
* @section License * @section License
@ -10,11 +10,11 @@
* LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
******************************************************************************* *******************************************************************************
* @section Change Logs * @section Change Logs
* Date Author Notes * Date Author Notes
* 2009-10-14 Bernard first version * 2009-10-14 Bernard first version
* 2010-12-22 onelife Modify for EFM32 * 2010-12-22 onelife Modify for EFM32
* 2011-07-06 onelife Modify to make use the start code in libraries * 2011-07-06 onelife Modify to make use the start code in libraries
* 2012-05-15 onelife Modified to compatible with CMSIS v3 * 2012-05-15 onelife Modified to compatible with CMSIS v3
******************************************************************************/ ******************************************************************************/
MEMORY MEMORY
{ {
@ -53,122 +53,129 @@ ENTRY(Reset_Handler)
SECTIONS SECTIONS
{ {
.text : .text :
{ {
KEEP(*(.isr_vector)) KEEP(*(.isr_vector))
*(.text*) *(.text*)
KEEP(*(.init)) KEEP(*(.init))
KEEP(*(.fini)) KEEP(*(.fini))
/* .ctors */ /* .ctors */
*crtbegin.o(.ctors) *crtbegin.o(.ctors)
*crtbegin?.o(.ctors) *crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*)) *(SORT(.ctors.*))
*(.ctors) *(.ctors)
/* .dtors */ /* .dtors */
*crtbegin.o(.dtors) *crtbegin.o(.dtors)
*crtbegin?.o(.dtors) *crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*)) *(SORT(.dtors.*))
*(.dtors) *(.dtors)
*(.rodata*) *(.rodata*)
KEEP(*(.eh_frame*)) KEEP(*(.eh_frame*))
/* 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 = .;
} > FLASH = 0
.ARM.extab : . = ALIGN(4);
{ __rt_init_start = .;
*(.ARM.extab* .gnu.linkonce.armextab.*) KEEP(*(SORT(.rti_fn*)))
} > FLASH __rt_init_end = .;
. = ALIGN(4);
__exidx_start = .; } > FLASH = 0
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > FLASH
__exidx_end = .;
__etext = .; .ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > FLASH
.data : AT (__etext) __exidx_start = .;
{ .ARM.exidx :
__data_start__ = .; {
*(vtable) *(.ARM.exidx* .gnu.linkonce.armexidx.*)
*(.data*) } > FLASH
*(.ram) __exidx_end = .;
. = ALIGN(4); __etext = .;
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4); .data : AT (__etext)
/* init data */ {
PROVIDE_HIDDEN (__init_array_start = .); __data_start__ = .;
KEEP(*(SORT(.init_array.*))) *(vtable)
KEEP(*(.init_array)) *(.data*)
PROVIDE_HIDDEN (__init_array_end = .); *(.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); . = ALIGN(4);
/* finit data */ /* finit data */
PROVIDE_HIDDEN (__fini_array_start = .); PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*))) KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array)) KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .); PROVIDE_HIDDEN (__fini_array_end = .);
. = ALIGN(4); . = ALIGN(4);
/* All data end */ /* All data end */
__data_end__ = .; __data_end__ = .;
} > RAM } > RAM
.bss : .bss :
{ {
__bss_start__ = .; __bss_start__ = .;
*(.bss*) *(.bss*)
*(COMMON) *(COMMON)
__bss_end__ = .; __bss_end__ = .;
} > RAM } > RAM
.heap : .heap :
{ {
__end__ = .; __end__ = .;
end = __end__; end = __end__;
_end = __end__; _end = __end__;
*(.heap*) *(.heap*)
__HeapLimit = .; __HeapLimit = .;
} > RAM } > RAM
/* .stack_dummy section doesn't contains any symbols. It is only /* .stack_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign * used for linker to calculate size of stack sections, and assign
* values to stack symbols later */ * values to stack symbols later */
.stack_dummy : .stack_dummy :
{ {
*(.stack) *(.stack)
} > RAM } > RAM
/* Set stack top to end of RAM, and stack limit move down by /* Set stack top to end of RAM, and stack limit move down by
* size of stack_dummy section */ * size of stack_dummy section */
__StackTop = ORIGIN(RAM) + LENGTH(RAM); __StackTop = ORIGIN(RAM) + LENGTH(RAM);
__StackLimit = __StackTop - SIZEOF(.stack_dummy); __StackLimit = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop); PROVIDE(__stack = __StackTop);
/* Check if data + heap + stack exceeds RAM limit */ /* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
} }

View File

@ -37,6 +37,12 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0

View File

@ -37,6 +37,12 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0

View File

@ -50,7 +50,13 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
} > FLASH . = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
} > FLASH
.data : AT(ADDR(.text) + SIZEOF(.text)) .data : AT(ADDR(.text) + SIZEOF(.text))
{ {

View File

@ -36,9 +36,10 @@ SECTIONS
__vsymtab_start = .; __vsymtab_start = .;
KEEP(*(VSymTab)) KEEP(*(VSymTab))
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
__rt_init_start = .; __rt_init_start = .;
KEEP(*(.rti_fn*)) KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .; __rt_init_end = .;
. = ALIGN(4); . = ALIGN(4);

View File

@ -38,6 +38,12 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0

View File

@ -4,8 +4,8 @@ OUTPUT_ARCH(arm)
MEMORY MEMORY
{ {
CODE (rx) : ORIGIN = 0x00000000, LENGTH = 512k /* 512KB flash */ CODE (rx) : ORIGIN = 0x00000000, LENGTH = 512k /* 512KB flash */
DATA (rw) : ORIGIN = 0x40000000, LENGTH = 32k /* 32K sram */ DATA (rw) : ORIGIN = 0x40000000, LENGTH = 32k /* 32K sram */
} }
ENTRY(_start) ENTRY(_start)
@ -18,49 +18,55 @@ _svc_tack_size = 0x400;
SECTIONS SECTIONS
{ {
. = 0; . = 0;
. = ALIGN(4); . = ALIGN(4);
.text : .text :
{ {
*(.init) *(.init)
*(.text) *(.text)
*(.rodata) *(.rodata)
*(.rodata*) *(.rodata*)
*(.glue_7) *(.glue_7)
*(.glue_7t) *(.glue_7t)
/* 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);
} >CODE . = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); } >CODE
.ctors :
{
PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);
} > CODE
.dtors : . = ALIGN(4);
{ .ctors :
PROVIDE(__dtors_start__ = .); {
KEEP(*(SORT(.dtors.*))) PROVIDE(__ctors_start__ = .);
KEEP(*(.dtors)) KEEP(*(SORT(.ctors.*)))
PROVIDE(__dtors_end__ = .); KEEP(*(.ctors))
} > CODE 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. */ /* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .; __exidx_start = .;
@ -73,7 +79,7 @@ SECTIONS
} > CODE } > CODE
__exidx_end = .; __exidx_end = .;
/* .data section which is used for initialized data */ /* .data section which is used for initialized data */
.data : AT (_sidata) .data : AT (_sidata)
{ {
. = ALIGN(4); . = ALIGN(4);
@ -88,36 +94,36 @@ SECTIONS
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;
} >DATA } >DATA
__data_end = .; __data_end = .;
.noinit : .noinit :
{ {
*(.bss.noinit) *(.bss.noinit)
} > DATA } > DATA
.stack : .stack :
{ {
. = ALIGN(4); . = ALIGN(4);
_undefined_stack_base = .; _undefined_stack_base = .;
. = . + _undefined_tack_size; . = . + _undefined_tack_size;
_undefined_stack_top = .; _undefined_stack_top = .;
_abort_stack_base = .; _abort_stack_base = .;
. = . + _abort_tack_size; . = . + _abort_tack_size;
_abort_stack_top = .; _abort_stack_top = .;
_fiq_stack_base = .; _fiq_stack_base = .;
. = . + _fiq_tack_size; . = . + _fiq_tack_size;
_fiq_stack_top = .; _fiq_stack_top = .;
_irq_stack_base = .; _irq_stack_base = .;
. = . + _irq_tack_size; . = . + _irq_tack_size;
_irq_stack_top = .; _irq_stack_top = .;
_svc_stack_base = .; _svc_stack_base = .;
. = . + _svc_tack_size; . = . + _svc_tack_size;
_svc_stack_top = .; _svc_stack_top = .;
} >DATA } >DATA
__bss_start = .; __bss_start = .;
.bss : .bss :
@ -135,8 +141,8 @@ SECTIONS
} > DATA } > DATA
__bss_end = .; __bss_end = .;
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
. = ALIGN(32 / 8); . = ALIGN(32 / 8);
} }

View File

@ -15,8 +15,8 @@ SECTIONS
{ {
.text : .text :
{ {
*(.init) *(.init)
*(.text) *(.text)
*(.text.*) /* remaining code */ *(.text.*) /* remaining code */
*(.rodata) /* read-only data (constants) */ *(.rodata) /* read-only data (constants) */
*(.rodata*) *(.rodata*)
@ -35,26 +35,32 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0
. = ALIGN(4); . = ALIGN(4);
.ctors : .ctors :
{ {
PROVIDE(__ctors_start__ = .); PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*))) KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors)) KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .); PROVIDE(__ctors_end__ = .);
} > CODE } > CODE
.dtors : .dtors :
{ {
PROVIDE(__dtors_start__ = .); PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*))) KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors)) KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .); PROVIDE(__dtors_end__ = .);
} > CODE } > CODE
/* .ARM.exidx is sorted, so has to go in its own output section. */ /* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .; __exidx_start = .;
@ -82,12 +88,12 @@ SECTIONS
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;
} >DATA } >DATA
__data_end = .; __data_end = .;
.noinit : .noinit :
{ {
*(.bss.noinit) *(.bss.noinit)
} > DATA } > DATA
__bss_start = .; __bss_start = .;
.bss : .bss :

View File

@ -32,6 +32,12 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0

View File

@ -41,76 +41,76 @@ PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
SECTIONS SECTIONS
{ {
.text : .text :
{ {
CREATE_OBJECT_SYMBOLS CREATE_OBJECT_SYMBOLS
__cs3_region_start_rom = .; __cs3_region_start_rom = .;
*(.cs3.region-head.rom) *(.cs3.region-head.rom)
__cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m; __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m;
*(.cs3.interrupt_vector) *(.cs3.interrupt_vector)
/* Make sure we pulled in an interrupt vector. */ /* Make sure we pulled in an interrupt vector. */
ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector"); ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector");
*(.rom) *(.rom)
*(.rom.b) *(.rom.b)
__cs3_reset = __cs3_reset_cortex_m; __cs3_reset = __cs3_reset_cortex_m;
*(.cs3.reset) *(.cs3.reset)
/* Make sure we pulled in some reset code. */ /* Make sure we pulled in some reset code. */
ASSERT (. != __cs3_reset, "No reset code"); ASSERT (. != __cs3_reset, "No reset code");
*(.text .text.* .gnu.linkonce.t.*) *(.text .text.* .gnu.linkonce.t.*)
*(.plt) *(.plt)
*(.gnu.warning) *(.gnu.warning)
*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
*(.rodata .rodata.* .gnu.linkonce.r.*) *(.rodata .rodata.* .gnu.linkonce.r.*)
*(.ARM.extab* .gnu.linkonce.armextab.*) *(.ARM.extab* .gnu.linkonce.armextab.*)
*(.gcc_except_table) *(.gcc_except_table)
*(.eh_frame_hdr) *(.eh_frame_hdr)
*(.eh_frame) *(.eh_frame)
. = ALIGN(4); . = ALIGN(4);
KEEP(*(.init)) KEEP(*(.init))
. = ALIGN(4); . = ALIGN(4);
__preinit_array_start = .; __preinit_array_start = .;
KEEP (*(.preinit_array)) KEEP (*(.preinit_array))
__preinit_array_end = .; __preinit_array_end = .;
. = ALIGN(4); . = ALIGN(4);
__init_array_start = .; __init_array_start = .;
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array)) KEEP (*(.init_array))
__init_array_end = .; __init_array_end = .;
. = ALIGN(0x4); . = ALIGN(0x4);
KEEP (*crtbegin.o(.ctors)) KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*))) KEEP (*(SORT(.ctors.*)))
KEEP (*crtend.o(.ctors)) KEEP (*crtend.o(.ctors))
. = ALIGN(4); . = ALIGN(4);
KEEP(*(.fini)) KEEP(*(.fini))
. = ALIGN(4); . = ALIGN(4);
__fini_array_start = .; __fini_array_start = .;
KEEP (*(.fini_array)) KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*))) KEEP (*(SORT(.fini_array.*)))
__fini_array_end = .; __fini_array_end = .;
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*))) KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors)) KEEP (*crtend.o(.dtors))
. = ALIGN(4); . = ALIGN(4);
__cs3_regions = .; __cs3_regions = .;
LONG (0) LONG (0)
LONG (__cs3_region_init_ram) LONG (__cs3_region_init_ram)
LONG (__cs3_region_start_ram) LONG (__cs3_region_start_ram)
LONG (__cs3_region_init_size_ram) LONG (__cs3_region_init_size_ram)
LONG (__cs3_region_zero_size_ram) LONG (__cs3_region_zero_size_ram)
/* section information for finsh shell */ /* section information for finsh shell */
. = ALIGN(4); . = ALIGN(4);
@ -122,35 +122,43 @@ SECTIONS
KEEP(*(VSymTab)) KEEP(*(VSymTab))
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
}
/* .ARM.exidx is sorted, so has to go in its own output section. */ . = ALIGN(4);
__exidx_start = .; __rt_init_start = .;
.ARM.exidx : KEEP(*(SORT(.rti_fn*)))
{ __rt_init_end = .;
*(.ARM.exidx* .gnu.linkonce.armexidx.*) . = ALIGN(4);
} >rom
__exidx_end = .; }
.text.align :
{ /* .ARM.exidx is sorted, so has to go in its own output section. */
. = ALIGN(8); __exidx_start = .;
_etext = .; .ARM.exidx :
} >rom {
__cs3_region_size_rom = LENGTH(rom); *(.ARM.exidx* .gnu.linkonce.armexidx.*)
__cs3_region_num = 1; } >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 : .bss :
{ {
*(.shbss) *(.shbss)
@ -161,6 +169,7 @@ SECTIONS
_end = .; _end = .;
__end = .; __end = .;
} >ram AT>rom } >ram AT>rom
.heap : .heap :
{ {
*(.heap) *(.heap)

View File

@ -3,83 +3,89 @@ OUTPUT_ARCH(arm)
ENTRY(_start) ENTRY(_start)
SECTIONS SECTIONS
{ {
. = 0x30000000; . = 0x30000000;
. = ALIGN(4); . = ALIGN(4);
.text : .text :
{ {
*(.init) *(.init)
*(.text) *(.text)
*(.gnu.linkonce.t*) *(.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);
/* section information for modules */ . = ALIGN(4);
. = ALIGN(4); __rt_init_start = .;
__rtmsymtab_start = .; KEEP(*(SORT(.rti_fn*)))
KEEP(*(RTMSymTab)) __rt_init_end = .;
__rtmsymtab_end = .; . = ALIGN(4);
}
. = ALIGN(4); /* section information for modules */
.rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) } . = ALIGN(4);
__rtmsymtab_start = .;
KEEP(*(RTMSymTab))
__rtmsymtab_end = .;
}
. = ALIGN(4); . = ALIGN(4);
.ctors : .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) }
{
PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);
}
.dtors : . = ALIGN(4);
{ .ctors :
PROVIDE(__dtors_start__ = .); {
KEEP(*(SORT(.dtors.*))) PROVIDE(__ctors_start__ = .);
KEEP(*(.dtors)) KEEP(*(SORT(.ctors.*)))
PROVIDE(__dtors_end__ = .); KEEP(*(.ctors))
} PROVIDE(__ctors_end__ = .);
}
. = ALIGN(4); .dtors :
.data : {
{ PROVIDE(__dtors_start__ = .);
*(.data) KEEP(*(SORT(.dtors.*)))
*(.data.*) KEEP(*(.dtors))
*(.gnu.linkonce.d*) PROVIDE(__dtors_end__ = .);
} }
. = ALIGN(4); . = ALIGN(4);
.nobss : { *(.nobss) } .data :
{
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
}
. = 0x30200000; . = ALIGN(4);
. = ALIGN(4); .nobss : { *(.nobss) }
__bss_start = .;
.bss : { *(.bss) }
__bss_end = .;
/* stabs debugging sections. */ . = 0x30200000;
.stab 0 : { *(.stab) } . = ALIGN(4);
.stabstr 0 : { *(.stabstr) } __bss_start = .;
.stab.excl 0 : { *(.stab.excl) } .bss : { *(.bss) }
.stab.exclstr 0 : { *(.stab.exclstr) } __bss_end = .;
.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 = .; /* 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 = .;
} }

View File

@ -2,48 +2,54 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm) OUTPUT_ARCH(arm)
MEMORY MEMORY
{ {
CODE (rx) : ORIGIN = 0x00100000, LENGTH = 0x00040000 CODE (rx) : ORIGIN = 0x00100000, LENGTH = 0x00040000
/* DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000 */ /* DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000 */
DATA (rw) : ORIGIN = 0x00204000, LENGTH = 0x0000C000 DATA (rw) : ORIGIN = 0x00204000, LENGTH = 0x0000C000
} }
ENTRY(_start) ENTRY(_start)
SECTIONS SECTIONS
{ {
.text : .text :
{ {
*(.init) *(.init)
*(.text) *(.text)
*(.rodata) *(.rodata)
/* 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);
} > CODE = 0 . = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); } > CODE = 0
.ctors :
{
PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);
} > CODE
.dtors : . = ALIGN(4);
{ .ctors :
PROVIDE(__dtors_start__ = .); {
KEEP(*(SORT(.dtors.*))) PROVIDE(__ctors_start__ = .);
KEEP(*(.dtors)) KEEP(*(SORT(.ctors.*)))
PROVIDE(__dtors_end__ = .); KEEP(*(.ctors))
} > CODE 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. */ /* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .; __exidx_start = .;
@ -71,12 +77,12 @@ SECTIONS
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;
} >DATA } >DATA
__data_end = .; __data_end = .;
.noinit : .noinit :
{ {
*(.bss.noinit) *(.bss.noinit)
} > DATA } > DATA
__bss_start = .; __bss_start = .;
.bss : .bss :

View File

@ -38,6 +38,13 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0
@ -70,12 +77,12 @@ SECTIONS
_edata = . ; _edata = . ;
} >DATA } >DATA
.stack : .stack :
{ {
. = . + _system_stack_size; . = . + _system_stack_size;
. = ALIGN(4); . = ALIGN(4);
_estack = .; _estack = .;
} >DATA } >DATA
__bss_start = .; __bss_start = .;
.bss : .bss :

View File

@ -39,6 +39,13 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0
@ -71,12 +78,12 @@ SECTIONS
_edata = . ; _edata = . ;
} >DATA } >DATA
.stack : .stack :
{ {
. = . + _system_stack_size; . = . + _system_stack_size;
. = ALIGN(4); . = ALIGN(4);
_estack = .; _estack = .;
} >DATA } >DATA
__bss_start = .; __bss_start = .;
.bss : .bss :

View File

@ -39,6 +39,13 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0
@ -71,12 +78,12 @@ SECTIONS
_edata = . ; _edata = . ;
} >DATA } >DATA
.stack : .stack :
{ {
. = . + _system_stack_size; . = . + _system_stack_size;
. = ALIGN(4); . = ALIGN(4);
_estack = .; _estack = .;
} >DATA } >DATA
__bss_start = .; __bss_start = .;
.bss : .bss :

View File

@ -7,7 +7,7 @@
MEMORY MEMORY
{ {
CODE (rx) : ORIGIN = 0x08000000, LENGTH = 512k /* 512KB flash */ 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) ENTRY(Reset_Handler)
_system_stack_size = 0x100; _system_stack_size = 0x100;
@ -39,6 +39,13 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0
@ -71,12 +78,12 @@ SECTIONS
_edata = . ; _edata = . ;
} >DATA } >DATA
.stack : .stack :
{ {
. = . + _system_stack_size; . = . + _system_stack_size;
. = ALIGN(4); . = ALIGN(4);
_estack = .; _estack = .;
} >DATA } >DATA
__bss_start = .; __bss_start = .;
.bss : .bss :

View File

@ -39,6 +39,13 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0
@ -71,12 +78,12 @@ SECTIONS
_edata = . ; _edata = . ;
} >DATA } >DATA
.stack : .stack :
{ {
. = . + _system_stack_size; . = . + _system_stack_size;
. = ALIGN(4); . = ALIGN(4);
_estack = .; _estack = .;
} >DATA } >DATA
__bss_start = .; __bss_start = .;
.bss : .bss :

View File

@ -38,6 +38,12 @@ SECTIONS
__vsymtab_end = .; __vsymtab_end = .;
. = ALIGN(4); . = ALIGN(4);
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4); . = ALIGN(4);
_etext = .; _etext = .;
} > CODE = 0 } > CODE = 0