This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: symbol resolution in linker?
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: "Vineet Sharma, Noida" <vineets at noida dot hcltech dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 28 Nov 2003 18:27:51 -0500
- Subject: Re: symbol resolution in linker?
- References: <1B3885BC15C7024C845AAC78314766C5012E9621@EXCH-01>
"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