[PATCH] D38239: [ELF] - Define linkerscript symbols early.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 18:40:36 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/LinkerScript.cpp:128-131
+  // If we reach here and symbol uses PROVIDE() that means symbol satisfies
+  // providing conditions. Since we are calling addSymbol() multiple times and
+  // will define symbol below, we want to disable futher checks.
+  Cmd->Provide = false;
----------------
This seems like an optimization that you can remove.


================
Comment at: ELF/Writer.cpp:786-790
+    SymbolBody *Gp = Symtab->find("_gp");
+    if (!Gp || !isa<DefinedRegular>(Gp))
+      ElfSym::MipsGp = Symtab->addAbsolute<ELFT>("_gp", STV_HIDDEN, STB_LOCAL);
+    else
+      ElfSym::MipsGp = dyn_cast<DefinedRegular>(Gp);
----------------
It is not clear to me why you need to change this.


https://reviews.llvm.org/D38239





More information about the llvm-commits mailing list