Questions about Linker Scripts

Robert Floyd robert.floyd@inet.com
Mon Oct 23 13:10:00 GMT 2000


I have included a sample linker script that I am studying for learning
purposes.

Under the SECTIONS is .flash 0x00000000.  Am I correct that at this
point we are creating an output section name called .flash initalized to
zero at this moment?  It does not have any reference to anything else
and could have been labeled Gorilla or something, correct?

 __ftext = . ; appears to be setting __ftext = to the current location
counter, but why do this?  The GNU manual examples never show this kind
of format...and why redefine _etext to __etext (two underscores) ?

What purpose does *(ABS) serve in this linker script?

Thanks for any help on this.

Robert F.



MEMORY
{
	rom  : o = 0, l = 512k		  /* flash rom */
	dram : o = 0x09000000,	l = 2048k /* address for external DRAM */
	sram : o = 0x0f000000,	l = 8k	  /* on chip SRAM */
}

SECTIONS
{
	.flash  0x00000000 :
	{
	   __ftext = . ;
	   vectors.o (VECTORS)	
	   appstest.o (.text)	
	   *(.text)
	   *(.strings)
	   *(ABS)
	   __etext = . ;
	   
	   __fdata = . ;
	   *(.data)
	   __edata = . ;
	}  > rom
			
	.sram	0x0f000000 :
	{
	   __fbss = . ;
	   *(.bss)
	   *(COMMON)
	   __ebss = . ;
	}  > sram
			
	.stack	0x0f002000 :
	{
	   _stack = . ;
	   *(.stack)
	}
}

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list