Re: Patch for premain() function

Danny Smith <[email protected]>
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <000601c26ccc$9ddc1690$b290a7cb@DANNY>
----- Original Message -----
From: "Ralf Habacker" <[email protected]>
To: <[email protected]>
Sent: Saturday, 5 October 2002 21:00
Subject: RE: [MinGW-patches] Patch for premain() function


> > On Sat, Oct 05, 2002 at 05:14:36PM +0200, Ralf Habacker wrote:
> > >this patches implements a user callable function before main() for
> > >general initialisation purpose without needs for patching the mingw
> > >runtime on user level.
> >
> > Why not just use the __attribute__((constructor)) for your function?
>
> Can you make sure, that a specific constructor is been called first
regardless
> of the position in the list of the used objectfiles ?
>
> As I know one of the possible link lines looks like this :
>
> gcc options ... <objectfiles> ... options ... <libraries> ... options
and so
> one
>
> So if a constructor in <library> must be called at first and there are
ones in
> <objectfiles>, it seems there is no change or are I'm wrong ?

Normally, you would put global constructors in an object file rather
than a library to force it into the app.  Then you could control which
object  came last.

Can you expand on the type of functionality  you would call before
invoking global ctors?

Danny





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.