zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 10b10177025790ffa84304f282e8323ea2b10c37 (tree)
parent 5593c63e12a8d85052f548218b2957dea314be18
Author: emekoi <emekankurumeh@outlook.com>
Date:   Sat, 27 Jul 2019 17:50:44 -0500

fixed backtraces when linking libc on mingw

Diffstat:
Mstd/coff.zig | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/std/coff.zig b/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.