[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 10:51:12 PST 2016


ruiu added inline comments.

================
Comment at: ELF/Target.cpp:1365
@@ -1317,3 +1364,3 @@
     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]
----------------
Why did you change this?

================
Comment at: ELF/Target.cpp:1439
@@ +1438,3 @@
+
+  // Global-Dynamic relocs can be relaxed to to Initial-Exec if the target is a
+  // an executable.  And if the target is local it can also be fully relaxed to
----------------
s/to to/to/
s/a an/an/

================
Comment at: ELF/Target.cpp:1462
@@ +1461,3 @@
+  case R_AARCH64_TLSDESC_CALL:
+    if (canBePreempted(S, true))
+      relocateTlsGdToIe(Type, Loc, BufEnd, P, SA);
----------------
Please add {}

================
Comment at: ELF/Target.cpp:1465
@@ +1464,3 @@
+    else {
+      uint64_t X= S ? S->getVA<ELF64LE>() : SA;
+      relocateTlsGdToLe(Type, Loc, BufEnd, P, X);
----------------
Insert space after '='.

================
Comment at: ELF/Target.cpp:1501
@@ +1500,3 @@
+
+  uint64_t tpOff = llvm::alignTo(TcbSize, Out<ELF64LE>::TlsPhdr->p_align);
+  uint64_t X = SA + tpOff;
----------------
Please follow the LLVM naming convention.

tpOff -> TPOff

================
Comment at: ELF/Target.cpp:1531
@@ +1530,3 @@
+                                          uint64_t SA) const {
+  uint64_t tpOff = llvm::alignTo(TcbSize, Out<ELF64LE>::TlsPhdr->p_align);
+  uint64_t X = SA + tpOff;
----------------
Ditto

================
Comment at: ELF/Target.cpp:1539
@@ +1538,3 @@
+    // Generate movz.
+    unsigned int RegNo = (Inst & 0x1f);
+    NewInst = (0xd2a00000 | RegNo) | (((X >> 16) & 0xffff) << 5);
----------------
s/unsigned int/unsigned/


http://reviews.llvm.org/D16892





More information about the llvm-commits mailing list