Path: blob/main/contrib/llvm-project/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.h
35294 views
//===-- RuntimeDyldELFMips.h ---- ELF/Mips specific code. -------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H9#define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H1011#include "../RuntimeDyldELF.h"1213#define DEBUG_TYPE "dyld"1415namespace llvm {1617class RuntimeDyldELFMips : public RuntimeDyldELF {18public:1920typedef uint64_t TargetPtrT;2122RuntimeDyldELFMips(RuntimeDyld::MemoryManager &MM,23JITSymbolResolver &Resolver)24: RuntimeDyldELF(MM, Resolver) {}2526void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;2728protected:29void resolveMIPSO32Relocation(const SectionEntry &Section, uint64_t Offset,30uint32_t Value, uint32_t Type, int32_t Addend);31void resolveMIPSN32Relocation(const SectionEntry &Section, uint64_t Offset,32uint64_t Value, uint32_t Type, int64_t Addend,33uint64_t SymOffset, SID SectionID);34void resolveMIPSN64Relocation(const SectionEntry &Section, uint64_t Offset,35uint64_t Value, uint32_t Type, int64_t Addend,36uint64_t SymOffset, SID SectionID);3738private:39/// A object file specific relocation resolver40/// \param RE The relocation to be resolved41/// \param Value Target symbol address to apply the relocation action42uint64_t evaluateRelocation(const RelocationEntry &RE, uint64_t Value,43uint64_t Addend);4445/// A object file specific relocation resolver46/// \param RE The relocation to be resolved47/// \param Value Target symbol address to apply the relocation action48void applyRelocation(const RelocationEntry &RE, uint64_t Value);4950int64_t evaluateMIPS32Relocation(const SectionEntry &Section, uint64_t Offset,51uint64_t Value, uint32_t Type);52int64_t evaluateMIPS64Relocation(const SectionEntry &Section,53uint64_t Offset, uint64_t Value,54uint32_t Type, int64_t Addend,55uint64_t SymOffset, SID SectionID);5657void applyMIPSRelocation(uint8_t *TargetPtr, int64_t CalculatedValue,58uint32_t Type);5960};61}6263#undef DEBUG_TYPE6465#endif666768