From 72be32c6332ff9dd38b989d5a0dd80f40996dd10 Mon Sep 17 00:00:00 2001 From: Andrew Kaylor Date: Tue, 15 Oct 2013 21:32:56 +0000 Subject: Separating ELF and MachO stub info functions for RuntimeDyld git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192737 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h') diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h index ab6b8bdaf3..058078b0f3 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h @@ -82,6 +82,30 @@ class RuntimeDyldELF : public RuntimeDyldImpl { uint32_t Type, int64_t Addend); + unsigned getMaxStubSize() { + if (Arch == Triple::aarch64) + return 20; // movz; movk; movk; movk; br + if (Arch == Triple::arm || Arch == Triple::thumb) + return 8; // 32-bit instruction and 32-bit address + else if (Arch == Triple::mipsel || Arch == Triple::mips) + return 16; + else if (Arch == Triple::ppc64 || Arch == Triple::ppc64le) + return 44; + else if (Arch == Triple::x86_64) + return 6; // 2-byte jmp instruction + 32-bit relative address + else if (Arch == Triple::systemz) + return 16; + else + return 0; + } + + unsigned getStubAlignment() { + if (Arch == Triple::systemz) + return 8; + else + return 1; + } + uint64_t findPPC64TOC() const; void findOPDEntrySection(ObjectImage &Obj, ObjSectionToIDMap &LocalSections, -- cgit v1.2.3