[all-commits] [llvm/llvm-project] 21562c: [JITLink][ELF][x86-64] Adjust addends for R_X86_64...
lhames via All-commits
all-commits at lists.llvm.org
Sun Dec 5 01:38:16 PST 2021
Author: Lang Hames <lhames at gmail.com>
Date: 2021-12-05 (Sun, 05 Dec 2021)
[JITLink][ELF][x86-64] Adjust addends for R_X86_64_PLT32 relocations.
R_X86_64_PLT32 explicitly represents the '-4' PC-adjustment in the relocation's
addend, but JITLink's x86_64::Branch32PCRel includes the PC-adjustment
implicitly. We have been zeroing the addend to account for the difference, but
this breaks for branches to non-zero offsets past labels. This patch updates the
relocation parsing code to unconditionally adjust the offset by '+4' instead.
For branches directly to labels the result is still 0, for branches to offsets
past labels the result is the correct addend for x86_64::Branch32PCRel.
More information about the All-commits