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: Thu, 30 Sep 1999 18:02:00 -0000 Message-ID: <27651.936776544@upchuck.cygnus.com> References: <4.1.19990907063758.00c27730@garfield.dis.com> X-SW-Source: 1999-09n/msg00266.html Message-ID: <19990930180200.p9yuuWS0NukLEa1PNe8Y8temq-T5FnJ10_Mr3ggDt4M@z> In message < 4.1.19990907063758.00c27730@garfield.dis.com >you write: > >This really doesn't seem like something that belongs in the compiler, but > >instead in some kind of OS library that the user optionally requests. > > Since GCC's startup is different than the HP compilers (which do similar > initializations prior to invoking main()), I'm not sure semantically how > to do it outside of the compiler/library. Suggestions? There's got to be a way to fire routines before main. For HP's I do *not* recommend using their SOM file initializer scheme, it is horribly busted. Instead use the collect method. It works by scanning your executable for symbols with magic names. It collects them together in a list and __main will arrange for each of the special functions to be called before your program gets started. It uses the same mechanism that global ctors/dtors for C++ uses. jeff