31#define DEBUG_TYPE "jitlink"
42 return File->getHeader().e_machine;
44 return File.takeError();
48 return File->getHeader().e_machine;
50 return File.takeError();
58 return File->getHeader().e_machine;
60 return File.takeError();
64 return File->getHeader().e_machine;
66 return File.takeError();
76 std::shared_ptr<orc::SymbolStringPool> SSP) {
86 if (!TargetMachineArch)
89 switch (*TargetMachineArch) {
121 "Unsupported target machine architecture in ELF object " +
127 std::unique_ptr<JITLinkContext> Ctx) {
128 switch (
G->getTargetTriple().getArch()) {
175 "Unsupported target machine architecture in ELF link graph " +
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
StringRef getBufferIdentifier() const
StringRef getBuffer() const
Represent a constant reference to a string, i.e.
constexpr size_t size() const
Get the string size.
constexpr const char * data() const
Get a pointer to the start of the string (which may not be null terminated).
static Expected< ELFFile > create(StringRef Object)
static const char ElfMagic[]
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_riscv(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/riscv relocatable object.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF relocatable object.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_hexagon(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/Hexagon relocatable object.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_x86(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/x86 relocatable object.
LLVM_ABI void link_ELF_aarch64_be(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be an ELF aarch64_be (BE8) relocatable object file.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_aarch32(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/arm relocatable object.
LLVM_ABI void link_ELF_ppc64le(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF ppc64le object file.
LLVM_ABI void link_ELF_systemz(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF systemz relocatable object file.
LLVM_ABI void link_ELF_mips(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
JIT-link an ELF/MIPS graph.
LLVM_ABI void link_ELF_x86(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF x86 relocatable object file.
LLVM_ABI void link_ELF(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
Link the given graph.
LLVM_ABI void link_ELF_hexagon(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF Hexagon relocatable object file.
LLVM_ABI void link_ELF_aarch64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be an ELF aarch64 (little-endian) relocatable object fil...
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_aarch64_be(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/aarch64_be (BE8) relocatable object.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_mips(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an O32, N32, or N64 ELF/MIPS relocatable object.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_loongarch(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/loongarch relocatable object.
LLVM_ABI void link_ELF_ppc64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF ppc64le object file.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_aarch64(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/aarch64 (little-endian) relocatable object.
LLVM_ABI void link_ELF_riscv(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF riscv object file.
Expected< uint16_t > readTargetMachineArch(StringRef Buffer)
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_x86_64(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/x86-64 relocatable object.
LLVM_ABI void link_ELF_x86_64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF x86-64 object file.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_ppc64le(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/ppc64le relocatable object.
LLVM_ABI void link_ELF_loongarch(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be an ELF loongarch object file.
LLVM_ABI void link_ELF_aarch32(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be an ELF arm/thumb object file.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_systemz(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/systemz relocatable object.
LLVM_ABI Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_ppc64(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/ppc64 relocatable object.
This is an optimization pass for GlobalISel generic memory operations.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.