[PATCH] D45260: COFF: Layout sections in the same order as link.exe
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 4 10:54:52 PDT 2018
pcc added inline comments.
================
Comment at: COFF/Writer.cpp:670
+ // Put the sections in an order that matches what link.exe does. In
+ // particular, .rsrc must come after .text, otherwise the entry point could
+ // end up referring to garbage after .rsrc is updated with UpdateResource and
----------------
pcc wrote:
> What if I have a `.rsrc` section as well as a section whose name does not appear in the list above? It seems like this could still lay out `.rsrc` before my section, which would break things.
>
> To me it seems like the correct fix would be to just move `.rsrc` to the end.
That is what D45273 does.
https://reviews.llvm.org/D45260
More information about the llvm-commits
mailing list