[PATCH] D16201: [ELF/AArch64] - Implemented set of R_AARCH64_TLSDESC_* relocations.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 16:53:05 PST 2016


ruiu added inline comments.

================
Comment at: ELF/InputSection.cpp:211
@@ -210,1 +210,3 @@
 
+    // TLS descriptor lazy relocations are specific. They
+    // uses two words in the .got.plt. A single relocation is to be used to
----------------
Instead of adding this code,

================
Comment at: ELF/InputSection.cpp:236
@@ -222,3 +235,3 @@
       continue;
     } else if (Target->isSizeReloc(Type) && canBePreempted(Body, false)) {
       // A SIZE relocation is supposed to set a symbol size, but if a symbol
----------------
... why don't you add

  } else if (Body->isTls() && Target->isTlsDescReloc(Type, *Body)) {
    SymVA = Out<ELFT>::GotPlt->getEntryAddr(*Body)
    continue;

here? (I'm not saying that this long if-elseif-elseif is easy to read, but consistency matters.

================
Comment at: ELF/Writer.cpp:251
@@ +250,3 @@
+    if (Body && Body->isTls()) {
+      // If module uses TLS descriptor relocations,
+      // then special entries are created for module:
----------------
Can you move this code to a new function? This function got too large.


http://reviews.llvm.org/D16201





More information about the llvm-commits mailing list