/* Linker script to place sections and symbol values. * It references following symbols, which must be defined in code: * Vectors : Entry point * * It defines following symbols, which code can use without definition: * __code_start * __exidx_start * __exidx_end * __data_start * __preinit_array_start * __preinit_array_end * __init_array_start * __init_array_end * __fini_array_start * __fini_array_end * __bss_start__ * __bss_end__ * __end__ * __stack * __irq_stack * __stack */ ENTRY(Start) SECTIONS { .vectors 0x0: { __code_start = .; KEEP(*(StartUp)) } .init : { KEEP (*(SORT_NONE(.init))) } .text : { *(.text*) } .fini : { KEEP (*(SORT_NONE(.fini))) } .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .eh_frame : { KEEP (*(.eh_frame)) } .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } .ARM.exidx : { __exidx_start = .; *(.ARM.exidx* .gnu.linkonce.armexidx.*) __exidx_end = .; } .preinit_array : { PROVIDE_HIDDEN (__preinit_array_start = .); KEEP (*(.preinit_array)) PROVIDE_HIDDEN (__preinit_array_end = .); } .init_array 0x10000 : { PROVIDE_HIDDEN (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array )) PROVIDE_HIDDEN (__init_array_end = .); } .fini_array : { PROVIDE_HIDDEN (__fini_array_start = .); KEEP (*(SORT(.fini_array.*))) KEEP (*(.fini_array )) PROVIDE_HIDDEN (__fini_array_end = .); } .ctors : { /* gcc uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it doesn't matter if the user does not actually link against crtbegin.o; the linker won't look for a file to match a wildcard. The wildcard also means that it doesn't matter which directory crtbegin.o is in. */ KEEP (*crtbegin.o(.ctors)) KEEP (*crtbegin?.o(.ctors)) /* We don't want to include the .ctor section from the crtend.o file until after the sorted ctors. The .ctor section from the crtend file contains the end of ctors marker and it must be last */ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) } .dtors : { KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin?.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) } .jcr : { KEEP (*(.jcr)) } .code_end (NOLOAD): { __code_end = .; } .data : { __data_start = . ; *(.data .data.* .gnu.linkonce.d.*) SORT(CONSTRUCTORS) } .bss : { . = ALIGN(4); __bss_start__ = .; *(.bss*) *(COMMON) . = ALIGN(4); __bss_end__ = .; } .data_end (NOLOAD): { __data_end = .; } .heap 0x20000 (NOLOAD): { __heap_start = .; . = ALIGN(64); __end__ = .; PROVIDE(end = .); . = . + 0x1000; } .stack (NOLOAD): { . = ALIGN(64); . = . + 0x8000; __stack = .; } }