This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Feature request: undefined-symbol hints
- From: Paul Koning <pkoning at equallogic dot com>
- To: loewis at informatik dot hu-berlin dot de
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 12 Aug 2002 09:21:30 -0400
- Subject: Re: Feature request: undefined-symbol hints
- References: <200208100942.g7A9g2u3002138@paros.informatik.hu-berlin.de>
>>>>> "Martin" == Martin v Löwis <loewis@informatik.hu-berlin.de> writes:
Martin> In C++, the compiler emits a number of implicit symbols
Martin> (vtable, typeinfo). To avoid code duplication, these are only
Martin> defined together with some user-defined symbol (the first
Martin> virtual function in a class).
Martin> If the user fails to define that symbol, the implicit symbols
Martin> are not defined, either. Users are often confused by the
Martin> linker error messages in these cases.
Count me as one confused by those errors. They always went away after
"some tinkering" but I never realized what the magic word is.
It seems to me the solution is NOT to create hacks that produce new
warnings. You described the real problem in the first paragraph. The
compiler/linker should be able to deal with duplicate definitions of
these implicit symbols so the compiler can just emit them and the
linker will make it right. That way these internal things are not
tied to irrelevant details like the first user-defined virtual
function.
paul