From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Klein To: law@cygnus.com Cc: gcc@gcc.gnu.org Subject: Re: MPE Port Date: Wed, 08 Sep 1999 20:04:00 -0000 Message-id: <4.1.19990908195434.00b01950@garfield.dis.com> References: <4.1.19990907063758.00c27730@garfield.dis.com> <27651.936776544@upchuck.cygnus.com> X-SW-Source: 1999-09/msg00325.html At 01:42 AM 9/8/99 -0600, Jeffrey A Law wrote: >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. I've rewritten the trap initialization as __attribute__ ((constructor)). I still run into the same issue (which is substantially the same as what faces the __gcc_plt_call) ... if it isn't referenced from the program, it won't get bound in for collect to find it. While I chose to do it in DO_GLOBAL_CTORS_BODY, I could do the same asm stuff in either DO_GLOBAL_CTORS_BODY or DO_GLOBAL_DTORS_BODY as is done for _gcc_plt_call. I'm going to choose the latter, because I am already redefining it to delete the __gcc_plt_call reference. Is that acceptable? Because of MPE's late binding, I don't see another way. Regards, M. -- Mark Klein DIS International, Ltd. http://www.dis.com 415-892-8400 PGP Public Key Available From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Klein To: law@cygnus.com Cc: gcc@gcc.gnu.org Subject: Re: MPE Port Date: Thu, 30 Sep 1999 18:02:00 -0000 Message-ID: <4.1.19990908195434.00b01950@garfield.dis.com> References: <4.1.19990907063758.00c27730@garfield.dis.com> <27651.936776544@upchuck.cygnus.com> X-SW-Source: 1999-09n/msg00325.html Message-ID: <19990930180200.I824ofd7WfqizHFRxLf3DW-I2ZgMiuwF03MATaTPSLk@z> At 01:42 AM 9/8/99 -0600, Jeffrey A Law wrote: >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. I've rewritten the trap initialization as __attribute__ ((constructor)). I still run into the same issue (which is substantially the same as what faces the __gcc_plt_call) ... if it isn't referenced from the program, it won't get bound in for collect to find it. While I chose to do it in DO_GLOBAL_CTORS_BODY, I could do the same asm stuff in either DO_GLOBAL_CTORS_BODY or DO_GLOBAL_DTORS_BODY as is done for _gcc_plt_call. I'm going to choose the latter, because I am already redefining it to delete the __gcc_plt_call reference. Is that acceptable? Because of MPE's late binding, I don't see another way. Regards, M. -- Mark Klein DIS International, Ltd. http://www.dis.com 415-892-8400 PGP Public Key Available