Commit 25eeac05 authored by Rui Ueyama's avatar Rui Ueyama Committed by Johann
Browse files

Skip COMDAT sections when parsing COFF

Fixes https://code.google.com/p/chromium/issues/detail?id=339889
when building Clang-based ASan on Windows

Change-Id: Ib77d9593636f46827dbb77f087d407ec0f463fc7
Showing with 5 additions and 1 deletion
...@@ -666,7 +666,11 @@ int parse_coff(uint8_t *buf, size_t sz) { ...@@ -666,7 +666,11 @@ int parse_coff(uint8_t *buf, size_t sz) {
} }
strcpy(sectionlist[i], sectionname); 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; ptr += 40;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment