[PATCH] D35792: [lld] [COFF, ARM64] Handle ADRP immediate offsets in relocations

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 14:58:32 PDT 2017


ruiu added inline comments.


================
Comment at: COFF/Chunks.cpp:202
   uint32_t Orig = read32le(Off);
   uint32_t Size = Orig >> 30;
   // 0x04000000 indicates SIMD/FP registers
----------------
So this is more like a scale than a size?

(Is there any documentation about this relocation?)


================
Comment at: COFF/Chunks.cpp:211-213
+  Imm >>= Size;
+  Orig &= ~(0xFFF << 10);
+  write32le(Off, Orig | (Imm << 10));
----------------
You are shifting Imm to the right and then to the left, which looks a bit odd.


================
Comment at: COFF/Chunks.cpp:213
+  Orig &= ~(0xFFF << 10);
+  write32le(Off, Orig | (Imm << 10));
 }
----------------
So, if I understand correctly, this is equivalent to

  write32le(Off, (Orig & FFB003FF) | (Imm + ...));

(Sorry I cannot calculate it in my head but I think it should be simpler.)


https://reviews.llvm.org/D35792





More information about the llvm-commits mailing list