diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp --- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -582,7 +582,8 @@ StringPool->emit(*Asm, TLOF->getDwarfStrSection(), TLOF->getDwarfStrOffSection()); - AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym); + if (Asm->getDwarfVersion() >= 5) + AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym); MS->switchSection(TLOF->getDwarfInfoSection()); for (auto &CU : CompileUnits) {