[PATCH] D40407: [COFF] Implement constructor priorities

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 26 14:13:14 PST 2017


mstorsjo updated this revision to Diff 124312.
mstorsjo edited the summary of this revision.
mstorsjo added a comment.
Herald added a subscriber: dschuff.

I noticed that the `.ctors.1234` numerical suffixes are zero padded by GCC when targeting MinGW, updated this patch accordingly and expanded the test to showcase it.

It doesn't seem like any other modern platform actually defaults to using `.ctors` at all, so I'm not sure if other platforms should have zero padding or not. If linking an object file that contains unpadded `.ctors` with GNU ld, they are interpreted numerically (and end up in `.init_array`). If linking for MinGW with GNU ld though, the zero padding is needed for them to be ordered properly.


https://reviews.llvm.org/D40407

Files:
  lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  test/CodeGen/X86/constructor.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40407.124312.patch
Type: text/x-patch
Size: 5057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171126/267a062e/attachment.bin>


More information about the llvm-commits mailing list