[PATCH] D26935: [ELF] Allow `ASSERT` in output section descriptions

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 15:29:51 PST 2016


ruiu added inline comments.


================
Comment at: ELF/LinkerScript.cpp:474
+  if (auto *Cmd = dyn_cast<AssertCommand>(&Base)) {
+    Cmd->Expression(0);
+    return;
----------------
Don't you need to pass Dot instead of 0, do you?


================
Comment at: ELF/LinkerScript.cpp:1424-1428
     if (SymbolAssignment *Assignment = readProvideOrAssignment(Tok))
       Cmd->Commands.emplace_back(Assignment);
     else if (BytesDataCommand *Data = readBytesDataCommand(Tok))
       Cmd->Commands.emplace_back(Data);
+    else if (Tok == "ASSERT") {
----------------
Since you added {}, please add braces to all if's here.


================
Comment at: ELF/LinkerScript.cpp:1430-1431
+      Cmd->Commands.emplace_back(new AssertCommand(readAssert()));
+      // GNU LD expects an "ASSERT" statement to end with a ";" in
+      // this context.
+      expect(";");
----------------
Remove this comment as it is obvious.


https://reviews.llvm.org/D26935





More information about the llvm-commits mailing list