This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Assembler question


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


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