This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Questions about Linker Scripts



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]