[PATCH] D16892: [lld] [ELF/AArch64] Add support to some GD/LE/IS TLS relocation

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 12:31:07 PST 2016


ruiu added inline comments.

================
Comment at: ELF/Target.cpp:1365-1366
@@ -1317,4 +1364,4 @@
     uint64_t X = getAArch64Page(SA) - getAArch64Page(P);
-    checkInt<33>(X, Type);
-    updateAArch64Adr(Loc, (X >> 12) & 0x1FFFFF); // X[32:12]
+    checkInt<32>(X, Type);
+    updateAArch64Addr(Loc, (X >> 12) & 0x1FFFFF); // X[32:12]
     break;
----------------
So, please leave "33" as is in this patch.

================
Comment at: ELF/Target.cpp:1462
@@ +1461,3 @@
+  case R_AARCH64_TLSDESC_CALL:
+  {
+    if (canBePreempted(S, true))
----------------
I didn't mean here, but after `if`.

  case R_AARCH64_TLSDESC_ADD_LO12_NC:
  case R_AARCH64_TLSDESC_CALL:
    if (canBePreempted(S, true)) {
      relocateTlsGdToIe(Type, Loc, BufEnd, P, SA);
    } else {
      ...
    }
    return 0;

================
Comment at: ELF/Target.cpp:1464
@@ +1463,3 @@
+    if (canBePreempted(S, true))
+      relocateTlsGdToIe(Type, Loc, BufEnd, P, SA);
+    else {
----------------
I'd replace this function call with

  error("Unsupported TLS optimization");

and remove relocateTlsGdToIe function. It is better than leaving the stub function.


http://reviews.llvm.org/D16892





More information about the llvm-commits mailing list