[llvm-dev] yaml2obj support for COFF debug directories

Rui Ueyama via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 3 22:29:11 PST 2020

Hi Penzin,

>From the practical standpoint, I think this is a matter of investment and
reward. If we are going to use the feature only for writing a test for lld,
I guess it might not be worth it, and we can live with binary test file
though it's not ideal.

My feeling is that we eventually have to implement the feature, as
Microsoft seem to add a new bit to DLLCharacteristics every few years and
thus we'll see more bits defined for ExtendedDLLCharacteristics in the
future, but for now, I don't see an immediate need to implement it as
there's only one bit defined for ExtendedDLLCharacteristics.

On Wed, Mar 4, 2020 at 12:10 PM Penzin, Petr <petr.penzin at intel.com> wrote:

> *Spoiler:* the following only applies to Windows binary format handling.
> Potential for extending yaml2obj to support COFF debug directories
> <https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-directory-image-only>
> recently came up during a code review
> <https://reviews.llvm.org/D70606#1873185>. Currently, its COFF syntax
> <http://llvm.org/docs/yaml2obj.html#coff-syntax> allows for specifying
> section data, but not debug directories, that's why llvm-readobj tests
> which depend on debug directory contents use pre-built executable images
> instead of yaml2obj.
> It is possible to extend the tool, but first I would be interested in
> gathering feedback on usability of this, especially on potential uses of
> this change. It looks like porting llvm-readobj tests for codeview would
> depend on this and also D70606 <https://reviews.llvm.org/D70606> is
> introducing another possible use. But I am not sure how trivial would the
> codeview effort, would it be worth it or is it easier to leave things as
> they are for now?
> In case this is interesting, base Yaml syntax for COFF debug directory may
> look like this (enum values representing COFF Debug Types
> <https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-type>
> ):
> DebugDirectory:
>   - Type: [ {type: str, enum: [...]}, {type: int} ]
>   - DebugDirectoryData: {type: str}
> This may have to be further specialized for sub-categories, specifically
> codeview.
> Best,
> Petr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200304/2fced00a/attachment.html>

More information about the llvm-dev mailing list