Question about ELF linker semantics

Ian Lance Taylor ian@zembu.com
Thu Jul 1 00:00:00 GMT 1999


   From: mark@codesourcery.com
   Date: Tue, 15 Jun 1999 13:55:59 -0700

   That makes sense to me.  But, I think this is the *opposite*
   situation.  Here, the "canonical" name is _environ; that's the
   non-weak symbol.  The main executable is using _environ.  IRIX ld
   emits a symbol-table entry for _environ.  We emit entries for both
   _environ and the (weak) environ.  I can't see why we're referencing
   the weak symbol at all; nobody has mentioned it.  Or am I still
   missing the point?

Oh yeah.

I think that bit in elflink.h may be there because if we are building
a shared library, we need to make sure that both the weak symbol and
the regular symbol are in the symbol table if the regular symbol is.

If I'm right, it's not needed when generating an executable.

That code hasn't changed in a long time, though.  It would be
interesting to see what Solaris does.

Ian


More information about the Binutils mailing list