This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]