1 //===---- aarch64.cpp - Generic JITLink aarch64 edge kinds, utilities -----===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Generic utilities for graphs representing aarch64 objects. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "llvm/ExecutionEngine/JITLink/aarch64.h" 14 15 #define DEBUG_TYPE "jitlink" 16 17 namespace llvm { 18 namespace jitlink { 19 namespace aarch64 { 20 21 const uint8_t NullGOTEntryContent[8] = {0x00, 0x00, 0x00, 0x00, 22 0x00, 0x00, 0x00, 0x00}; 23 24 const uint8_t StubContent[8] = { 25 0x10, 0x00, 0x00, 0x58, // LDR x16, <literal> 26 0x00, 0x02, 0x1f, 0xd6 // BR x16 27 }; 28 29 const char *getEdgeKindName(Edge::Kind R) { 30 switch (R) { 31 case Branch26: 32 return "Branch26"; 33 case Pointer64: 34 return "Pointer64"; 35 case Pointer64Anon: 36 return "Pointer64Anon"; 37 case Page21: 38 return "Page21"; 39 case PageOffset12: 40 return "PageOffset12"; 41 case MoveWide16: 42 return "MoveWide16"; 43 case GOTPage21: 44 return "GOTPage21"; 45 case GOTPageOffset12: 46 return "GOTPageOffset12"; 47 case TLVPage21: 48 return "TLVPage21"; 49 case TLVPageOffset12: 50 return "TLVPageOffset12"; 51 case PointerToGOT: 52 return "PointerToGOT"; 53 case PairedAddend: 54 return "PairedAddend"; 55 case LDRLiteral19: 56 return "LDRLiteral19"; 57 case Delta32: 58 return "Delta32"; 59 case Delta64: 60 return "Delta64"; 61 case NegDelta32: 62 return "NegDelta32"; 63 case NegDelta64: 64 return "NegDelta64"; 65 default: 66 return getGenericEdgeKindName(static_cast<Edge::Kind>(R)); 67 } 68 } 69 70 } // namespace aarch64 71 } // namespace jitlink 72 } // namespace llvm 73