[PATCH] AArch64_BE Elf support for MC-JIT runtime dynamic linker

James Molloy james at jamesmolloy.co.uk
Tue Mar 25 08:24:26 PDT 2014


Hi Christian,

Patch LGTM.

Cheers,

James


On 25 March 2014 15:14, Christian Pirker <cpirker at a-bix.com> wrote:

> Hi all,
>
> This patch adds AArch64 big endian target support to the MC-JIT runtime
> dynamic linker.
> Please review.
>
> Thanks,
> Christian
>
>
> http://llvm-reviews.chandlerc.com/D3179
>
> Files:
>   lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
>   lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
>   lib/MC/MCObjectFileInfo.cpp
>   test/CodeGen/AArch64/pic-eh-stubs.ll
>
> Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
> ===================================================================
> --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
> +++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
> @@ -490,7 +490,7 @@
>  }
>
>  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: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> ===================================================================
> --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> +++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> @@ -844,6 +844,7 @@
>                           (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: lib/MC/MCObjectFileInfo.cpp
> ===================================================================
> --- lib/MC/MCObjectFileInfo.cpp
> +++ lib/MC/MCObjectFileInfo.cpp
> @@ -283,7 +283,8 @@
>        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: test/CodeGen/AArch64/pic-eh-stubs.ll
> ===================================================================
> --- test/CodeGen/AArch64/pic-eh-stubs.ll
> +++ test/CodeGen/AArch64/pic-eh-stubs.ll
> @@ -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
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140325/0c59a84f/attachment.html>


More information about the llvm-commits mailing list