From a6ccd1903517b9e1ce1709c144f6a758c325c5d9 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 11 Nov 2016 16:23:47 +0000 Subject: [PATCH] Fix code to deal with recent LLVM changes. https://reviews.llvm.org/D26526 llvm-svn: 286598 --- lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index cfa2ae1..4b17f7b 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -877,10 +877,13 @@ readCompUnit(const NormalizedFile &normalizedFile, // FIXME: Cribbed from llvm-dwp -- should share "lightweight CU DIE // inspection" code if possible. uint32_t offset = 0; + llvm::dwarf::DwarfFormat Format = llvm::dwarf::DwarfFormat::DWARF32; auto infoData = dataExtractorFromSection(normalizedFile, info); uint32_t length = infoData.getU32(&offset); - if (length == 0xffffffff) + if (length == 0xffffffff) { + Format = llvm::dwarf::DwarfFormat::DWARF64; infoData.getU64(&offset); + } else if (length > 0xffffff00) return llvm::make_error("Malformed DWARF in " + path); @@ -927,7 +930,7 @@ readCompUnit(const NormalizedFile &normalizedFile, } default: llvm::DWARFFormValue::skipValue(form, infoData, &offset, version, - addrSize); + addrSize, Format); } } return tu; -- 2.7.4