OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
SEARCH_DIR(.)
INCLUDE "memory.ld"

/* Section Definitions */ 
SECTIONS 
{ 
       
    .text : 
    { 
        KEEP(*(.isr_vector .isr_vector.*))  /* keep interrupt vector at default position */
    } >rom
     
         
     .boot : /* create boot-section between isr-vectors and user code*/
     AT (0x20000000)	/*  relocate to ram begin */
     {
    	_sram_code = .	;		/* save start adress of code */
      	..\obj\boot.o *(.text);	/* link code to ram-position*/
     	_eram_code = . ; 		/* save end adress of code*/
     }  > rom 
     	  	
     	
 /* first try */
 /*   .text : 
    {   
        *(.text .text.* .gnu.linkonce.t.*) 	      
        *(.glue_7t) *(.glue_7)		                
        *(.rodata .rodata* .gnu.linkonce.r.*)		    	                  
    } > rom */
 /* end first try*/

/* second try: */  
    .text : 
   {   
        ..\obj\main.o *(.text);
        ..\obj\stm32f4xx_gpio.o *(.text);
        ..\obj\startup_stm32f4xx.o *(.text);  
        ..\obj\stm32f4xx_rcc.o *(.text); 
		..\obj\system_stm32f4xx.o *(.text); 
		        
/*        *(.glue_7t) *(.glue_7)		                
        *(.rodata .rodata* .gnu.linkonce.r.*)	*/	    	                  
    } > rom 
/* end second try*/    
    
    .ARM.extab : 
    {
        *(.ARM.extab* .gnu.linkonce.armextab.*)
    } > rom
    
    .ARM.exidx :
    {
        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
    } > rom
    
     . = ALIGN(4); 
     _etext = .;
    _sidata = .; 
    
      		
    .data : AT (_etext) 
    { 
        _sdata = .; 
        *(.data .data.*) 
        . = ALIGN(4); 
        _edata = . ;
    } > ram

    /* .bss section which is used for uninitialized data */ 
    .bss (NOLOAD) : 
    { 
        _sbss = . ; 
        *(.bss .bss.*) 
        *(COMMON) 
        . = ALIGN(4); 
        _ebss = . ; 
    } > ram
    
    /* stack section */
    .co_stack (NOLOAD):
    {
        . = ALIGN(8);
        *(.co_stack .co_stack.*)
    } > ram
       
    . = ALIGN(4); 
    _end = . ; 
} 