/* * GENERATED FILE - DO NOT EDIT * (C) Code Red Technologies Ltd, 2008-2014 * Generated linker script file for LPC1768 * Created from generic_c.ld (vLPCXpresso v5.2 (4 [Build 2122] [2013-04-29] )) * By LPCXpresso v5.2.4 [Build 2122] [2013-04-29] on Thu Jun 19 10:46:14 IST 2014 */ GROUP( libcr_nohost.a libcr_c.a libcr_eabihelpers.a ) MEMORY { /* Define each memory region */ MFlash512 (rx) : ORIGIN = 0x0000, LENGTH = 0x80000 RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32k */ RamAHB32 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x8000 /* 32k */ } /* Define a symbol for the top of each memory region */ __top_RamLoc32 = 0x10000000 + 0x8000; __top_RamAHB32 = 0x2007c000 + 0x8000; ENTRY(ResetISR) SECTIONS { .text_Flash2 : ALIGN(4) { FILL(0xff) *(.text_Flash2*) *(.text_MFlash512_246*) } > MFlash512_246 /* MAIN TEXT SECTION */ .text : ALIGN(4) { FILL(0xff) __vectors_start__ = ABSOLUTE(.) ; KEEP(*(.isr_vector)) /* Global Section Table */ . = ALIGN(4) ; __section_table_start = .; __data_section_table = .; LONG(LOADADDR(.data)); LONG( ADDR(.data)) ; LONG( SIZEOF(.data)); LONG(LOADADDR(.data_RAM2)); LONG( ADDR(.data_RAM2)) ; LONG( SIZEOF(.data_RAM2)); __data_section_table_end = .; __bss_section_table = .; LONG( ADDR(.bss)); LONG( SIZEOF(.bss)); LONG( ADDR(.bss_RAM2)); LONG( SIZEOF(.bss_RAM2)); __bss_section_table_end = .; __section_table_end = . ; /* End of Global Section Table */ *(.after_vectors*) } >MFlash512 .text : ALIGN(4) { *(.text*) *(.rodata .rodata.*) . = ALIGN(4); } > MFlash512 /* * for exception handling/unwind - some Newlib functions (in common * with C++ and STDC++) use this. */ .ARM.extab : ALIGN(4) { *(.ARM.extab* .gnu.linkonce.armextab.*) } > MFlash512 __exidx_start = .; .ARM.exidx : ALIGN(4) { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } > MFlash512 __exidx_end = .; _etext = .; /* DATA section for RamAHB32 */ .data_RAM2 : ALIGN(4) { FILL(0xff) *(.data.$RAM2*) *(.data.$RamAHB32*) . = ALIGN(4) ; } > RamAHB32 AT>MFlash512 /* MAIN DATA SECTION */ .uninit_RESERVED : ALIGN(4) { KEEP(*(.bss.$RESERVED*)) . = ALIGN(4) ; _end_uninit_RESERVED = .; } > RamLoc32 /* Main DATA section (RamLoc32) */ .data : ALIGN(4) { FILL(0xff) _data = . ; *(vtable) *(.data*) . = ALIGN(4) ; _edata = . ; } > RamLoc32 AT>MFlash512 /* BSS section for RamAHB32 */ .bss_RAM2 : ALIGN(4) { *(.bss.$RAM2*) *(.bss.$RamAHB32*) . = ALIGN(4) ; } > RamAHB32 /* MAIN BSS SECTION */ .bss : ALIGN(4) { _bss = .; *(.bss*) *(COMMON) . = ALIGN(4) ; _ebss = .; PROVIDE(end = .); } > RamLoc32 /* NOINIT section for RamAHB32 */ .noinit_RAM2 (NOLOAD) : ALIGN(4) { *(.noinit.$RAM2*) *(.noinit.$RamAHB32*) . = ALIGN(4) ; } > RamAHB32 /* DEFAULT NOINIT SECTION */ .noinit (NOLOAD): ALIGN(4) { _noinit = .; *(.noinit*) . = ALIGN(4) ; _end_noinit = .; } > RamLoc32 PROVIDE(_pvHeapStart = .); PROVIDE(_vStackTop = __top_RamLoc32 - 0); } |
10000000 l d .data00000000 .data 2007c000 l d .data_RAM200000000 .data_RAM2 10000424 l O .data00000048 xx1 10000478 l O .data00000001 A 1000047c l O .data00000004 B 10000480 l O .data00000004 C 10000484 l O .data00000004 D 100004dc l O .data00000004 E 100004e0 l O .data00000010 F 100004f0 l O .data0000001c G 1000050c l O .data0000013b H 1000064c l O .data0000001c I 10000668 l O .data000000dc J 10000744 l O .data00000004 K 10000748 l O .data00000004 L 100000c0 g O .data0000035c M 10000647 g O .data00000003 N 100004c8 g O .data00000010 O 10000498 g O .data00000018 P 1000041e g O .data00000002 Q 1000046c g O .data0000000c R 10000488 g O .data00000004 S 100004b0 g O .data00000018 T 10000420 g O .data00000001 U 100004d8 g O .data00000004 V 10000494 g O .data00000002 W 1000041d g O .data00000001 X 1000041c g O .data00000001 Y 2007c000 g O .data_RAM200000008 Z 10000000 g .data00000000 _data 1000074c g .data00000000 _edata 10000000 g O .data000000c0 AA 1000048c g O .data00000008 AB |
ResetISR(void) { unsigned long *pulSrc, *pulDest; // // Copy the data segment initializers from flash to SRAM. // pulsrc=&_etext; for(pulDest = &_data; pulDest < &_edata; ) { *pulDest++ = *pulSrc++; } // // Zero fill the bss segment. This is done with inline assembly since this // will clear the value of pulDest if it is not kept in a register. // __asm(" ldr r0, =_bss\n" " ldr r1, =_ebss\n" " mov r2, #0\n" " .thumb_func\n" "zero_loop:\n" " cmp r0, r1\n" " it lt\n" " strlt r2, [r0], #4\n" " blt zero_loop"); #ifdef __USE_CMSIS SystemInit(); #endif #if defined (__cplusplus) // // Call C++ library initialisation // __libc_init_array(); #endif #if defined (__REDLIB__) // Call the Redlib library, which in turn calls main() __main() ; #else main(); #endif // // main() shouldn't return, but if it does, we'll just enter an infinite loop // while (1) { ; } } |