Lines Matching defs:rel
183 void relocate(uint8_t *loc, const Relocation &rel,
194 void relaxGot(uint8_t *loc, const Relocation &rel, uint64_t val) const;
201 void relaxTlsGdToIe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
202 void relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
203 void relaxTlsLdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
204 void relaxTlsIeToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
380 static bool tryRelaxPPC64TocIndirection(Ctx &ctx, const Relocation &rel,
383 if (rel.addend < 0)
387 Defined *defSym = dyn_cast<Defined>(rel.sym);
395 ctx.arg.isLE ? getRelaTocSymAndAddend<ELF64LE>(tocISB, rel.addend)
396 : getRelaTocSymAndAddend<ELF64BE>(tocISB, rel.addend);
413 .relaxGot(bufLoc, rel, tocRelative + ppc64TocOffset);
652 void PPC64::relaxGot(uint8_t *loc, const Relocation &rel, uint64_t val) const {
653 switch (rel.type) {
656 relocate(loc, rel, val);
681 relocate(loc, rel, val);
689 uint32_t accessInsn = read32(ctx, loc + rel.addend);
710 write32(ctx, loc + rel.addend, NOP); // nop accessInsn.
718 void PPC64::relaxTlsGdToLe(uint8_t *loc, const Relocation &rel,
735 switch (rel.type) {
781 void PPC64::relaxTlsLdToLe(uint8_t *loc, const Relocation &rel,
798 switch (rel.type) {
839 relocate(loc, rel, val);
893 void PPC64::relaxTlsIeToLe(uint8_t *loc, const Relocation &rel,
915 switch (rel.type) {
1262 void PPC64::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const {
1263 RelType type = rel.type;
1271 checkAlignment(ctx, loc, val, 4, rel);
1278 checkIntUInt(ctx, loc, val, 16, rel);
1282 checkIntUInt(ctx, loc, val, 32, rel);
1287 checkInt(ctx, loc, val, 16, rel);
1291 checkAlignment(ctx, loc, lo(val), mask + 1, rel);
1300 checkInt(ctx, loc, val + 0x8000, 32, rel);
1307 checkInt(ctx, loc, val, 32, rel);
1352 checkAlignment(ctx, loc, lo(val), mask + 1, rel);
1368 checkInt(ctx, loc, val, 16, rel);
1372 checkInt(ctx, loc, val, 32, rel);
1382 checkInt(ctx, loc, val, 16, rel);
1383 checkAlignment(ctx, loc, val, 4, rel);
1390 checkInt(ctx, loc, val, 26, rel);
1391 checkAlignment(ctx, loc, val, 4, rel);
1413 checkInt(ctx, loc, val, 34, rel);
1515 void PPC64::relaxTlsGdToIe(uint8_t *loc, const Relocation &rel,
1517 switch (rel.type) {
1573 for (const Relocation &rel : sec.relocs()) {
1574 uint8_t *loc = buf + rel.offset;
1575 const uint64_t val = sec.getRelocTargetVA(ctx, rel, secAddr + rel.offset);
1576 switch (rel.expr) {
1584 if (rel.type == R_PPC64_GOT_PCREL34)
1585 lastPPCRelaxedRelocOff = rel.offset;
1586 if (rel.type == R_PPC64_PCREL_OPT && rel.offset != lastPPCRelaxedRelocOff)
1588 relaxGot(loc, rel, val);
1592 // rel.sym refers to the STT_SECTION symbol associated to the .toc input
1597 if (ctx.ppc64noTocRelax.count({rel.sym, rel.addend}) ||
1598 !tryRelaxPPC64TocIndirection(ctx, rel, loc))
1599 relocate(loc, rel, val);
1609 if (rel.sym->needsTocRestore()) {
1614 if ((rel.offset + 8 > sec.content().size() ||
1616 rel.sym->file != sec.file) {
1619 << toStr(ctx, *rel.sym).substr(6)
1625 relocate(loc, rel, val);
1629 relaxTlsGdToIe(loc, rel, val);
1632 relaxTlsGdToLe(loc, rel, val);
1635 relaxTlsLdToLe(loc, rel, val);
1638 relaxTlsIeToLe(loc, rel, val);
1641 relocate(loc, rel, val);