public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: cygwin <cygwin@cygwin.com>
Subject: Re: Help debugging a dll issue
Date: Sat, 21 May 2016 23:30:00 -0000	[thread overview]
Message-ID: <830e7bcd-aeb5-264e-6436-799dfa54d7a0@cs.umass.edu> (raw)
In-Reply-To: <b21c0ab1-341b-d6f5-915b-f73973b8079b@cs.umass.edu>

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

--
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

  parent reply	other threads:[~2016-05-21 23:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20  2:54 Eliot Moss
     [not found] ` <CABHT960Yx_bg-NaHWcxePEV+Xz74NaVtsu+NjkrSZs4-62rCOA@mail.gmail.com>
2016-05-20 10:38   ` Eliot Moss
2016-05-20 11:26     ` Duncan Roe
2016-05-20 12:02       ` Eliot Moss
2016-05-20 13:37         ` Duncan Roe
2016-05-20 13:46           ` Eliot Moss
2016-05-21 23:30 ` Eliot Moss [this message]
2016-05-22  1:46   ` René Berber
2016-05-22  2:53     ` Eliot Moss
2016-05-22  2:58   ` Duncan Roe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=830e7bcd-aeb5-264e-6436-799dfa54d7a0@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).