[PATCH] D30080: MC/COFF: Do not emit forward associative section referenceds.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 22:52:11 PST 2017


Ah, I just double checked LLVM's implementation and we actually prohibit
it: http://llvm.org/docs/Extensions.html#section-directive

"It cannot be another associative COMDAT section."
This patch LGTM.

On Thu, Feb 16, 2017 at 9:57 PM, Rui Ueyama <ruiu at google.com> wrote:

> Okay. I'll try that tomorrow.
>
> On Thu, Feb 16, 2017 at 9:52 PM, David Majnemer <david.majnemer at gmail.com>
> wrote:
>
>> No, COMDATs cannot be associated in that way. They should always form a
>> DAG.
>>
>>
>> On Thu, Feb 16, 2017 at 9:47 PM, Rui Ueyama <ruiu at google.com> wrote:
>>
>>> That is probably not hard indeed, but you can create cycles if you use
>>> LLVM IR, can't you?
>>>
>>> On Thu, Feb 16, 2017 at 9:33 PM, David Majnemer <
>>> david.majnemer at gmail.com> wrote:
>>>
>>>> I believe its possible via LLVM IR, I don't think it'd be too hard to
>>>> make it work.
>>>>
>>>>
>>>> On Thu, Feb 16, 2017 at 6:53 PM, Rui Ueyama <ruiu at google.com> wrote:
>>>>
>>>>> On Thu, Feb 16, 2017 at 6:49 PM, David Majnemer <
>>>>> david.majnemer at gmail.com> wrote:
>>>>>
>>>>>> Does MSCOFF permit chains of associated sections? I can't remember if
>>>>>> they do.
>>>>>>
>>>>>
>>>>> IIRC that is not explicitly banned by the spec, but no one produces
>>>>> chained associated sections, and I can't imagine a valid of use it.
>>>>>
>>>>>
>>>>>> On Thu, Feb 16, 2017 at 6:35 PM Rui Ueyama via Phabricator via
>>>>>> llvm-commits <llvm-commits at lists.llvm.org> wrote:
>>>>>>
>>>>>>> ruiu created this revision.
>>>>>>>
>>>>>>> MSVC link.exe cannot handle associative sections that refer later
>>>>>>> sections in the section header. Technically, such COFF object doesn't
>>>>>>> violate the Microsoft COFF spec, as the spec doesn't say anything
>>>>>>> about that, but still we should avoid doing that to make it
>>>>>>> compatible
>>>>>>> with MS tools.
>>>>>>>
>>>>>>> This patch assigns smaller section numbers to non-associative
>>>>>>> sections
>>>>>>> and larger numbers to associative sections. This should resolve the
>>>>>>> compatibility issue.
>>>>>>>
>>>>>>>
>>>>>>> https://reviews.llvm.org/D30080
>>>>>>>
>>>>>>> Files:
>>>>>>>   llvm/lib/MC/WinCOFFObjectWriter.cpp
>>>>>>>   llvm/test/DebugInfo/COFF/globals.ll
>>>>>>>   llvm/test/DebugInfo/COFF/types-data-members.ll
>>>>>>>   llvm/test/MC/COFF/section-comdat.s
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> llvm-commits mailing list
>>>>>>> llvm-commits at lists.llvm.org
>>>>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170216/1e8a6b91/attachment.html>


More information about the llvm-commits mailing list