From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Mark Klein Cc: gcc@gcc.gnu.org Subject: Re: MPE Port Date: Tue, 30 Nov 1999 23:37:00 -0000 Message-ID: <2799.942119599@upchuck> References: <4.2.0.58.19991108193122.00c7c220@garfield.dis.com> X-SW-Source: 1999-11n/msg00234.html Message-ID: <19991130233700.h5K2UdlHhnV-dzncRcjcFZTZfYGM1CZyH9PXPEUpjeU@z> In message < 4.2.0.58.19991108193122.00c7c220@garfield.dis.com >you write: > At 03:38 AM 9/13/99 -0600, Jeffrey A Law wrote: > > >collect is supposed to look at all the files on the link line for construc > tors > >and add them to th ctor/dtor list. > > Why does collect explicitly not add symbols from a shared library to the > constructor/destructor list? How would those constructors/destructors > ever get run on another platform if they were in a shared library or is > there another mechanism in that case? Because if someone replaced the library, then all the applications linked against the library would have to be re-linked just in case the list of ctors/dtors changed. So instead collect builds and exports a single constructor function for the entire library. *that* function should be added to he ctor/dtor list for the main program. That way the shared library can be updated and programs linked against the library do not need to be relinked if the library's initialization requirements changed. jeff