Assembler question

Michael Meissner gcc-help@the-meissners.org
Mon Jun 9 17:37:00 GMT 2003


On Mon, Jun 09, 2003 at 01:46:43PM +0000, Sumesh UdayaKumaran wrote:
> Thanks Michael , in my case A was a global variable, and my object format 
> was elf and architecture mcore. I was wodnering how gcc did the address 
> assignment.  Do you have some suggestion on this ?

As I said, the linker does the address assignment (except for things in shared
libraries where are setup at program start by the dynamic linker).  If the
variable has been assigned a value, the global variable will be in one of the
data sections such as .data, and the linker script controls where each section
goes in memory.  If the variable is a common value and has not been assigned an
address, the linker will assign this, based the linker script and code in BFD.

-- 
Michael Meissner
email: meissner@the-meissners.org
http://www.the-meissners.org



More information about the Gcc-help mailing list