This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: "Undefined symbols"
Hi Nick,
Nick Clifton wrote:
>
> L31 is a local label, which may be why it is being ignored by the
> linker.
>
> You could try adding "--trace-symbol L31" to your linker command line
> to see if this helps.
Thanks for your tips.
I have found the solution. Basically, adding such a piece of code in
`elf32-target.c' (target is our target name like elf32-mips.c)
________________________________________________________________________
if (bfd_is_und_section (symbol->section) && (abfd == (bfd *) NULL)) {
return bfd_reloc_undefined;
}
return bfd_reloc_ok;
__________________________________________________________________________
Therefore, when linker tries to resolve a relocated symbol at last pass,
it will first check whether the symbol is still in the `UND' section.
If that is the case, it will return an undefined error.
Thanks
--Xinan