[PATCH] D46103: Replace SharedSymbols with Defined when creating copy relocations

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 02:33:58 PDT 2018


grimar added a comment.

This seems makes things slightly simpler, so LGTM. Suggestions are below.



================
Comment at: ELF/Relocations.cpp:470
+  uint32_t VerdefIndex = Sym.VerdefIndex;
+  bool IsInGlobalMipsGot = Sym.IsInGlobalMipsGot;
+  replaceSymbol<Defined>(&Sym, Sym.File, Sym.getName(), Sym.Binding,
----------------
I would shorten this with something like:
```
Symbol Old = Sym;
...
Sym.GotPltIndex = Old.GotPltIndex;
...

```


================
Comment at: ELF/Relocations.cpp:546
     Sym->IsUsedInRegularObj = true;
     Sym->Used = true;
   }
----------------
Maybe inline `replaceWithDefined`? These 2 lines look a bit lonely here. I would either inline or move them to `replaceWithDefined`.


https://reviews.llvm.org/D46103





More information about the llvm-commits mailing list