LLVM: lib/ExecutionEngine/JITLink/ELF.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
14
25#include
26
27using namespace llvm;
28
29#define DEBUG_TYPE "jitlink"
30
31namespace llvm {
33
35 const char *Data = Buffer.data();
36
40 return File->getHeader().e_machine;
41 } else {
42 return File.takeError();
43 }
46 return File->getHeader().e_machine;
47 } else {
48 return File.takeError();
49 }
50 }
51 }
52
56 return File->getHeader().e_machine;
57 } else {
58 return File.takeError();
59 }
62 return File->getHeader().e_machine;
63 } else {
64 return File.takeError();
65 }
66 }
67 }
68
70}
71
74 std::shared_ptrorc::SymbolStringPool SSP) {
78
81
84 if (!TargetMachineArch)
85 return TargetMachineArch.takeError();
86
87 switch (*TargetMachineArch) {
95 else
97 }
108 default:
110 "Unsupported target machine architecture in ELF object " +
112 }
113}
114
116 std::unique_ptr Ctx) {
117 switch (G->getTargetTriple().getArch()) {
120 return;
126 return;
130 return;
133 return;
136 return;
140 return;
143 return;
146 return;
149 return;
150 default:
152 "Unsupported target machine architecture in ELF link graph " +
153 G->getName()));
154 return;
155 }
156}
157
158}
159}
Merge contiguous icmps into a memcmp
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
StringRef getBufferIdentifier() const
StringRef getBuffer() const
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - 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[]
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_riscv(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/riscv relocatable object.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF relocatable object.
Definition ELF.cpp:73
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_x86(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/x86 relocatable object.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_aarch32(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/arm relocatable object.
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.
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.
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.
void link_ELF(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
Link the given graph.
Definition ELF.cpp:115
void link_ELF_aarch64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF aarch64 relocatable object file.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_loongarch(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/loongarch relocatable object.
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.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_aarch64(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/aarch64 relocatable object.
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)
Definition ELF.cpp:34
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.
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.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_ppc64le(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/ppc64le relocatable object.
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.
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.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_systemz(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an ELF/systemz relocatable object.
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.
FunctionAddr VTableAddr uintptr_t uintptr_t Data