[PATCH] D24450: [ELF] Linkerscript: improve handling of ASSERT and symbol assignment outside SECTIONS block

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 13:26:50 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:52-53
@@ -51,1 +51,4 @@
+
+  if (!ScriptConfig->HasSections)
+    cast<DefinedRegular<ELFT>>(Cmd->Sym)->Value = Cmd->Expression(0);
 }
----------------
This needs comment.

================
Comment at: ELF/LinkerScript.cpp:224-225
@@ +223,4 @@
+    if (auto *Cmd = dyn_cast<AssertCommand>(Base1.get())) {
+      if (!Opt.HasSections)
+        Cmd->Expression(0);
+      continue;
----------------
What is this for? Please write a comment.

================
Comment at: ELF/LinkerScript.cpp:745-746
@@ -741,2 +744,4 @@
       readVersion();
+    } else if (Tok == "ASSERT") {
+      Opt.Commands.emplace_back(new AssertCommand(readAssert()));
     } else if (SymbolAssignment *Cmd = readProvideOrAssignment(Tok, true)) {
----------------
Sort them alphabetically.


Repository:
  rL LLVM

https://reviews.llvm.org/D24450





More information about the llvm-commits mailing list