A glibc dynamic linker or gld bug?

Ian Lance Taylor ian@zembu.com
Wed Jul 7 07:36:00 GMT 1999


   Date: Tue, 6 Jul 1999 21:45:02 -0700 (PDT)
   From: hjl@lucon.org (H.J. Lu)

   > If we do not, then we will fail to implement the model correctly.
   > Consider the case in which a main executable defines a symbol weakly,
   > and a shared library does not define it at all.  At present we will
   > not generate any dynamic relocations for the weak defined symbol.
   > 
   > However, if we later replace the shared library with one which does
   > have a strong definition for the symbol, then correct operation would
   > appear to require that that strong symbol override the weak symbol in
   > the main executable.
   > 
   > As far as I can see, this can only happen if all relocations involving
   > the weak defined symbol are copied into the executable as dynamic
   > relocations.

   What if the definition in executable is strong? Do you have the same
   problem? I don't think we should worry about this.

No, we don't have the same problem if the definition in the executable
is strong, because in that case the shared library will never override
the definition.  The only time a shared library can override a
definition is if it is weak in the executable.

Ian


More information about the Binutils mailing list