[PATCH] D22683: [ELF] Symbol assignment within input section list

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 23 04:17:27 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:551-553
@@ +550,5 @@
+    if (Symtab<ELFT>::X->find(Cmd->Name) == nullptr) {
+      if (OutSec)
+        Symtab<ELFT>::X->addSynthetic(Cmd->Name, OutSec,
+                                      evalExpr(Cmd->Expr, Cmd->Value));
+      else
----------------
Why don't you create absolute symbols here? I think it will simplifies the code.

================
Comment at: ELF/LinkerScript.cpp:842
@@ -802,1 +841,3 @@
+
+    std::unique_ptr<SymbolAssignment> Assignment;
     if (Tok == "PROVIDE")
----------------
I think SymbolAssignment is copy-assignable. You want to create a new instance of Assignment here and copy-assign to eliminate use of std::unique_ptr. (It's inefficient but it's really marginal.)


Repository:
  rL LLVM

https://reviews.llvm.org/D22683





More information about the llvm-commits mailing list