[PATCH] D15581: [ELF] - fixed not properly handled @GOTTPOFF relocation against local symbols.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 02:41:40 PST 2015


grimar added inline comments.

================
Comment at: ELF/InputSection.cpp:193
@@ -171,4 +192,3 @@
 
-    SymbolBody &Body = *File->getSymbolBody(SymIndex)->repl();
-
+    SymbolBody &Body = *PBody;
     if (Target->isTlsGlobalDynamicReloc(Type) &&
----------------
ruiu wrote:
> Can you remove variable `Body` and use *PBody instead? It now feels a bit odd to define a new variable here just to dereference PBody.
Ok, I did it because of 2 reasons:
1) Code that used Body assumed that it is not null, therefore reference object is the best for it.
2) Using of *PBody introduced lot of changes, almost each line was affected what was not very reasonable because of first reason for me.

But having another variable for the same object also not very good, here I agree. I renamed PBody to Body then, since PBody name appeared because Body was busy, and its also consistent with other code which uses Body name for pointers to SymbolBody.


Repository:
  rL LLVM

http://reviews.llvm.org/D15581





More information about the llvm-commits mailing list