Lines Matching defs:rel

40   void relocate(uint8_t *loc, const Relocation &rel,
329 for (Relocation &rel : sec->relocs()) {
330 if (rel.expr != R_RELAX_GOT_PC && rel.expr != R_RELAX_GOT_PC_NOPIC)
332 assert(rel.addend == -4);
335 sec->file, rel.type, rel.expr == R_RELAX_GOT_PC_NOPIC ? 0 : -4,
336 sec->getOutputSection()->addr + sec->outSecOff + rel.offset,
337 *rel.sym, rel.expr);
340 if (rel.sym->auxIdx == 0) {
341 rel.sym->allocateAux();
342 addGotEntry(*rel.sym);
345 rel.expr = R_GOT_PC;
423 // An x86 entry is the address of the ifunc resolver function (for -z rel).
462 static void relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) {
463 if (rel.type == R_X86_64_TLSGD) {
481 } else if (rel.type == R_X86_64_GOTPC32_TLSDESC) {
496 assert(rel.type == R_X86_64_TLSDESC_CALL);
502 static void relaxTlsGdToIe(uint8_t *loc, const Relocation &rel, uint64_t val) {
503 if (rel.type == R_X86_64_TLSGD) {
521 } else if (rel.type == R_X86_64_GOTPC32_TLSDESC) {
523 assert(rel.type == R_X86_64_GOTPC32_TLSDESC);
535 assert(rel.type == R_X86_64_TLSDESC_CALL);
584 static void relaxTlsLdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) {
763 static void relaxGot(uint8_t *loc, const Relocation &rel, uint64_t val);
765 void X86_64::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const {
766 switch (rel.type) {
768 checkIntUInt(loc, val, 8, rel);
772 checkInt(loc, val, 8, rel);
776 checkIntUInt(loc, val, 16, rel);
780 checkInt(loc, val, 16, rel);
784 checkUInt(loc, val, 32, rel);
795 checkInt(loc, val, 32, rel);
811 if (rel.expr != R_GOT_PC) {
812 relaxGot(loc, rel, val);
814 checkInt(loc, val, 32, rel);
821 if (rel.expr == R_RELAX_TLS_GD_TO_LE) {
822 relaxTlsGdToLe(loc, rel, val);
823 } else if (rel.expr == R_RELAX_TLS_GD_TO_IE) {
824 relaxTlsGdToIe(loc, rel, val);
826 checkInt(loc, val, 32, rel);
831 if (rel.expr == R_RELAX_TLS_LD_TO_LE) {
832 relaxTlsLdToLe(loc, rel, val);
834 checkInt(loc, val, 32, rel);
839 if (rel.expr == R_RELAX_TLS_IE_TO_LE) {
840 relaxTlsIeToLe(loc, rel, val);
842 checkInt(loc, val, 32, rel);
847 checkInt(loc, val, 32, rel);
960 static void relaxGot(uint8_t *loc, const Relocation &rel, uint64_t val) {
1041 for (const Relocation &rel : sec.relocs()) {
1042 if (rel.expr == R_NONE) // See deleteFallThruJmpInsn
1044 uint8_t *loc = buf + rel.offset;
1046 sec.getRelocTargetVA(sec.file, rel.type, rel.addend,
1047 secAddr + rel.offset, *rel.sym, rel.expr);
1048 relocate(loc, rel, val);