[PATCH] D44414: Error instead of producing broken binary

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 10:24:13 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/Relocations.cpp:878
     // R_386_JMP_SLOT, etc).
+    if (!Target->SupportsPltPreemption)
+      errorOrWarn("symbol '" + toString(Sym) + "' cannot be preempted" +
----------------
I wouldn't generalize this as a Target member because I believe you need it only for i386. Even if there are two or more targets that need this, you could generalize when you add another arch.


================
Comment at: ELF/Relocations.cpp:879-880
+    if (!Target->SupportsPltPreemption)
+      errorOrWarn("symbol '" + toString(Sym) + "' cannot be preempted" +
+                  getLocation(Sec, Sym, Offset));
     Sym.NeedsPltAddr = true;
----------------
Please add a hint to the error message about how to fix the problem. You could fix this by recompiling with -fPIC, right?


https://reviews.llvm.org/D44414





More information about the llvm-commits mailing list