[PATCH] D94670: [DebugInfo][NFC] add a new DIE type to represent label + offset

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 07:36:39 PST 2021


hubert.reinterpretcast added a comment.

In D94670#2500677 <https://reviews.llvm.org/D94670#2500677>, @shchenz wrote:

> 2: On AIX, the assembler does not need the assembly file contains the dwarf sections length info in the dwarf section header(if the dwarf section has header.) Instead, the assembler will insert the calculated length into dwarf sections header of the final object according to DWARF type. Namely AIX assembler will insert 4 bytes in each section header for DWARF32 and 12 bytes for DWARF64.

Just to clarify this note: The assembler assumes 32-bit DWARF for XCOFF32 and 64-bit DWARF for XCOFF64.

In D94670#2500827 <https://reviews.llvm.org/D94670#2500827>, @shchenz wrote:

>> That is quite interesting, why they designed the feature to work that way. Is it recommended to reference debug sections through the label minus the length field size (4 or 12) or they provide some means to simplify the calculation?

As @shchenz notes, GCC on AIX (the versions that actually account for the offset) uses this direct adjustment method. For better looking assembly, there is the possibility of generating a post-length-field label and using `.set` to associate the name normally used with the adjusted expression. I don't know what the consequences of trying that would be in terms of the object-generating path in LLVM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94670



More information about the llvm-commits mailing list