AArch64_BE Elf support for MC-JIT runtime dynamic linker
authorChristian Pirker <cpirker@a-bix.com>
Wed, 26 Mar 2014 14:57:32 +0000 (14:57 +0000)
committerChristian Pirker <cpirker@a-bix.com>
Wed, 26 Mar 2014 14:57:32 +0000 (14:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204816 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
lib/MC/MCObjectFileInfo.cpp
test/CodeGen/AArch64/pic-eh-stubs.ll

index b28a312f74e8f728ddcdf3a53ec239ce8dc7a191..7f35083748269f5388d298dca1ea9e62d4812e09 100644 (file)
@@ -490,7 +490,7 @@ void RuntimeDyldImpl::addRelocationForSymbol(const RelocationEntry &RE,
 }
 
 uint8_t *RuntimeDyldImpl::createStubFunction(uint8_t *Addr) {
-  if (Arch == Triple::aarch64) {
+  if (Arch == Triple::aarch64 || Arch == Triple::aarch64_be) {
     // This stub has to be able to access the full address space,
     // since symbol lookup won't necessarily find a handy, in-range,
     // PLT stub for functions which could be anywhere.
index 861c9beb1ed7b342b4ca7bcc78e6b61154c04050..3b400690eb7d68d0e03cd3b683826629c962c9c9 100644 (file)
@@ -844,6 +844,7 @@ void RuntimeDyldELF::resolveRelocation(const SectionEntry &Section,
                          (uint32_t)(Addend & 0xffffffffL));
     break;
   case Triple::aarch64:
+  case Triple::aarch64_be:
     resolveAArch64Relocation(Section, Offset, Value, Type, Addend);
     break;
   case Triple::arm: // Fall through.
index 879aa8035b2e0e334691dee9e352ecd20debf268..c27b88b96897241d6b99bec950a993bd9b54eb1f 100644 (file)
@@ -283,7 +283,8 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
       TTypeEncoding = (CMModel == CodeModel::Small)
         ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
     }
-  }  else if (T.getArch() ==  Triple::aarch64) {
+  }  else if (T.getArch() == Triple::aarch64 ||
+              T.getArch() == Triple::aarch64_be ) {
     // The small model guarantees static code/data size < 4GB, but not where it
     // will be in memory. Most of these could end up >2GB away so even a signed
     // pc-relative 32-bit address is insufficient, theoretically.
index c87b2e7284257772e778901109b3a0504e172658..3404d3f919d58e0b9b209714cdbe5ab44c46cfe5 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llc -mtriple=aarch64-none-linux-gnu -relocation-model=pic -o - %s | FileCheck %s
+; RUN: llc -mtriple=aarch64_be-none-linux-gnu -relocation-model=pic -o - %s | FileCheck %s
 
 ; Make sure exception-handling PIC code can be linked correctly. An alternative
 ; to the sequence described below would have .gcc_except_table itself writable