This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [I don't think it's off-topic at all] Linking speed for C++
- To: Joe Buck <jbuck at synopsys dot COM>
- Subject: Re: [I don't think it's off-topic at all] Linking speed for C++
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 9 May 2001 23:28:10 +0200
- Cc: Richard Henderson <rth at redhat dot com>, Andreas Jaeger <aj at suse dot de>, biswapesh dot chattopadhyay at bt dot com, gcc at gcc dot gnu dot org, bastian at suse dot com
- References: <20010509114515.A26607@redhat.com> <200105092053.NAA20501@toledo.synopsys.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Wed, May 09, 2001 at 01:53:01PM -0700, Joe Buck wrote:
> It seems that this should be fixable by making the linker smarter. After
> all, for the case of an offset to the same dso, what we have is a
> constant. What will this required dynamic relocation do? There is
> nothing to relocate, nothing to compute! When we do gcc -shared, we wind
> up with an .so that has some relocation expressions in which the
> relocations cancel. Why can't they be constant-folded, so when this .so
> is linked to at runtime, no relocation is left?
They are cancelled if you ask the linker to do it (e.g. through symbol
versioning and making some symbols local). If you don't ask for it this way,
the linker cannot do it for you (because then it is e.g. possible to
override that symbol in some other DSO which will come earlier in the search
list).
Jakub