Lines Matching refs:loc
31 const uint8_t *loc) const override;
50 void relocate(uint8_t *loc, const Relocation &rel,
57 void relaxTlsGdToIe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
58 void relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
59 void relaxTlsLdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
60 void relaxTlsIeToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
67 static uint32_t readFromHalf16(const uint8_t *loc) {
68 return read32(config->isLE ? loc : loc - 2);
71 static void writeFromHalf16(uint8_t *loc, uint32_t insn) {
72 write32(config->isLE ? loc : loc - 2, insn);
219 const uint8_t *loc) const {
266 error(getErrorLocation(loc) + "unknown relocation (" + Twine(type) +
317 void PPC::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const {
322 checkIntUInt(loc, val, 16, rel);
323 write16(loc, val);
330 checkInt(loc, val, 16, rel);
331 write16(loc, val);
340 write16(loc, ha(val));
349 write16(loc, val >> 16);
358 write16(loc, val);
362 write32(loc, val);
366 checkInt(loc, val, 16, rel);
367 checkAlignment(loc, val, 4, rel);
368 write32(loc, (read32(loc) & ~mask) | (val & mask));
376 checkInt(loc, val, 26, rel);
377 checkAlignment(loc, val, 4, rel);
378 write32(loc, (read32(loc) & ~mask) | (val & mask));
408 void PPC::relaxTlsGdToIe(uint8_t *loc, const Relocation &rel,
413 uint32_t insn = readFromHalf16(loc);
414 writeFromHalf16(loc, 0x80000000 | (insn & 0x03ff0000));
415 relocateNoSym(loc, R_PPC_GOT_TPREL16, val);
420 write32(loc, 0x7c631214);
427 void PPC::relaxTlsGdToLe(uint8_t *loc, const Relocation &rel,
432 writeFromHalf16(loc, 0x3c620000 | ha(val));
436 write32(loc, 0x38630000 | lo(val));
443 void PPC::relaxTlsLdToLe(uint8_t *loc, const Relocation &rel,
448 writeFromHalf16(loc, 0x3c620000);
454 write32(loc, 0x38631000);
460 relocate(loc, rel, val);
467 void PPC::relaxTlsIeToLe(uint8_t *loc, const Relocation &rel,
472 uint32_t rt = readFromHalf16(loc) & 0x03e00000;
473 writeFromHalf16(loc, 0x3c020000 | rt | ha(val));
477 uint32_t insn = read32(loc);
481 unsigned secondaryOp = (read32(loc) & 0x000007fe) >> 1;
488 write32(loc, (dFormOp | (insn & 0x03ff0000) | lo(val)));
501 uint8_t *loc = buf + rel.offset;
508 relaxTlsGdToIe(loc, rel, val);
511 relaxTlsGdToLe(loc, rel, val);
514 relaxTlsLdToLe(loc, rel, val);
517 relaxTlsIeToLe(loc, rel, val);
520 relocate(loc, rel, val);