ld problems

Alan Modra amodra@bigpond.net.au
Mon Sep 13 00:24:00 GMT 2004


On Sat, Sep 11, 2004 at 04:30:15PM +0200, Mattias Jansson wrote:
> typeinfo for neo::scene::Object: discarded in section
> `.gnu.linkonce.r._ZTIN3neo5scene6ObjectE' from
> build/scons/debug/engine/libneoengine-debug.a(object.o)
> collect2: ld returned 1 exit status

You didn't say the target or the version of ld where you found this
problem which makes it harder to give an answer because we have to
guess these details.  I'll guess x86 and 2.15 or one of HJ's 2.15.x
releases.  You also didn't give the version of gcc.

I expect that if someone analysed this problem properly, you would find
a reference to the typeinfo symbol in a normal section such as .data or
.rodata.  What's more, I'll make a wild guess that the reference is made
inside some function that requires linkonce semantics itself, and most
of the function is defined in sections named .gnu.linkonce.*.  If that's
the case then this is really a g++ code generation error.

However, ld ought to be forgiving in this situation, so this error is
also a ld bug.  I fixed the ld bug on 2004-08-13 for CVS head, so you
might like to try compiling current CVS binutils.  You'll get a warning
instead of an error.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list