[PATCH] D15779: [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 15:47:17 PDT 2016


rafael added inline comments.

================
Comment at: ELF/InputSection.h:67
@@ -65,3 +66,3 @@
          Expr == R_GOT_PC || Expr == R_GOT_FROM_END || Expr == R_TLSGD ||
-         Expr == R_TLSGD_PC;
+         Expr == R_TLSGD_PC || Expr == R_RELAX_GOT;
 }
----------------
It is a bit surprising to see this here. If the got access is relaxed, it result will not refer to a got entry, no?

================
Comment at: ELF/Target.cpp:244
@@ +243,3 @@
+    return false;
+  return (S.getName() != "_DYNAMIC");
+}
----------------
I am pretty sure this reference to "_DYNAMIC" is bogus. The email you posted refers to got[0], but we write that value directly. This code will never be used for that.

================
Comment at: ELF/Target.cpp:758
@@ +757,3 @@
+    return false;
+  return isRelaxable(S);
+}
----------------
Every target would have to call this, no? Why not call it from target independent code?

================
Comment at: ELF/Target.cpp:762
@@ +761,3 @@
+void X86_64TargetInfo::relaxGot(uint8_t *Loc, uint64_t Val) const {
+  if (Val + 0x80000000 > 0xFFFFFFFF)
+    fatal("Relaxation overflow");
----------------
It is not clear why you need this. relocateOne has a value check. Why you need one here?


http://reviews.llvm.org/D15779





More information about the llvm-commits mailing list