+2009-11-27 Tristan Gingold <gingold@adacore.com>
+
+ * pe-dll.c (pe_implied_import_dll): Return early if there is no
+ export entries.
+
2009-11-26 Nick Clifton <nickc@redhat.com>
PR ld/10956
return FALSE;
}
- /* Get pe_header, optional header and numbers of export entries. */
+ /* Get pe_header, optional header and numbers of directory entries. */
pe_header_offset = pe_get32 (dll, 0x3c);
opthdr_ofs = pe_header_offset + 4 + 20;
#ifdef pe_use_x86_64
num_entries = pe_get32 (dll, opthdr_ofs + 92);
#endif
- if (num_entries < 1) /* No exports. */
+ /* No import or export directory entry. */
+ if (num_entries < 1)
return FALSE;
#ifdef pe_use_x86_64
export_size = pe_get32 (dll, opthdr_ofs + 100);
#endif
+ /* No export table - nothing to export. */
+ if (export_size == 0)
+ return FALSE;
+
nsections = pe_get16 (dll, pe_header_offset + 4 + 2);
secptr = (pe_header_offset + 4 + 20 +
pe_get16 (dll, pe_header_offset + 4 + 16));