[PATCH] D21297: [ELF][MIPS] Support GOT entries for non-preemptible symbols with different addends

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 10:42:09 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/OutputSections.cpp:200-201
@@ +199,4 @@
+    auto It = MipsGotMap.find({&B, Addend});
+    if (It == MipsGotMap.end())
+      llvm_unreachable("Cannot find GOT entry for the symbol");
+    Off += It->second;
----------------
  assert(It != MipsGotMap.end());

================
Comment at: ELF/OutputSections.h:159
@@ +158,3 @@
+  // to handle them uniformly.
+  typedef std::pair<const SymbolBody*, uintX_t> MipsGotSAPair;
+  llvm::DenseMap<MipsGotSAPair, size_t> MipsGotMap;
----------------
Instead of std::pair, can you define a struct, so that instead of first/second, we can use meaningful names?

================
Comment at: ELF/OutputSections.h:163
@@ +162,3 @@
+  std::vector<MipsGotSAPair> MipsGlobal;
+  // Write MIPS-specific parts of the GOT.
+  void writeMipsGot(uint8_t *&Buf);
----------------
Add newlines before comments.


Repository:
  rL LLVM

http://reviews.llvm.org/D21297





More information about the llvm-commits mailing list