[PATCH] D44780: [ELF] - Implement linker script OVERLAYs.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 03:21:43 PDT 2018


grimar added inline comments.


================
Comment at: ELF/ScriptParser.cpp:462
+  Expr MoveDotExpr = [=] {
+    uint64_t MaxSize = 0;
+    for (BaseCommand *Cmd : V)
----------------
ruiu wrote:
> Do you have to compute MaxSize inside a lambda?
At the moment of parsing the linker script declaration, we do not know the output section sizes yet.
The lambda is needed to delay the computation. I see no other good way to do that.


================
Comment at: ELF/Writer.cpp:2069-2070
+    // addresses, because it is what OVERLAY was designed for.
+    if (Kind == OverlapKind::VirtualAddress && A.Sec->InOverlay &&
+        B.Sec->InOverlay)
+      continue;
----------------
ruiu wrote:
> This seems a overdesign. Implementation simplicity is important. Just skip if "InOverlay" is true. Remove OverlapKind enum.
I think that was one of the reasons to implement the OVERLAY instead of using the --no-check-sections.
It was mentioned in comments on bug page (https://bugs.llvm.org/show_bug.cgi?id=36768) that
"One problem with that is that it disables all checking"

Rafael?


https://reviews.llvm.org/D44780





More information about the llvm-commits mailing list