[PATCH] D94668: [debug-info] [NFC] add isa support for MCStreamer

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 04:04:26 PST 2021


shchenz added a comment.

In D94668#2500530 <https://reviews.llvm.org/D94668#2500530>, @echristo wrote:

> I'm not quite sure I understand. What's the issue between xcoff and emission here? Does it not support subtraction? It's been a while and I can't recall.
>
> -eric

Hi Eric,
Thanks for your review. I made some background for this patch in https://reviews.llvm.org/D94670.

> 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.

So the issue is for assembly mode, we don't need the dwarf section length in the dwarf section header as assembler will insert this info. But for object mode, we still need the dwarf section length as other tool like linker will need this.

Currently the dwarf section length is emitted by base class `MCStreamer`, so I need to check if `MCStreamer` is `MCAsmStreamer` or not for XCOFF. If it is `MCAsmStreamer`, we don't emit length info; if it is `MCObjectStreamer`, we need to emit the length info.

XCOFF may also need to emit .debug_line info according to Streamer type. AIX assembler does not support `.loc`, `.file` directive, so we have to write another method to emit .debug_line content for `MCAsmStreamer`.

Do we have other ways for this kind of requirement?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94668



More information about the llvm-commits mailing list