[PATCH] D106942: Consider section flags when adding section

Alfonso Sanchez-Beato via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 31 08:47:39 PDT 2021


alfonsosanchezbeato added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp:232
 
   for (const auto &Flag : Config.AddSection) {
     StringRef SecName, FileName;
----------------
jhenderson wrote:
> Rather than modify `flagsToCharacteristics`, could you just move this loop above the SetSectionFlags block above?
You need to change the characteristics before adding the section so addSection() takes them into account and can set VirtualSize, VirtualAddress, etc. Otherwise the flags would be set, but those parts of the section header would not get the right values.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106942/new/

https://reviews.llvm.org/D106942



More information about the llvm-commits mailing list