Skip to content

Commit 311ff22

Browse files
author
Kai Luo
committed
[DwarfGenerator] Emit dwarf address section when dwarf version is not less than 4
Some targets (like AIX) might not feature dwarf address section due to low dwarf version. Check before emitting one. Fixed DebugInfo unit test failures in https://lab.llvm.org/buildbot/#/builders/214/builds/5739. Reviewed By: qiucf Differential Revision: https://reviews.llvm.org/D143561
1 parent 2c9783c commit 311ff22

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ StringRef dwarfgen::Generator::generate() {
582582
StringPool->emit(*Asm, TLOF->getDwarfStrSection(),
583583
TLOF->getDwarfStrOffSection());
584584

585-
AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym);
585+
if (Asm->getDwarfVersion() >= 5)
586+
AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym);
586587

587588
MS->switchSection(TLOF->getDwarfInfoSection());
588589
for (auto &CU : CompileUnits) {

0 commit comments

Comments
 (0)