[I don't think it's off-topic at all] Linking speed for C++

Jakub Jelinek jakub@redhat.com
Wed May 9 14:26:00 GMT 2001


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



More information about the Gcc mailing list