This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem linking to wrong class
- From: Andrew Haley <aph at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Brian Peschel <brianp at occinc dot com>, "John (Eljay) Love-Jensen" <eljay at adobe dot com>, GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 21 Apr 2009 10:11:31 +0100
- Subject: Re: Problem linking to wrong class
- References: <C6123147.3A4AA%eljay@adobe.com> <49ECC9D4.5060204@occinc.com> <m3vdoyekec.fsf@google.com>
Ian Lance Taylor wrote:
> Brian Peschel <brianp@occinc.com> writes:
>
>>> One way around the issue is called Âearly bindingÂ. You could build
>>> libtwo.so such that it binds to its own symbols, rather than allowing the
>>> loader to resolve the unbound symbols with the ones provided by your
>>> executable.
>>>
>> Is there a way to force the compiler/linker to do this?
>
> Use the -Bsymbolic linker option.
Be very careful with this: in my experience it can lead to a whole
world of problems with data symbols and copy relocs.
Andrew.