diff options
author | Tristan Gingold <gingold@adacore.com> | 2009-11-27 09:00:36 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2009-11-27 09:00:36 +0000 |
commit | d0069cab2dbefd94d89664546bcaa4125ac6c12c (patch) | |
tree | 94b658da3b93c64b9a7dfbdc71dbe58d5656d29d | |
parent | 3b0dd6acb34c76c4ad983ebeb48e7bf56aeeb141 (diff) | |
download | gdb-d0069cab2dbefd94d89664546bcaa4125ac6c12c.zip gdb-d0069cab2dbefd94d89664546bcaa4125ac6c12c.tar.gz gdb-d0069cab2dbefd94d89664546bcaa4125ac6c12c.tar.bz2 |
2009-11-27 Tristan Gingold <gingold@adacore.com>
* pe-dll.c (pe_implied_import_dll): Return early if there is no
export entries.
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/pe-dll.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 904262f..3a0aa49 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/ld/pe-dll.c b/ld/pe-dll.c index beeb580..fb94813 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -2981,7 +2981,7 @@ pe_implied_import_dll (const char *filename) 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 @@ -2990,7 +2990,8 @@ pe_implied_import_dll (const char *filename) 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 @@ -3001,6 +3002,10 @@ pe_implied_import_dll (const char *filename) 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)); |