This is the mail archive of the
mailing list for the Cygwin project.
Re: Help debugging a dll issue
- From: Eliot Moss <moss at cs dot umass dot edu>
- To: cygwin at cygwin dot com
- Date: Sat, 21 May 2016 22:52:42 -0400
- Subject: Re: Help debugging a dll issue
- Authentication-results: sourceware.org; auth=none
- References: <b21c0ab1-341b-d6f5-915b-f73973b8079b at cs dot umass dot edu> <830e7bcd-aeb5-264e-6436-799dfa54d7a0 at cs dot umass dot edu> <nhr30c$qm5$1 at ger dot gmane dot org>
- Reply-to: moss at cs dot umass dot edu
On 5/21/2016 9:45 PM, RenÃ Berber wrote:
On 5/21/2016 6:30 PM, Eliot Moss wrote:
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
Supporting that is: https://ghc.haskell.org/trac/ghc/ticket/5292 which
"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
and also point to an interesting bug report (5 years old):
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple