Commit 10b1017702

emekoi <emekankurumeh@outlook.com>
2019-07-28 00:50:44
fixed backtraces when linking libc on mingw
1 parent 5593c63
Changed files (1)
std/coff.zig
@@ -120,7 +120,15 @@ pub const Coff = struct {
 
     pub fn getPdbPath(self: *Coff, buffer: []u8) !usize {
         try self.loadSections();
-        const header = (self.getSection(".rdata") orelse return error.MissingCoffSection).header;
+        const header = blk: {
+            if (self.getSection(".buildid")) |section| {
+                break :blk section.header;
+            } else if (self.getSection(".rdata")) |section| {
+                break :blk section.header;
+            } else {
+                return error.MissingCoffSection;
+            }
+        };
 
         // The linker puts a chunk that contains the .pdb path right after the
         // debug_directory.