This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Assembler question
- From: Michael Meissner <gcc-help at the-meissners dot org>
- To: Sumesh UdayaKumaran <sumesh_uk at hotmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 9 Jun 2003 13:37:08 -0400
- Subject: Re: Assembler question
- References: <BAY1-F1347yBt6lDBRQ0000a488@hotmail.com>
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