reloc against common symbols

Ian Lance Taylor ian@wasabisystems.com
Thu Feb 12 13:35:00 GMT 2004


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

> This is full trace for coff_XXX_reloc() 
> 
> 
> 		ldwrite ();
> 		bfd_final_link()
> 		default_indirect_link_order()
> 		bfd_get_relocated_section_contents ()
> 		bfd_perform_relocation ()
> 		coff_XXX_reloc ()

That's not a backtrace, because bfd_final_link() is not a function.
It is a macro, and I am trying to find out what the real function is.
The easy way to get a backtrace is to use gdb.

The linker is supposed to call lang_common() to allocate all the
common symbols.  That sets the hash table entry to be a defined
symbol.  If you are using the generic linker, as seems likely, then
set_symbol_from_hash() is called on each symbol to set it to the hash
table entry.  The result is that coff_XXX_reloc() should never see a
common symbol.  It should only see defined symbols.

That is how it is supposed to work.  I think you are going to have to
debug the rest of this yourself.  Find out if any of those steps is
not happening.

Ian



More information about the Binutils mailing list