Lines Matching refs:buf

52   void writeTo(uint8_t *buf) override;
60 void writeTo(uint8_t *buf) override;
78 void writeTo(uint8_t *buf) override;
86 virtual void writeLong(uint8_t *buf) = 0;
110 void writeTo(uint8_t *buf) override;
118 virtual void writeLong(uint8_t *buf) = 0;
132 void writeLong(uint8_t *buf) override;
141 void writeLong(uint8_t *buf) override;
151 void writeLong(uint8_t *buf) override;
160 void writeLong(uint8_t *buf) override;
174 void writeLong(uint8_t *buf) override;
185 void writeLong(uint8_t *buf) override;
198 void writeLong(uint8_t *buf) override;
208 void writeLong(uint8_t *buf) override;
218 void writeTo(uint8_t *buf) override;
229 void writeTo(uint8_t *buf) override;
240 void writeTo(uint8_t *buf) override;
253 void writeTo(uint8_t *buf) override;
266 void writeTo(uint8_t *buf) override;
282 void writeTo(uint8_t *buf) override;
312 void writeTo(uint8_t *buf) override;
335 void writeTo(uint8_t *buf) override;
352 void writeTo(uint8_t *buf) override;
369 void writeTo(uint8_t *buf) override;
423 void AArch64ABSLongThunk::writeTo(uint8_t *buf) { in writeTo() argument
431 memcpy(buf, data, sizeof(data)); in writeTo()
432 target->relocateNoSym(buf + 8, R_AARCH64_ABS64, s); in writeTo()
447 void AArch64ADRPThunk::writeTo(uint8_t *buf) { in writeTo() argument
455 memcpy(buf, data, sizeof(data)); in writeTo()
456 target->relocateNoSym(buf, R_AARCH64_ADR_PREL_PG_HI21, in writeTo()
458 target->relocateNoSym(buf + 4, R_AARCH64_ADD_ABS_LO12_NC, s); in writeTo()
489 void ARMThunk::writeTo(uint8_t *buf) { in writeTo() argument
491 writeLong(buf); in writeTo()
501 memcpy(buf, data, sizeof(data)); in writeTo()
502 target->relocateNoSym(buf, R_ARM_JUMP24, offset); in writeTo()
527 void ThumbThunk::writeTo(uint8_t *buf) { in writeTo() argument
529 writeLong(buf); in writeTo()
539 memcpy(buf, data, sizeof(data)); in writeTo()
540 target->relocateNoSym(buf, R_ARM_THM_JUMP24, offset); in writeTo()
549 void ARMV7ABSLongThunk::writeLong(uint8_t *buf) { in writeLong() argument
556 memcpy(buf, data, sizeof(data)); in writeLong()
557 target->relocateNoSym(buf, R_ARM_MOVW_ABS_NC, s); in writeLong()
558 target->relocateNoSym(buf + 4, R_ARM_MOVT_ABS, s); in writeLong()
567 void ThumbV7ABSLongThunk::writeLong(uint8_t *buf) { in writeLong() argument
574 memcpy(buf, data, sizeof(data)); in writeLong()
575 target->relocateNoSym(buf, R_ARM_THM_MOVW_ABS_NC, s); in writeLong()
576 target->relocateNoSym(buf + 4, R_ARM_THM_MOVT_ABS, s); in writeLong()
585 void ARMV7PILongThunk::writeLong(uint8_t *buf) { in writeLong() argument
595 memcpy(buf, data, sizeof(data)); in writeLong()
596 target->relocateNoSym(buf, R_ARM_MOVW_PREL_NC, offset); in writeLong()
597 target->relocateNoSym(buf + 4, R_ARM_MOVT_PREL, offset); in writeLong()
606 void ThumbV7PILongThunk::writeLong(uint8_t *buf) { in writeLong() argument
616 memcpy(buf, data, sizeof(data)); in writeLong()
617 target->relocateNoSym(buf, R_ARM_THM_MOVW_PREL_NC, offset); in writeLong()
618 target->relocateNoSym(buf + 4, R_ARM_THM_MOVT_PREL, offset); in writeLong()
627 void ARMV5ABSLongThunk::writeLong(uint8_t *buf) { in writeLong() argument
632 memcpy(buf, data, sizeof(data)); in writeLong()
633 target->relocateNoSym(buf + 4, R_ARM_ABS32, getARMThunkDestVA(destination)); in writeLong()
649 void ARMV5PILongThunk::writeLong(uint8_t *buf) { in writeLong() argument
658 memcpy(buf, data, sizeof(data)); in writeLong()
659 target->relocateNoSym(buf + 12, R_ARM_REL32, s - p - 12); in writeLong()
675 void ThumbV6MABSLongThunk::writeLong(uint8_t *buf) { in writeLong() argument
688 memcpy(buf, data, sizeof(data)); in writeLong()
689 target->relocateNoSym(buf + 8, R_ARM_ABS32, s); in writeLong()
699 void ThumbV6MPILongThunk::writeLong(uint8_t *buf) { in writeLong() argument
714 memcpy(buf, data, sizeof(data)); in writeLong()
715 target->relocateNoSym(buf + 12, R_ARM_REL32, s - p - 12); in writeLong()
726 void MipsThunk::writeTo(uint8_t *buf) { in writeTo() argument
728 write32(buf, 0x3c190000); // lui $25, %hi(func) in writeTo()
729 write32(buf + 4, 0x08000000 | (s >> 2)); // j func in writeTo()
730 write32(buf + 8, 0x27390000); // addiu $25, $25, %lo(func) in writeTo()
731 write32(buf + 12, 0x00000000); // nop in writeTo()
732 target->relocateNoSym(buf, R_MIPS_HI16, s); in writeTo()
733 target->relocateNoSym(buf + 8, R_MIPS_LO16, s); in writeTo()
748 void MicroMipsThunk::writeTo(uint8_t *buf) { in writeTo() argument
750 write16(buf, 0x41b9); // lui $25, %hi(func) in writeTo()
751 write16(buf + 4, 0xd400); // j func in writeTo()
752 write16(buf + 8, 0x3339); // addiu $25, $25, %lo(func) in writeTo()
753 write16(buf + 12, 0x0c00); // nop in writeTo()
754 target->relocateNoSym(buf, R_MICROMIPS_HI16, s); in writeTo()
755 target->relocateNoSym(buf + 4, R_MICROMIPS_26_S1, s); in writeTo()
756 target->relocateNoSym(buf + 8, R_MICROMIPS_LO16, s); in writeTo()
773 void MicroMipsR6Thunk::writeTo(uint8_t *buf) { in writeTo() argument
776 write16(buf, 0x1320); // lui $25, %hi(func) in writeTo()
777 write16(buf + 4, 0x3339); // addiu $25, $25, %lo(func) in writeTo()
778 write16(buf + 8, 0x9400); // bc func in writeTo()
779 target->relocateNoSym(buf, R_MICROMIPS_HI16, s); in writeTo()
780 target->relocateNoSym(buf + 4, R_MICROMIPS_LO16, s); in writeTo()
781 target->relocateNoSym(buf + 8, R_MICROMIPS_PC26_S1, s - p - 12); in writeTo()
796 void elf::writePPC32PltCallStub(uint8_t *buf, uint64_t gotPltVA, in writePPC32PltCallStub() argument
799 write32(buf + 0, 0x3d600000 | (gotPltVA + 0x8000) >> 16); // lis r11,ha in writePPC32PltCallStub()
800 write32(buf + 4, 0x816b0000 | (uint16_t)gotPltVA); // lwz r11,l(r11) in writePPC32PltCallStub()
801 write32(buf + 8, 0x7d6903a6); // mtctr r11 in writePPC32PltCallStub()
802 write32(buf + 12, 0x4e800420); // bctr in writePPC32PltCallStub()
820 write32(buf + 0, 0x817e0000 | l); // lwz r11,l(r30) in writePPC32PltCallStub()
821 write32(buf + 4, 0x7d6903a6); // mtctr r11 in writePPC32PltCallStub()
822 write32(buf + 8, 0x4e800420); // bctr in writePPC32PltCallStub()
823 write32(buf + 12, 0x60000000); // nop in writePPC32PltCallStub()
825 write32(buf + 0, 0x3d7e0000 | ha); // addis r11,r30,ha in writePPC32PltCallStub()
826 write32(buf + 4, 0x816b0000 | l); // lwz r11,l(r11) in writePPC32PltCallStub()
827 write32(buf + 8, 0x7d6903a6); // mtctr r11 in writePPC32PltCallStub()
828 write32(buf + 12, 0x4e800420); // bctr in writePPC32PltCallStub()
832 void PPC32PltCallStub::writeTo(uint8_t *buf) { in writeTo() argument
833 writePPC32PltCallStub(buf, destination.getGotPltVA(), file, addend); in writeTo()
837 std::string buf; in addSymbols() local
838 raw_string_ostream os(buf); in addSymbols()
860 void PPC32LongThunk::writeTo(uint8_t *buf) { in writeTo() argument
866 write32(buf + 0, 0x7c0802a6); // mflr r12,0 in writeTo()
867 write32(buf + 4, 0x429f0005); // bcl r20,r31,.+4 in writeTo()
868 write32(buf + 8, 0x7d8802a6); // mtctr r12 in writeTo()
869 write32(buf + 12, 0x3d8c0000 | ha(off)); // addis r12,r12,off@ha in writeTo()
870 write32(buf + 16, 0x398c0000 | lo(off)); // addi r12,r12,off@l in writeTo()
871 write32(buf + 20, 0x7c0803a6); // mtlr r0 in writeTo()
872 buf += 24; in writeTo()
874 write32(buf + 0, 0x3d800000 | ha(d)); // lis r12,d@ha in writeTo()
875 write32(buf + 4, 0x398c0000 | lo(d)); // addi r12,r12,d@l in writeTo()
876 buf += 8; in writeTo()
878 write32(buf + 0, 0x7d8903a6); // mtctr r12 in writeTo()
879 write32(buf + 4, 0x4e800420); // bctr in writeTo()
882 void elf::writePPC64LoadAndBranch(uint8_t *buf, int64_t offset) { in writePPC64LoadAndBranch() argument
886 write32(buf + 0, 0x3d820000 | offHa); // addis r12, r2, OffHa in writePPC64LoadAndBranch()
887 write32(buf + 4, 0xe98c0000 | offLo); // ld r12, OffLo(r12) in writePPC64LoadAndBranch()
888 write32(buf + 8, 0x7d8903a6); // mtctr r12 in writePPC64LoadAndBranch()
889 write32(buf + 12, 0x4e800420); // bctr in writePPC64LoadAndBranch()
892 void PPC64PltCallStub::writeTo(uint8_t *buf) { in writeTo() argument
895 write32(buf + 0, 0xf8410018); // std r2,24(r1) in writeTo()
896 writePPC64LoadAndBranch(buf + 4, offset); in writeTo()
911 void PPC64R2SaveStub::writeTo(uint8_t *buf) { in writeTo() argument
913 write32(buf + 0, 0xf8410018); // std r2,24(r1) in writeTo()
916 write32(buf + 4, 0x48000000 | (offset & 0x03fffffc)); // b <offset> in writeTo()
924 write32(buf + 4, addis); // addis r12, r2 , top of offset in writeTo()
925 write32(buf + 8, addi); // addi r12, r12, bottom of offset in writeTo()
929 write32(buf + 4, addi); // addi r12, r2, offset in writeTo()
932 write32(buf + nextInstOffset, MTCTR_R12); // mtctr r12 in writeTo()
933 write32(buf + nextInstOffset + 4, BCTR); // bctr in writeTo()
939 writePPC64LoadAndBranch(buf + 4, offsetFromTOC); in writeTo()
954 void PPC64R12SetupStub::writeTo(uint8_t *buf) { in writeTo() argument
957 reportRangeError(buf, offset, 34, destination, "R12 setup stub offset"); in writeTo()
962 write32(buf + 0, 0x7c0802a6); // mflr r12 in writeTo()
963 write32(buf + 4, 0x429f0005); // bcl 20,31,.+4 in writeTo()
964 write32(buf + 8, 0x7d6802a6); // mflr r11 in writeTo()
965 write32(buf + 12, 0x7d8803a6); // mtlr r12 in writeTo()
966 write32(buf + 16, 0x3d8b0000 | computeHiBits(off));// addis r12,r11,off@ha in writeTo()
967 write32(buf + 20, 0x398c0000 | (off & 0xffff)); // addi r12,r12,off@l in writeTo()
972 writePrefixedInstruction(buf + 0, paddi); // paddi r12, 0, func@pcrel, 1 in writeTo()
975 write32(buf + nextInstOffset, MTCTR_R12); // mtctr r12 in writeTo()
976 write32(buf + nextInstOffset + 4, BCTR); // bctr in writeTo()
989 void PPC64PCRelPLTStub::writeTo(uint8_t *buf) { in writeTo() argument
995 reportRangeError(buf, offset, 34, destination, in writeTo()
999 writePrefixedInstruction(buf + 0, pld); // pld r12, func@plt@pcrel in writeTo()
1003 write32(buf + 0, 0x7c0802a6); // mflr r12 in writeTo()
1004 write32(buf + 4, 0x429f0005); // bcl 20,31,.+4 in writeTo()
1005 write32(buf + 8, 0x7d6802a6); // mflr r11 in writeTo()
1006 write32(buf + 12, 0x7d8803a6); // mtlr r12 in writeTo()
1007 write32(buf + 16, 0x3d8b0000 | computeHiBits(off)); // addis r12,r11,off@ha in writeTo()
1008 write32(buf + 20, 0x398c0000 | (off & 0xffff)); // addi r12,r12,off@l in writeTo()
1011 write32(buf + nextInstOffset, MTCTR_R12); // mtctr r12 in writeTo()
1012 write32(buf + nextInstOffset + 4, BCTR); // bctr in writeTo()
1025 void PPC64LongBranchThunk::writeTo(uint8_t *buf) { in writeTo() argument
1028 writePPC64LoadAndBranch(buf, offset); in writeTo()