From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7587 invoked from network); 31 Jul 2000 14:09:09 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Jul 2000 14:09:09 -0000 Received: (qmail 18418 invoked by alias); 31 Jul 2000 14:08:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12442 Received: (qmail 18411 invoked from network); 31 Jul 2000 14:08:56 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "Peter Stephenson" , "Zsh hackers list" Subject: RE: Dynamic loading on Cygwin - status Date: Mon, 31 Jul 2000 18:08:52 +0400 Message-ID: <000001bffaf8$daeb7280$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-reply-to: <0FYK005CYET0JA@la-la.cambridgesiliconradio.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 > > > > > - external function or variable imported from another module is not > > > considered > > > a constant on Cygwin (actually, on Windows). Hence, any static > initializer > > > fails, e.g > > > > That is really bad. > > Isn't it enough to mark it as __attribute__((dllimport)) in the importing ^^^^^^^^^^^^^^^^^^^^^^^^^^ > file (assuming the symbol's exported in the first place, obviously)? > Exactly THIS makes them non-static. But it is not bad as I thought. We do not need dllimport declaration for functions. We still do need them for variables. I'll try it as soon as I have time to see, if some external variable is used in static context. (It is clear. In case of variables, compiler actually generates code to call a function that returns address. Of course, you cannot call function to intialize static variable. In case of function what gets linked into program under function's name is a stub that calls "real" function under the name __imp__. Of course, we can always take an address of this stub - it is perfectly static). -andrej