[PATCH] D19190: [ELF] - Implemented PROVIDE linker script command.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 07:31:28 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:132-135
@@ +131,6 @@
+    if (Cmd.Kind == ProvideKind) {
+      auto I = ElfSym<ELFT>::Provide.find(Cmd.Name);
+      if (I != ElfSym<ELFT>::Provide.end())
+        I->second->Value = evaluate(Cmd.Expr, VA);
+      continue;
+    }
----------------
ruiu wrote:
> Can you make SymbolTable a member of LinkerScript and directly call addAbsolute here? Then I think you can remove ElfSym<ELFT>::Provide.
I think I can not directly call addAbsolute from LinkerScript::assignAddresses() because
would catch undefined symbol error then if symbol is referenced.
I need this symbols to be added before symbol resolution and that is why had to add
LinkerScript::createSymbols() method.

But I was able to get rid of ElfSym<ELFT>::Provide after addressing Rafael's suggestion, I also 
added some limitations (please read latest patch changelist) that allows
to simplify the code.


http://reviews.llvm.org/D19190





More information about the llvm-commits mailing list