This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: as/ld silently creates programs with undefined references/symbols
- From: Daniel Jacobowitz <drow at false dot org>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Russell King <rmk at arm dot linux dot org dot uk>,Richard Earnshaw <rearnsha at arm dot com>, binutils at sources dot redhat dot com
- Date: Mon, 4 Oct 2004 09:50:14 -0400
- Subject: Re: as/ld silently creates programs with undefined references/symbols
- References: <20040711121944.B13616@flint.arm.linux.org.uk> <40F243E2.2070506@redhat.com> <1089620642.8278.68.camel@pc960.cambridge.arm.com> <20040712092625.A2623@flint.arm.linux.org.uk> <1089621632.8278.72.camel@pc960.cambridge.arm.com> <20040808165653.B17968@flint.arm.linux.org.uk> <411CF9DA.5090202@redhat.com> <4121BE71.6060508@redhat.com> <20040923104005.A18950@flint.arm.linux.org.uk> <415A799E.2030706@redhat.com>
On Wed, Sep 29, 2004 at 10:00:14AM +0100, Nick Clifton wrote:
> Hi Russell, Hi Richard,
>
> >The Linux kernel is an example of a build system which parses the output
> >from "nm" in order to build an internal symbol table. As I highlighted
> >before, this whole "mapping symbol" business is severly affecting the
> >usefulness of the toolchain and it is imperative that this problem is
> >fully resolved before binutils 2.16.
>
> I have a prototype solution to this problem, but I would like more input
> from anyone who is interested. My idea is to provide a new function in
> the BFD ABI:
>
> bfd_boolean bfd_is_target_special_symbol (bfd *, asymbol *);
>
> This function will determine if a given symbol symbol in a symbol table
> is "special" in some target specific sense. I decided that this would
> be a safer approach, rather than adding code to make BFD produce
> abbreviated symbol tables with the special symbols stripped. In my
> experience modifying symbol tables in BFD is very tricky.
This matches my experience; in the archives somewhere I attempted to
remove them from the symbol table, and completely broke the linker.
> I am attaching a proof of concept patch which applied to today's
> mainline binutils sources. It uses this new function to implement a new
> command line switch to nm: "--skip-special" which will successfully
> remove any of the ARM mapping symbols from its output.
Should this be the default?
> Does anyone have any comments on this proposed solution ? One thing I
> wondered was whether bfd_is_target_special_symbol() should return a
> string instead of a boolean. It could return a NULL pointer for normal
> symbols and some kind of description for special symbols. Then the
> caller could decide to print this description if it was displaying the
> symbol to a user.
I don't think that's necessary.
--
Daniel Jacobowitz