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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 21:47:18 PST 2017


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/3a918525/attachment.html>


More information about the llvm-commits mailing list