reloc against common symbols

Vineet Sharma, Noida vineets@noida.hcltech.com
Mon Feb 9 11:37:00 GMT 2004


Hi, 
     Let me put my question in another way.
	
	Consider
 
 	 __y:		 .short  _x+28 //Reloc generated here
       		 .global _z
       		 .align  1
	_z:
       		 .short  1
        		.comm _x,120  //Symbol in Question

     Now when the coff_XXX_reloc() is called in coff-XXX.c, there the
"struct symbol" passed as an argument does not
     contain the address of the symbol(in this case _x) in the "value"
attribute of struct symbol.It contains the length(ie 	120) in this case.
		   While it is supposed to contain the address of the _x
symbol.

     So how do we calculate the address of the common symbols?


	Hope i have made my point clear, if still there are some ambiguity
or clarifications needed plz let me know.


With Regards
Vineet


	My problem is when the assembler encounter any common symbol like
".comm _x,120".
	So now when i need to fix any reloc against this symbol _x say
".short  _x+28".
      Now when the coff_XXX_reloc function is called the value attribute of
the symbol argument contains 120
	rather than 

-----Original Message-----
From: Ian Lance Taylor [mailto:ian@wasabisystems.com]
Sent: Thursday, February 05, 2004 11:33 PM
To: Vineet Sharma, Noida
Cc: binutils@sources.redhat.com
Subject: Re: reloc against common symbols


"Vineet Sharma, Noida" <vineets@noida.hcltech.com> writes:

> "How do we handle a relocation against a coomon symbol"?I have seen a lot
of
> cooments in 386 and m68k files of coff?. But what and why are they doing
> that way, is not clean. Any comments and suggestion are welcome?

I'm afraid that I don't understand what you are saying.

If you want to report a bug, then follow the instructions in
binutils/README.

Ian



More information about the Binutils mailing list