This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH for ld on cygwin: avoid core dump when linked-to DLL has no exports


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]