[llvm] r192737 - Separating ELF and MachO stub info functions for RuntimeDyld
Andrew Kaylor
andrew.kaylor at intel.com
Tue Oct 15 14:32:56 PDT 2013
Author: akaylor
Date: Tue Oct 15 16:32:56 2013
New Revision: 192737
URL: http://llvm.org/viewvc/llvm-project?rev=192737&view=rev
Log:
Separating ELF and MachO stub info functions for RuntimeDyld
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h?rev=192737&r1=192736&r2=192737&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h Tue Oct 15 16:32:56 2013
@@ -82,6 +82,30 @@ class RuntimeDyldELF : public RuntimeDyl
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,
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h?rev=192737&r1=192736&r2=192737&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h Tue Oct 15 16:32:56 2013
@@ -186,29 +186,8 @@ protected:
Triple::ArchType Arch;
bool IsTargetLittleEndian;
- inline 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;
- }
-
- inline unsigned getStubAlignment() {
- if (Arch == Triple::systemz)
- return 8;
- else
- return 1;
- }
+ virtual unsigned getMaxStubSize() = 0;
+ virtual unsigned getStubAlignment() = 0;
bool HasError;
std::string ErrorStr;
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h?rev=192737&r1=192736&r2=192737&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h Tue Oct 15 16:32:56 2013
@@ -55,6 +55,19 @@ class RuntimeDyldMachO : public RuntimeD
bool isPCRel,
unsigned Size);
+ unsigned getMaxStubSize() {
+ if (Arch == Triple::arm || Arch == Triple::thumb)
+ return 8; // 32-bit instruction and 32-bit address
+ else if (Arch == Triple::x86_64)
+ return 8; // GOT entry
+ else
+ return 0;
+ }
+
+ unsigned getStubAlignment() {
+ return 1;
+ }
+
struct EHFrameRelatedSections {
EHFrameRelatedSections() : EHFrameSID(RTDYLD_INVALID_SECTION_ID),
TextSID(RTDYLD_INVALID_SECTION_ID),
More information about the llvm-commits
mailing list