[PATCH] D49366: Add support for /FUNCTIONPADMIN command-line option

Stefan Reinalter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 05:34:23 PDT 2018


stefan_reinalter added a comment.

In https://reviews.llvm.org/D49366#1163821, @pcc wrote:

> Unless I'm missing something, doesn't this patch end up adding padding to the end of every code section rather than the beginning?
>
> It seems like this ought to be implemented by changing the section layout code. I'm thinking that you would add code to http://llvm-cs.pcc.me.uk/tools/lld/COFF/Writer.cpp#742 that does this:
>
>   if (C requires padding) {
>     RawSize += Padding;
>     VirtualSize += Padding;
>   }
>
>
> With that I don't think you need to add fields for storing the amount of padding required, you can just figure it out on the fly there.


Fully agree. I like your suggestion because it's also less invasive.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D49366





More information about the llvm-commits mailing list