[PATCH] D73107: [llvm-objcopy][COFF] Add support for --set-section-flags

Sergey Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 08:37:34 PST 2020


sdmitriev added a comment.

In D73107#1836336 <https://reviews.llvm.org/D73107#1836336>, @jhenderson wrote:

> The new `exclude` flag is pretty ELF-centric as things stand. I don't know if there's an equivalent COFF section characteristic that really maps to it. If not, we should either a) reject it, or b) accept it and do nothing with it except perhaps clear the flags. I tentatively prefer b) for simplicity, but regardless it should at least be tested. What do others think?


I believe `exclude` flag which maps to `SHF_EXCLUDE` for ELF objects maps well to the COFF's `IMAGE_SCN_LNK_REMOVE` flag.

> Documentation should be updated so that --set-section-flags is no longer listed as ELF-specific.

I agree. If documentation says that --set-section-flags is ELF specific it should definitely be updated.



================
Comment at: llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp:220
+    for (Section &Sec : Obj.getMutableSections()) {
+      const auto It = Config.SetSectionFlags.find(Sec.Name);
+      if (It != Config.SetSectionFlags.end())
----------------
jhenderson wrote:
> Any particular reason you're making this `const`?
Nothing specific, but I do not see any reasons why it cannot be const especially if we do not plan to modify pointee . Do you see any reasons why it cannot have const qualifier?


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

https://reviews.llvm.org/D73107





More information about the llvm-commits mailing list