[PATCH] D34355: [LLD][ELF] Define _GLOBAL_OFFSET_TABLE_ to base of .got for ARM

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 03:24:32 PDT 2017


peter.smith added a comment.

As per message on Friday I've committed 306282. I'm happy to make further changes or revert quickly if this causes any problems.



================
Comment at: ELF/Writer.cpp:1145-1147
+    if ((SS == InX::Got || SS ==InX::MipsGot) &&
+        Symtab<ELFT>::X->find("_GLOBAL_OFFSET_TABLE_"))
+      continue;
----------------
ruiu wrote:
> Doesn't this always succeed unless the -r option is given? It seems _GLOBAL_OFFSET_TABLE_ is added unconditionally, so `find` should return something non-null.
The code that adds the _GLOBAL_OFFSET_TABLE_ symbol uses addOptionalRegular which will only define the symbol if it is referenced so the find can return null. In any case, as per Rafael's suggestion I've recorded that the symbol was added so we don't need to look it up at this point. 


Repository:
  rL LLVM

https://reviews.llvm.org/D34355





More information about the llvm-commits mailing list