RFC: linker enhancements

Alan Modra amodra@bigpond.net.au
Wed Mar 17 22:13:00 GMT 2004


On Wed, Mar 17, 2004 at 02:06:46PM -0800, H. J. Lu wrote:
> I don't see how it can happen. A definition in regular object will
> never be overridden by a dynamic definition. If it does happen, it
> is not intended. I'd like to fix it.

elflink.c:1036
     We prefer a non-weak definition in a shared library to a weak
     definition in the executable unless it comes from a DT_NEEDED
     entry of a shared object, in which case, the DT_NEEDED entry
     may not be required at the run time.  */

elflink.c:1197
  /* Handle the special case of a weak definition in a regular object
     followed by a non-weak definition in a shared object.  In this
     case, we prefer the definition in the shared object unless it
     comes from a DT_NEEDED entry of a shared object, in which case,
     the DT_NEEDED entry may not be required at the run time.  */

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list