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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 13:12:21 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:303
@@ +302,3 @@
+
+  ScriptConfig->Commands.emplace(Cmd, new OutputSectionCommand(OutputName));
+  OutputSections->insert(Sec, OutSec);
----------------
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.)


https://reviews.llvm.org/D23352





More information about the llvm-commits mailing list