From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14925 invoked by alias); 21 Sep 2017 00:11:41 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 14272 invoked by uid 89); 21 Sep 2017 00:11:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=arrangements, Gary, gary, HX-PHP-Originating-Script:501 X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.139) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Sep 2017 00:11:35 +0000 Received: from kylheku.com ([70.79.163.252]) by shaw.ca with SMTP id up5YdAL7b8LPZup5ZdE61P; Wed, 20 Sep 2017 18:11:34 -0600 X-Authority-Analysis: v=2.2 cv=e552ceh/ c=1 sm=1 tr=0 a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17 a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=2JCJgTwv5E4A:10 a=w_pzkKWiAAAA:8 a=0ppCBi_oY1C-HinEWWoA:9 a=QEXdDO2ut3YA:10 a=sRI3_1zDfAgwuvI8zelB:22 Received: from www-data by kylheku.com with local (Exim 4.72) (envelope-from <920-082-4242@kylheku.com>) id 1dup5Y-0003mO-M2 for cygwin@cygwin.com; Wed, 20 Sep 2017 17:11:32 -0700 To: cygwin@cygwin.com Subject: Re: Problem with differences with DLOPEN / DLSYM compared to ubuntu (16.04) / debian (stretch). X-PHP-Originating-Script: 501:rcmail.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 21 Sep 2017 00:11:00 -0000 From: Kaz Kylheku <920-082-4242@kylheku.com> In-Reply-To: References: Message-ID: <41e4f6fcc85c65d2abe540f1ee975a0e@mail.kylheku.com> X-Sender: 920-082-4242@kylheku.com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4wfEGIaJZQirUxi2Dj/QNwV9R+ZwBiWsC0MQHAjz87C4nHhycb00MGQwxj1N1GyEkRgWR1z3OEoG8R1PGwkql+a3QGgyMBXvRlXAAiAHe2kFsnHHFXbqG4 iON0NNim2v6RHeG2RvviBLqB8JIugzoHWNTUI+eTYf1MPrubSYD15Xez X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00196.txt.bz2 On 15.09.2017 06:51, Gary Schneir wrote: > Thanks for the response but I am a little confused by it.  If Cygwin is > supposed to provide POSIX API functionality and DLOPEN / DLSYM are > supported in CYGWIN, then I shouldn't care about the underlying > complexity or restrictions of running within the Windows environment > and > using DLLs.  The behavior should be the same as in other POSIX > environments. I don't see this behavior on Linux. This is a transcript from an Ubuntu 16.04 system: $ txr This is the TXR Lisp interactive listener of TXR 186. Quit with :quit or Ctrl-D on empty line. Ctrl-X ? for cheatsheet. 1> (dlopen nil) # 2> (dlsym *1 "cons") # 3> (dlsym *1 "car") # 4> (dlsym *1 "cdr") # 5> (dlsym *1 "malloc") # 6> (dlsym *1 "printf") # The external functions cons, car and cdr in the txr executable (I assure everyone they are there) cannot be found by dlsym, but malloc and printf in the linked C library are found. I.e. the same issue you're having on Cygwin. Cygwin aims for Linux compatibility more than POSIX. The motto is "get that Linux feeling on Windows", after all. It's splashed right below the Cygwin banner here: https://cygwin.com/ Not finding the executable's own symbol with dlsym (unless some special arrangements are made to dynamically export the symbols) looks very much like a "Linux feeling"! If we run "nm -D" on the executable to see what dynamic symbols are provided, we find only "_init" and "_fini": $ nm -D /usr/local/bin/txr | grep T 080fa3cc T _fini 0804a7a4 T _init and, by golly, these *can* be found with dlsym on the dlopen(NULL, ...) handle! 7> (dlsym *1 "_fini") # 8> (dlsym *1 "_init") # -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple