]> granicus.if.org Git - libvpx/commitdiff
Skip COMDAT sections when parsing COFF
authorRui Ueyama <ruiu@google.com>
Tue, 4 Feb 2014 15:56:52 +0000 (07:56 -0800)
committerJohann <johannkoenig@google.com>
Tue, 4 Feb 2014 15:56:52 +0000 (07:56 -0800)
Fixes https://code.google.com/p/chromium/issues/detail?id=339889
when building Clang-based ASan on Windows

Change-Id: Ib77d9593636f46827dbb77f087d407ec0f463fc7

build/make/obj_int_extract.c

index 8c169577cfac0b180c1af93e9f29397665275e76..819ce9d587b0e7e73af5c95b5d73a67742ec2981 100644 (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;
   }