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: symbol resolution in linker?


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

>     when my BFD_ASSEMBLER encounters an undefined label(say xyz), it makes
> and reloc entry of (xyz and section "*UND*"), and when my linker tries to
> reloc it finds section "*UND*" and coundn't find the absolute address for
> the symbol. Now which part in linker is responsible to find correct "xyz"
> symbol and pass it on to coff_XXX_reloc(abfd, reloc_entry, symbol_in, data,
> input_section, output_bfd,error_message) function any help.

This question seems a bit confused.

The linker works by reading the symbols of the input objects and
building a global symbol table.  It then reads all the relocs, and
resolves them using the global symbol table.  If the linker finds that
a relocation is against a symbol which is not in the global symbol
table, it reports an undefined symbol error.

If that does not help, you must either be much more specific, or you
must spend some time learning how linkers work.

> As of now i see that the bfd depends on reloc entry for symbol resolution
> even it was undefined?

How can you resolve a symbol if it was undefined?  How can a symbol be
undefined if there is no reloc entry for it?

Ian


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