1 //===- ELFStub.h ------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===-----------------------------------------------------------------------===/
11 /// This file defines an internal representation of an ELF stub.
13 //===-----------------------------------------------------------------------===/
15 #ifndef LLVM_TEXTAPI_ELF_ELFSTUB_H
16 #define LLVM_TEXTAPI_ELF_ELFSTUB_H
18 #include "llvm/BinaryFormat/ELF.h"
19 #include "llvm/Support/VersionTuple.h"
26 typedef uint16_t ELFArch;
28 enum class ELFSymbolType {
29 NoType = ELF::STT_NOTYPE,
30 Object = ELF::STT_OBJECT,
34 // Type information is 4 bits, so 16 is safely out of range.
39 ELFSymbol(std::string SymbolName) : Name(SymbolName) {}
45 Optional<std::string> Warning;
46 bool operator<(const ELFSymbol &RHS) const {
47 return Name < RHS.Name;
51 // A cumulative representation of ELF stubs.
52 // Both textual and binary stubs will read into and write from this object.
54 // TODO: Add support for symbol versioning.
56 VersionTuple TbeVersion;
57 Optional<std::string> SoName;
59 std::vector<std::string> NeededLibs;
60 std::set<ELFSymbol> Symbols;
63 ELFStub(const ELFStub &Stub);
64 ELFStub(ELFStub &&Stub);
66 } // end namespace elfabi
67 } // end namespace llvm
69 #endif // LLVM_TEXTAPI_ELF_ELFSTUB_H