This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld --wrap and c++
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: jbaker at qnx dot com
- Cc: binutils at sources dot redhat dot com
- Date: 26 Aug 2004 11:06:44 -0400
- Subject: Re: ld --wrap and c++
- References: <412DEE7D.9030503@qnx.com>
Jeff Baker <jbaker@qnx.com> writes:
> We have a customer complaining that the --wrap option to ld (again,
> 2.12.1) doesn't work with C++. Would I be correct in assuming that
> this is because of the C++ name mangling? If so, is there anything
> (other than extern "C") that they can do to make it work?
--wrap should work fine with C++. However, you do have to mangle the
names yourself, and use --wrap with the mangled name.
There is no real alternative. It is not practical for the linker to
incorporate a C++ mangler, particularly as different compilers, even
different versions of g++, use different mangling schemes.
Ian