[PATCH] D32354: [ELF] - Set DF_STATIC_TLS flag for i386 target.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 14:25:58 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM

Adding this piece of code to `getRelExpr` is tricky as `getRelExpr` is now not only do `get` but also has side effect. But this seems to be most less intrusive way of doing this.



================
Comment at: ELF/Target.cpp:363
                                   const uint8_t *Loc) const {
+  // We search any TLS IE/LE relocations to find if static TLS model was used.
+  if (Type == R_386_TLS_LE || Type == R_386_TLS_LE_32 || Type == R_386_TLS_IE ||
----------------
I don't think that comment is useful. When you describe it, you want to make it useful for those who are not familiar with details about what you are dealing with. I'd write

// There are 4 different TLS variable models with varying degrees of flexibility and performance.  LocalExec and InitialExec models are fast but less-flexible models. They cannot be used for dlopen(). If they are in use, we set DF_STATIC_TLS in the ELF header so that the runtime can reject such DSOs.


https://reviews.llvm.org/D32354





More information about the llvm-commits mailing list