This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH for ld on cygwin: avoid core dump when linked-to DLL has no exports
- From: Eric Hanchrow <offby1 at blarg dot net>
- To: binutils at sourceware dot org
- Date: 10 May 2003 09:24:50 -0700
- Subject: Re: PATCH for ld on cygwin: avoid core dump when linked-to DLL has no exports
- References: <87wuhbzutt.fsf@blarg.net> <20030510161349.GA2575@redhat.com>
Christopher Faylor writes:
I was going to apply this patch but I noticed that there is already provision
in the code for DLLs without exports:
/* Get pe_header, optional header and numbers of export entries. */
pe_header_offset = pe_get32 (dll, 0x3c);
opthdr_ofs = pe_header_offset + 4 + 20;
num_entries = pe_get32 (dll, opthdr_ofs + 92);
if (num_entries < 1) /* No exports. */
return FALSE;
I never noticed that.
Do you know why this isn't sufficient?
No.
Is there something special about your DLL?
I wouldn't be surprised, but I don't know (I'm afraid I'm almost
entirely ignorant of this sort of thing; I'm not 100% sure what a DLL
even *is*).
Here's what I remember: I created it with Visual Studio, and it lacked
exports only by accident, not by intent. (Kind of silly to make a DLL
with no exports). The specific accident was: I forgot to create a
.def file, and thus Visual Studio didn't generate any exports.
If it's useful, I could probably reproduce the problem and send you a
recipe for creating the bogus DLL, or I could just send the DLL
itself.
--
Yahoo uses Javascript in a few places, though not many. I once asked
someone there how this worked out, and he said "they ended up learning
a lot about different browser versions."
--Paul Graham (http://www.paulgraham.com/road.html)
Seen on http://www.ccs.neu.edu/home/matthias/