From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122539 invoked by alias); 22 May 2016 02:58:56 -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 122521 invoked by uid 89); 22 May 2016 02:58:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*F:D*net.au, H*MI:sk:830e7bc, H*i:sk:830e7bc, million X-HELO: mail108.syd.optusnet.com.au Received: from mail108.syd.optusnet.com.au (HELO mail108.syd.optusnet.com.au) (211.29.132.59) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 May 2016 02:58:54 +0000 Received: from dimstar.local.net (c122-107-168-99.eburwd5.vic.optusnet.com.au [122.107.168.99]) by mail108.syd.optusnet.com.au (Postfix) with ESMTP id 6A31C1A2DAC for ; Sun, 22 May 2016 12:58:51 +1000 (AEST) Received: (qmail 19956 invoked by uid 501); 22 May 2016 02:58:43 -0000 Date: Sun, 22 May 2016 02:58:00 -0000 From: Duncan Roe To: cygwin@cygwin.com Subject: Re: Help debugging a dll issue Message-ID: <20160522025843.GE12938@dimstar.local.net> Mail-Followup-To: cygwin@cygwin.com References: <830e7bcd-aeb5-264e-6436-799dfa54d7a0@cs.umass.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <830e7bcd-aeb5-264e-6436-799dfa54d7a0@cs.umass.edu> User-Agent: Mutt/1.5.22 (2013-10-16) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=+cDhJlqnNvz9E7c5l3ERGg==:117 a=+cDhJlqnNvz9E7c5l3ERGg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=yrkiwgmsf1kA:10 a=_6JL7FwXeeaUyMb0V0YA:9 a=WXOtfqTzyCdGaJHq:21 a=ky0yfbSj1Dh07YzD:21 a=CjuIK1q_8ugA:10 X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00247.txt.bz2 On Sat, May 21, 2016 at 07:30:37PM -0400, Eliot Moss wrote: > On 5/19/2016 10:54 PM, Eliot Moss wrote: > >Dear Cygwin friends -- > > > >I am trying to get pypy to build under cygwin. (It used to do so, but > >has not been maintained.) I am very close, but there is something quite > >odd happening when trying to access the large dll that the system builds: > >the first call into that dll goes wild and causes a segfault. The issue > >seems to lie with run-time linking, for I can use dlopen to open the dll > >and then dlsym to look up the function, and I get the same bad address. > >I see nothing wrong from nm and objdump. The dll is about 70 million > >bytes long, so I can't really post it, but if you want to have a crack > >at this, we can find some mutually agreeable place and I can tell you > >the entry point I am trying to access. > > > >I have found that if I patch the indirection in the associated .exe file > >to refer to the actual address of the function, then the program runs, > >so it's just this one linkage that is not working (apparently). Very > >mysterious to me. > > I used binary search, eliminating .o files from the .dll on the thought > that it was either a particular .o file that was leading to a problem, > or possibly the overall size (this is a huge link!). I found that a .dll > with 58725 section 1 symbols (as reported by objdump -t) works, and one > with 66675 section one symbols fails. So it appears to be a size issue. > > Is anyone out there skilled enough with gnu ld to guide me as to how to > keep that section from getting too big? I tried --split-by-reloc, but > that gave no improvement (I don't think it's relocations that are the > problem, just the overall size of a section). I'll try --split-by-file, > but I am doubting that is the right thing either. > > In fact, it is looking that the solution may be to get pypy to build > its .dll with fewer symbols in the symbol table, perhaps by suitable > use of __declspec(dllexport) and __declspec(dllimport), etc. (These > are apparently deprecated in favor of __attribute__((visibility("hidden"))), > etc., but a number of those generate warnings that the visbility > attributes are not supported in this configuration!) > > Any thoughts from the populace? > > Regards -- EM > You surely tried this already: strip --strip-unneeded or --strip-debug? Cheers ... Duncan. -- 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