Mercurial > hg > CbC > CbC_llvm
comparison lld/ELF/AArch64ErrataFix.cpp @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
411 // Copy the instruction that we will be replacing with a branch in the | 411 // Copy the instruction that we will be replacing with a branch in the |
412 // patchee Section. | 412 // patchee Section. |
413 write32le(buf, read32le(patchee->data().begin() + patcheeOffset)); | 413 write32le(buf, read32le(patchee->data().begin() + patcheeOffset)); |
414 | 414 |
415 // Apply any relocation transferred from the original patchee section. | 415 // Apply any relocation transferred from the original patchee section. |
416 // For a SyntheticSection Buf already has outSecOff added, but relocateAlloc | 416 relocateAlloc(buf, buf + getSize()); |
417 // also adds outSecOff so we need to subtract to avoid double counting. | |
418 this->relocateAlloc(buf - outSecOff, buf - outSecOff + getSize()); | |
419 | 417 |
420 // Return address is the next instruction after the one we have just copied. | 418 // Return address is the next instruction after the one we have just copied. |
421 uint64_t s = getLDSTAddr() + 4; | 419 uint64_t s = getLDSTAddr() + 4; |
422 uint64_t p = patchSym->getVA() + 4; | 420 uint64_t p = patchSym->getVA() + 4; |
423 target->relocateNoSym(buf + 4, R_AARCH64_JUMP26, s - p); | 421 target->relocateNoSym(buf + 4, R_AARCH64_JUMP26, s - p); |