[PATCH] D143561: [DebugInfo] Emit dwarf address section when dwarf version is not less than 4

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 18:43:50 PST 2023


lkail updated this revision to Diff 495999.
lkail retitled this revision from "[DebugInfo] Check if dwarf address section exists" to "[DebugInfo] Emit dwarf address section when dwarf version is not less than 4".
lkail edited the summary of this revision.
lkail added a comment.

Check dwarf version number per @benmxwl-arm 's suggestion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143561/new/

https://reviews.llvm.org/D143561

Files:
  llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp


Index: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
===================================================================
--- llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ 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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143561.495999.patch
Type: text/x-patch
Size: 637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230209/af1f7160/attachment.bin>


More information about the llvm-commits mailing list