Lines Matching refs:rel
44 void relocate(uint8_t *loc, const Relocation &rel,
335 void RISCV::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { in relocate() argument
338 switch (rel.type) { in relocate()
347 checkInt(loc, val, 9, rel); in relocate()
348 checkAlignment(loc, val, 2, rel); in relocate()
362 checkInt(loc, val, 12, rel); in relocate()
363 checkAlignment(loc, val, 2, rel); in relocate()
381 checkInt(loc, imm, 6, rel); in relocate()
393 checkInt(loc, val, 21, rel); in relocate()
394 checkAlignment(loc, val, 2, rel); in relocate()
408 checkInt(loc, val, 13, rel); in relocate()
409 checkAlignment(loc, val, 2, rel); in relocate()
426 checkInt(loc, hi, 20, rel); in relocate()
442 checkInt(loc, SignExtend64(hi, bits) >> 12, 20, rel); in relocate()
471 checkInt(loc, displace, 12, rel); in relocate()
473 if (rel.type == INTERNAL_R_RISCV_GPREL_I) in relocate()
521 checkInt(loc, val, 32, rel); in relocate()
550 static void tlsdescToIe(uint8_t *loc, const Relocation &rel, uint64_t val) { in tlsdescToIe() argument
551 switch (rel.type) { in tlsdescToIe()
570 static void tlsdescToLe(uint8_t *loc, const Relocation &rel, uint64_t val) { in tlsdescToLe() argument
571 switch (rel.type) { in tlsdescToLe()
603 const Relocation &rel = relocs[i]; in relocateAlloc() local
604 uint8_t *loc = buf + rel.offset; in relocateAlloc()
606 sec.getRelocTargetVA(sec.file, rel.type, rel.addend, in relocateAlloc()
607 secAddr + rel.offset, *rel.sym, rel.expr); in relocateAlloc()
609 switch (rel.expr) { in relocateAlloc()
615 if (rel.type == R_RISCV_TLSDESC_HI20) in relocateAlloc()
626 tlsdescVal = val + rel.offset; in relocateAlloc()
630 tlsdescToIe(loc, rel, val); in relocateAlloc()
636 if (rel.type == R_RISCV_TLSDESC_HI20) { in relocateAlloc()
641 if (!isToLe && rel.type == R_RISCV_TLSDESC_ADD_LO12) in relocateAlloc()
642 tlsdescVal -= rel.offset; in relocateAlloc()
648 (rel.type == R_RISCV_TLSDESC_HI20 || in relocateAlloc()
649 rel.type == R_RISCV_TLSDESC_LOAD_LO12 || in relocateAlloc()
650 (rel.type == R_RISCV_TLSDESC_ADD_LO12 && isToLe && !hi20(val)))) in relocateAlloc()
653 tlsdescToLe(loc, rel, val); in relocateAlloc()
655 tlsdescToIe(loc, rel, val); in relocateAlloc()
660 if (rel.type == R_RISCV_SET_ULEB128 && in relocateAlloc()
661 rel1.type == R_RISCV_SUB_ULEB128 && rel.offset == rel1.offset) { in relocateAlloc()
662 auto val = rel.sym->getVA(rel.addend) - rel1.sym->getVA(rel1.addend); in relocateAlloc()
664 errorOrWarn(sec.getLocation(rel.offset) + ": ULEB128 value " + in relocateAlloc()
666 lld::toString(*rel.sym) + "'"); in relocateAlloc()
671 errorOrWarn(sec.getLocation(rel.offset) + in relocateAlloc()
677 relocate(loc, rel, val); in relocateAlloc()