20 std::optional<std::string> library;
22 std::optional<std::string> name;
24 std::optional<uint16_t> hint;
43 : library(library), name(name)
52 SymbolName(std::string library, std::string name, uint16_t hint)
53 : library(library), name(name), hint(hint)
63 : library(library), hint(ordinal)
82 bool LoadName(std::string& result)
const;
102 bool GetImportedName(std::string& result_library, std::string& result_name)
const;
107 bool GetImportedName(std::string& result_library, std::string& result_name, uint16_t& result_hint)
const;
138 std::ostream& operator<<(std::ostream& out,
const SymbolName& symbol);
148 std::optional<uint16_t> ordinal;
155 : by_ordinal(false), name(name), ordinal()
165 : by_ordinal(false), name(name), ordinal(hint)
173 : by_ordinal(true), name(internal_name), ordinal(ordinal)
177 bool IsExportedByOrdinal()
const;
182 bool LoadName(std::string& result)
const;
243 std::ostream& operator<<(std::ostream& out,
const ExportedSymbolName& symbol);
Represents a symbol to be exported from the module.
Definition symbol_name.h:144
bool operator<(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:258
bool operator!=(const ExportedSymbolName &other) const
Compares two symbols for inequality.
Definition symbol_name.cc:253
ExportedSymbolName(std::string name, uint16_t hint)
Creates a symbol exported by name, with a corresponding hint.
Definition symbol_name.h:164
bool operator<=(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:276
bool operator==(const ExportedSymbolName &other) const
Compares two symbols for equality.
Definition symbol_name.cc:248
bool operator>(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:271
bool GetExportedByName(std::string &result) const
For symbols exported by name, returns the name.
Definition symbol_name.cc:189
bool LoadName(std::string &result) const
Returns the name of the symbol.
Definition symbol_name.cc:170
ExportedSymbolName(std::string name)
Creates a symbol exported by name.
Definition symbol_name.h:154
ExportedSymbolName(uint16_t ordinal, std::string internal_name)
Creates a symbol exported by ordinal, with an associated internal name.
Definition symbol_name.h:172
bool GetExportedByOrdinal(uint16_t &result) const
For symbols exported by ordinal, returns the ordinal.
Definition symbol_name.cc:219
bool LoadOrdinalOrHint(uint16_t &result) const
Returns the hint or ordinal of the symbol.
Definition symbol_name.cc:176
bool operator>=(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:266
Represents an (imported or internal) symbol name, which can be more complex than a string.
Definition symbol_name.h:18
bool GetImportedOrdinal(std::string &result_library, uint16_t &result_ordinal) const
For symbols imported by ordinal, returns the library and ordinal.
Definition symbol_name.cc:92
bool operator!=(const SymbolName &other) const
Compares two symbols for inequality.
Definition symbol_name.cc:124
SymbolName(std::string library, uint16_t ordinal)
Creates a symbol imported via ordinal, from a library.
Definition symbol_name.h:62
SymbolName(std::string name)
Creates an internal symbol with a name.
Definition symbol_name.h:34
bool GetLocalName(std::string &result) const
For local symbols, returns the name.
Definition symbol_name.cc:45
SymbolName(std::string library, LibraryMark is_library)
Creates a symbol referencing the base of an imported library.
Definition symbol_name.h:73
bool LoadName(std::string &result) const
Retrieves the name of the symbol, if it has one.
Definition symbol_name.cc:6
SymbolName(std::string library, std::string name)
Creates a symbol imported via name, from a library.
Definition symbol_name.h:42
offset_t addend
Optional value to be added to the symbol location (TODO: not yet fully implemented)
Definition symbol_name.h:29
SymbolName(std::string library, std::string name, uint16_t hint)
Creates a symbol imported via name and a hint, from a library.
Definition symbol_name.h:52
bool LoadOrdinalOrHint(uint16_t &result) const
Retrieves the ordinal of symbols imported by ordinal, or the hint for imported symbols with a hint.
Definition symbol_name.cc:32
static SymbolName GOT
Symbol representing the global offset table.
Definition symbol_name.h:132
bool LoadLibraryName(std::string &result) const
Retrieves the name of the library, if it is imported.
Definition symbol_name.cc:19
bool GetImportedName(std::string &result_library, std::string &result_name) const
For symbols imported by name, returns the library and name.
Definition symbol_name.cc:60
bool GetImportedLibrary(std::string &result_library) const
For symbols that are identified by the library name and the offset, stored in the addend.
Definition symbol_name.cc:106
bool operator==(const SymbolName &other) const
Compares two symbols for equality.
Definition symbol_name.cc:119
Definition symbol_name.h:67