[PATCH] D15105: [ELF] - Fixed bug leading to miss of tls relocation when @tlsgd and @gottpoff relocations were used at the same time.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 09:18:37 PST 2015


ruiu added inline comments.

================
Comment at: ELF/Symbols.h:93
@@ -92,2 +92,3 @@
 
+  uint32_t GlobDynIndex = -1;
   uint32_t GotIndex = -1;
----------------
Glob -> Global

================
Comment at: ELF/Writer.cpp:227
@@ -226,7 +226,3 @@
         continue;
-      if (Body->isInGot())
-        continue;
-      Out<ELFT>::Got->addDynTlsEntry(Body);
-      Out<ELFT>::RelaDyn->addReloc({&C, &RI});
-      Out<ELFT>::RelaDyn->addReloc({nullptr, nullptr});
-      Body->setUsedInDynamicReloc();
+      if (Body->GlobDynIndex == uint32_t(-1)) {
+        Out<ELFT>::Got->addDynTlsEntry(Body);
----------------
Can you add a one-liner function for this comparison to SymbolBody, instead of comparing a value with -1?


http://reviews.llvm.org/D15105





More information about the llvm-commits mailing list