[PATCH] D39094: [ELF] - Cleanup of processSectionCommands().

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 21:24:26 PDT 2017


ruiu added a comment.

Your change to ELF/LinkerScript.cpp looks good, but the other change needs improving.



================
Comment at: ELF/OutputSections.cpp:119-120
   }
+  if (Noload)
+    Type = SHT_NOBITS;
 
----------------
This function is `addSection`, which is supposed to add a section to an output section, right? Adding this piece of code which is not related to adding sections to this function is not a good idea. This is how this function organically grown (and I took quite a long time to clean it up), so when you add code to some function, please stop and think if what you are about to do is semantically correct.


https://reviews.llvm.org/D39094





More information about the llvm-commits mailing list