This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: reloc against common symbols


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

>      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.

What program are we talking about here?  The assembler or the linker?
What target?  How precisely are you invoking the tool?  What is the
actual problem?

The linker will normally not pass common symbols to the relocation
functions, because they will normally have been allocated and
defined.

It is not a bug for the assembler to call a coff_XXX_reloc() routine
with a common symbol.  That will happen when the coff_XXX_reloc()
routine appears as a special_function in a howto structure, and is
called by bfd_install_relocation().  Relocation handling in BFD is a
mess; see bfd/doc/bfdint.texi for more information.

Ian


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