Index: ELF/Thunks.cpp =================================================================== --- ELF/Thunks.cpp +++ ELF/Thunks.cpp @@ -157,7 +157,7 @@ void ThumbV7ABSLongThunk::addSymbols(ThunkSection &IS) { this->ThunkSym = addSyntheticLocal( Saver.save("__Thumbv7ABSLongThunk_" + this->Destination.getName()), - STT_FUNC, this->Offset, size(), &IS); + STT_FUNC, this->Offset | 1, size(), &IS); addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS); } @@ -206,7 +206,7 @@ 0x60, 0x47, // bx r12 }; uint64_t S = getARMThunkDestVA(this->Destination); - uint64_t P = this->ThunkSym->getVA(); + uint64_t P = this->ThunkSym->getVA() & ~0x1; memcpy(Buf, Data, sizeof(Data)); Target->relocateOne(Buf, R_ARM_THM_MOVW_PREL_NC, S - P - 12); Target->relocateOne(Buf + 4, R_ARM_THM_MOVT_PREL, S - P - 8); @@ -216,7 +216,7 @@ void ThumbV7PILongThunk::addSymbols(ThunkSection &IS) { this->ThunkSym = addSyntheticLocal( Saver.save("__ThumbV7PILongThunk_" + this->Destination.getName()), - STT_FUNC, this->Offset, size(), &IS); + STT_FUNC, this->Offset | 1, size(), &IS); addSyntheticLocal("$t", STT_NOTYPE, this->Offset, 0, &IS); }