[PATCH] D14870: [ELF2] - Implemented optimizations for @tlsld and @tlsgd

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 02:14:24 PST 2015


grimar added inline comments.

================
Comment at: ELF/InputSection.cpp:114
@@ -112,1 +113,3 @@
+    if (Target->isTlsLocalDynamicReloc(Type) &&
+        (!Target->isTlsOptimized(Type, nullptr))) {
       Target->relocateOne(BufLoc, BufEnd, Type, AddrLoc,
----------------
grimar wrote:
> ruiu wrote:
> > Instead of adding this condition, can you move this
> > 
> >   if (Body.isTLS() && Target->isTlsOptimized(Type, &Body)) {
> >     ....
> >   }
> > 
> > block above this line?
> Thats probably will not work.
> I need to get the Body.
> 
> ```
> SymbolBody &Body = *File->getSymbolBody(SymIndex)->repl();
> ```
> To do that we need to check/handle locals first that dont have it. That is done below:
>  
> ```
>    if (SymIndex < SymTab->sh_info) {
> ...
>     }
> ```
> 
> What about if I remake isTlsLocalDynamicReloc() to isNoOptTlsLocalDynamicReloc() (NotOptimized + TlsLocalDynamicReloc) ? That should work everywhere in code.
> (and the same for isTlsGlobalDynamicReloc())
My suggestion to remake function fill not work either because Body still required for Global Dynamic optimized check. Leaved that code as is.

================
Comment at: ELF/Target.cpp:385
@@ +384,3 @@
+  if (Loc - 3 < BufStart)
+    error("Tls relocation LdToLe optimization fail, buffer overrun !");
+  const uint8_t Inst[] = {
----------------
grimar wrote:
> ruiu wrote:
> > Do not put a space before '!'.
> Ok
Removed the check.


http://reviews.llvm.org/D14870





More information about the llvm-commits mailing list