[lld] [lld][macho] Support 1-byte branch relocs for x86_64 (PR #164439)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 21 12:27:18 PDT 2025
================
@@ -84,6 +84,8 @@ int64_t X86_64::getEmbeddedAddend(MemoryBufferRef mb, uint64_t offset,
const uint8_t *loc = buf + offset + rel.r_address;
switch (rel.r_length) {
+ case 0:
+ return *loc + pcrelOffset(rel.r_type);
case 2:
return static_cast<int32_t>(read32le(loc)) + pcrelOffset(rel.r_type);
----------------
ellishg wrote:
Oh that makes sense. In that case, can the single byte addend be negative? I believe it's read as an unsigned byte currently.
https://github.com/llvm/llvm-project/pull/164439
More information about the llvm-commits
mailing list