summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/make/obj_int_extract.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/build/make/obj_int_extract.c b/build/make/obj_int_extract.c
index 8c169577c..819ce9d58 100644
--- a/build/make/obj_int_extract.c
+++ b/build/make/obj_int_extract.c
@@ -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;
}