[PATCH] D27276: [ELF] Allow defined symbols to be assigned from linker script

Meador Inge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 15:05:13 PST 2016


meadori added inline comments.


================
Comment at: ELF/LinkerScript.cpp:111-118
+  if (!B || B->isUndefined()) {
+    if (Cmd->Expression.IsAbsolute())
+      Cmd->Sym = addRegular<ELFT>(Cmd);
+    else
+      Cmd->Sym = addSynthetic<ELFT>(Cmd);
+  } else {
+    Cmd->Sym = B;
----------------
ruiu wrote:
> I don't think you need to check if B exists. You can add a new symbol unconditionally.
If you do it unconditionally, then duplicate symbols might be created, e.g. `foo` is defined in an input object *and* the linker script.


https://reviews.llvm.org/D27276





More information about the llvm-commits mailing list