[lld] [X86, lld] Handle relocation R_X86_64_REX2_GOTPCRELX (PR #109783)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 28 20:33:19 PDT 2024


================
@@ -932,7 +937,18 @@ static void relaxGotNoPic(uint8_t *loc, uint64_t val, uint8_t op,
     // REX.B This 1-bit value is an extension to the MODRM.rm field or the
     // SIB.base field.
     // See "2.2.1.2 More on REX Prefix Fields " (2-8 Vol. 2A).
-    loc[-3] = (rex & ~0x4) | (rex & 0x4) >> 2;
+    //
+    // REX2 prefix is encoded as 0xd5|M|R2|X2|B2|WRXB, where
+    // 0xd5 is 1byte fixed pattern.
+    // REX2's [W,R,X,B] have the same meanings as REX's.
+    // REX2.M encodes the map id.
+    // R2/X2/B2 provides the fifth and most siginicant bits of the R/X/B
+    // register identifiers, each of which can now address all 32 GPRs.
+    // TODO: Add the section number here after APX SPEC is merged into SDM.
----------------
KanRobert wrote:

Done

https://github.com/llvm/llvm-project/pull/109783


More information about the llvm-commits mailing list