[PATCH] D19976: [ELF, WIP] - Prototype of possible linkerscript redesign.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 23:55:08 PDT 2016


grimar added a comment.

So I rebased this. Currently there are 11 testcases failing, that what also was before the rebase and I am working on fix for that. But the patch still shows the concept I am suggesting.


================
Comment at: ELF/LinkerScript.cpp:336
@@ +335,3 @@
+  OutputSectionBase<ELFT> *OutSection = nullptr;
+  LayoutParser().run([&](const Command &Cmd) {
+    if (Cmd.Kind == OutSectionKind) {
----------------
ruiu wrote:
> This seems tricky. Why do you have to parse linker scripts while processing expressions? I don't see a reason to use a callback function here. It seems to me that we can instead parse all scripts to save commands to a vector and evaluate them in this function.
Agree. That was overcomplication.

================
Comment at: ELF/MarkLive.cpp:185
@@ -184,3 +185,3 @@
           scanEhFrameSection<ELFT>(*EH);
-        if (isReserved(Sec) || Script<ELFT>::X->shouldKeep(Sec))
           Enqueue({Sec, 0});
----------------
ruiu wrote:
> What's wrong with this code? Why did you have to change the way we handle KEEP commands? The new code seems more complicated than before.
I reverted that place and implemented shouldKeep() to keep the previous interface.


https://reviews.llvm.org/D19976





More information about the llvm-commits mailing list