public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: cygwin@cygwin.com
Subject: Re: Help debugging a dll issue
Date: Sun, 22 May 2016 02:53:00 -0000	[thread overview]
Message-ID: <d704ffd1-f76c-1a75-e487-d6f15bbe6ece@cs.umass.edu> (raw)
In-Reply-To: <nhr30c$qm5$1@ger.gmane.org>

On 5/21/2016 9:45 PM, René Berber wrote:
> On 5/21/2016 6:30 PM, Eliot Moss wrote:
>
> [snip]
>> 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.
>
> That's telling, since USHRT_MAX (65535) may be the limit, then somewhere
> there is the use of a variable of that type (unsigned short int,
> uint16_t), which may be part of some specification (i.e. the format of
> libraries).
>
> Supporting that is: https://ghc.haskell.org/trac/ghc/ticket/5292 which
> mentions:
>
> "65536 symbols. This is the limit that Windows DLLs can handle (the
> source of the limitation is that they use 16-bit integers to represent
> "ordinals")"
>
> and also point to an interesting bug report (5 years old):
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=12969
>
> No answers, but at least an explanation.

Why the maintainers did not fix this, I don't know -- would have saved
me a week of effort tacking things down!

The solution was to use __declspec(dllexport), sparingly, so that only
a few symbols would be exported, and to drop --export-all-symbols. (How
did that work before?  Was the system a lot smaller?)  Supposedly
__attribute__((dllexport)) also works, though I did not try it -- using
__declspec was more in line with code for Windows native C compilers.

At least this thread may help someone in the future!

Regards -- Eliot

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

  reply	other threads:[~2016-05-22  2:53 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
2016-05-22  1:46   ` René Berber
2016-05-22  2:53     ` Eliot Moss [this message]
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=d704ffd1-f76c-1a75-e487-d6f15bbe6ece@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).