<div dir="ltr">Hi Penzin,<div><br></div><div>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.</div><div><br></div><div>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.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 4, 2020 at 12:10 PM Penzin, Petr <<a href="mailto:petr.penzin@intel.com">petr.penzin@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-774452126831021547WordSection1">
<p class="gmail-m_-774452126831021547FirstParagraph"><i>Spoiler:</i> the following only applies to Windows binary format handling.<u></u><u></u></p>
<p class="gmail-m_-774452126831021547MsoBodyText">Potential for extending <span class="gmail-m_-774452126831021547VerbatimChar">yaml2obj</span> to support COFF
<a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-directory-image-only" target="_blank">
debug directories</a> recently came up during <a href="https://reviews.llvm.org/D70606#1873185" target="_blank">
a code review</a>. Currently, its <a href="http://llvm.org/docs/yaml2obj.html#coff-syntax" target="_blank">
COFF syntax</a> allows for specifying section data, but not debug directories, that's why
<span class="gmail-m_-774452126831021547VerbatimChar">llvm-readobj</span> tests which depend on debug directory contents use pre-built executable images instead of
<span class="gmail-m_-774452126831021547VerbatimChar">yaml2obj</span>.<u></u><u></u></p>
<p class="gmail-m_-774452126831021547MsoBodyText">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
<span class="gmail-m_-774452126831021547VerbatimChar">llvm-readobj</span> tests for codeview would depend on this and also
<a href="https://reviews.llvm.org/D70606" target="_blank">D70606</a> 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?<u></u><u></u></p>
<p class="gmail-m_-774452126831021547MsoBodyText">In case this is interesting, base Yaml syntax for COFF debug directory may look like this (enum values representing
<a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#debug-type" target="_blank">
COFF Debug Types</a>):<u></u><u></u></p>
<p class="gmail-m_-774452126831021547SourceCode"><span class="gmail-m_-774452126831021547VerbatimChar">DebugDirectory:</span><br>
<span class="gmail-m_-774452126831021547VerbatimChar"> - Type: [ {type: str, enum: [...]}, {type: int} ]</span><br>
<span class="gmail-m_-774452126831021547VerbatimChar"> - DebugDirectoryData: {type: str}</span><u></u><u></u></p>
<p class="gmail-m_-774452126831021547FirstParagraph">This may have to be further specialized for sub-categories, specifically codeview.<u></u><u></u></p>
<p class="gmail-m_-774452126831021547MsoBodyText"><u></u> <u></u></p>
<p class="gmail-m_-774452126831021547MsoBodyText">Best,<u></u><u></u></p>
<p class="gmail-m_-774452126831021547MsoBodyText">Petr<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</blockquote></div>