[PATCH] D67656: [llvm-objcopy] Add --set-section-alignment

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 19:56:18 PDT 2019


abrachet marked an inline comment as done.
abrachet added inline comments.


================
Comment at: tools/llvm-objcopy/ELF/ELFObjcopy.cpp:673
 
+  if (!Config.SetSectionAlignment.empty()) {
+    for (SectionBase &Sec : Obj.sections()) {
----------------
Is this idea behind not putting this and the SetSectionFlags loop that does the same thing in the same loop because they are unlikely to be used? Without looking very far I see 4 times including here that we go through every section.

Not that it makes sense for this patch but it might eventually be worth it to hash every section by name into a `StringMap` so we only iterate once over all sections and can handle `SetSectionAlignment`, `SetSectionFlags` and `SectionsToRename` more efficiently.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67656





More information about the llvm-commits mailing list