[PATCH] D60042: [llvm-objcopy] Add --prefix-alloc-sections

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 06:14:34 PDT 2019


jhenderson added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp:583
 
-  if (!Config.SectionsToRename.empty()) {
-    for (auto &Sec : Obj.sections()) {
----------------
You should probably keep this if, but expand it to be:
`if (!Config.SectionsToRename.empty() || !Config.AllocSectionsPrefix.empty())`

That will mean that this loop only happens if one or both of the options is specified.


================
Comment at: llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp:593
+    // Add a prefix to allocated sections and their relocation sections. This
+    // should be done after renaming the section by config.SectionToRename to
+    // imitate the GNU objcopy behavior.
----------------
Nit config -> Config to match the variable name.


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

https://reviews.llvm.org/D60042





More information about the llvm-commits mailing list