[lld] [lld][macho] Support 1-byte branch relocs for x86_64 (PR #164439)

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 12:13:17 PDT 2025


================
@@ -96,11 +98,18 @@ int64_t X86_64::getEmbeddedAddend(MemoryBufferRef mb, uint64_t offset,
 void X86_64::relocateOne(uint8_t *loc, const Reloc &r, uint64_t value,
                          uint64_t relocVA) const {
   if (r.pcrel) {
-    uint64_t pc = relocVA + 4 + pcrelOffset(r.type);
+    uint64_t pc = relocVA + (1 << r.length) + pcrelOffset(r.type);
----------------
int3 wrote:

a function just for one binary op?? seems like overkill haha

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


More information about the llvm-commits mailing list