44 lines · cpp
1//===-------------- XCOFF.cpp - JIT linker function for XCOFF -------------===//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-exception6//7//===----------------------------------------------------------------------===//8//9// XCOFF jit-link function.10//11//===----------------------------------------------------------------------===//12 13#include "llvm/ExecutionEngine/JITLink/XCOFF.h"14#include "llvm/ExecutionEngine/JITLink/XCOFF_ppc64.h"15#include "llvm/Object/XCOFFObjectFile.h"16 17using namespace llvm;18 19#define DEBUG_TYPE "jitlink"20 21namespace llvm {22namespace jitlink {23 24Expected<std::unique_ptr<LinkGraph>>25createLinkGraphFromXCOFFObject(MemoryBufferRef ObjectBuffer,26 std::shared_ptr<orc::SymbolStringPool> SSP) {27 // Check magic28 file_magic Magic = identify_magic(ObjectBuffer.getBuffer());29 if (Magic != file_magic::xcoff_object_64)30 return make_error<JITLinkError>("Invalid XCOFF 64 Header");31 32 // TODO: See if we need to add more checks33 //34 return createLinkGraphFromXCOFFObject_ppc64(ObjectBuffer, std::move(SSP));35}36 37void link_XCOFF(std::unique_ptr<LinkGraph> G,38 std::unique_ptr<JITLinkContext> Ctx) {39 link_XCOFF_ppc64(std::move(G), std::move(Ctx));40}41 42} // namespace jitlink43} // namespace llvm44