[PATCH] D23352: [ELF] - Linkerscript: implemented simple heuristic for placing orphan sections.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 05:00:25 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:303
@@ +302,3 @@
+
+  ScriptConfig->Commands.emplace(Cmd, new OutputSectionCommand(OutputName));
+  OutputSections->insert(Sec, OutSec);
----------------
ruiu wrote:
> I think the complexity comes from the very fact that you need to insert new commands into existing commands to keep two parallel arrays consistent. Parallel arrays are easy to create when you create one array from the other, but parallel arrays are not suitable for modification because you need to keep them consistent when you remove or add new elements. If you can do this without a parallel array, it would be easier to understand than this. (I'm not sure if it's doable, but I believe it's worth trying.)
Ok, that makes sense. What about updated variant ? (I had to use void* because output command is not template class, but change affects only one local method so I think that should not be a problem).


https://reviews.llvm.org/D23352





More information about the llvm-commits mailing list