This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: MPE Port
- To: Mark Klein <mklein at dis dot com>
- Subject: Re: MPE Port
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 08 Nov 1999 20:53:19 -0700
- cc: gcc at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
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