Merge "Skip COMDAT sections when parsing COFF"

This commit is contained in:
Johann 2014-02-12 09:41:30 -08:00 committed by Gerrit Code Review
commit 279dbb9a30

View File

@ -666,7 +666,11 @@ int parse_coff(uint8_t *buf, size_t sz) {
}
strcpy(sectionlist[i], sectionname);
if (!strcmp(sectionname, ".rdata")) sectionrawdata_ptr = get_le32(ptr + 20);
// check if it's .rdata and is not a COMDAT section.
if (!strcmp(sectionname, ".rdata") &&
(get_le32(ptr + 36) & 0x1000) == 0) {
sectionrawdata_ptr = get_le32(ptr + 20);
}
ptr += 40;
}