authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-07-27 17:50:44-05:00
committergravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-07-27 17:50:44-05:00
log10b10177025790ffa84304f282e8323ea2b10c37
tree679ef34ce26d6d5915d1468a51af29700eca0ce9
parent5593c63e12a8d85052f548218b2957dea314be18

fixed backtraces when linking libc on mingw


1 files changed, 9 insertions(+), 1 deletions(-)

std/coff.zig+9-1
......@@ -120,7 +120,15 @@ pub const Coff = struct {
120120
121121 pub fn getPdbPath(self: *Coff, buffer: []u8) !usize {
122122 try self.loadSections();
123 const header = (self.getSection(".rdata") orelse return error.MissingCoffSection).header;
123 const header = blk: {
124 if (self.getSection(".buildid")) |section| {
125 break :blk section.header;
126 } else if (self.getSection(".rdata")) |section| {
127 break :blk section.header;
128 } else {
129 return error.MissingCoffSection;
130 }
131 };
124132
125133 // The linker puts a chunk that contains the .pdb path right after the
126134 // debug_directory.