retdec
relocation_table.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_FILEFORMAT_TYPES_RELOCATION_TABLE_RELOCATION_TABLE_H
8 #define RETDEC_FILEFORMAT_TYPES_RELOCATION_TABLE_RELOCATION_TABLE_H
9 
10 #include <vector>
11 
13 
14 namespace retdec {
15 namespace fileformat {
16 
21 {
22  private:
23  using relocationsIterator = std::vector<Relocation>::const_iterator;
24  std::vector<Relocation> table;
25  unsigned long long linkToSymbolTable;
26  public:
29  std::size_t getNumberOfRelocations() const;
30  const Relocation* getRelocation(std::size_t relocationIndex) const;
31  const Relocation* getRelocation(const std::string &name) const;
32  const Relocation* getRelocationOnAddress(unsigned long long addr) const;
33  unsigned long long getLinkToSymbolTable() const;
35 
38  void setLinkToSymbolTable(std::uint64_t symbolTableIndex);
40 
43  relocationsIterator begin() const;
44  relocationsIterator end() const;
46 
49  void clear();
50  void addRelocation(Relocation &relocation);
51  bool hasRelocations() const;
52  bool hasRelocation(const std::string &name) const;
53  bool hasRelocation(unsigned long long addr) const;
54  void dump(std::string &dumpTable) const;
56 };
57 
58 } // namespace fileformat
59 } // namespace retdec
60 
61 #endif
Definition: relocation_table.h:21
std::vector< Relocation > table
stored relocations
Definition: relocation_table.h:24
void addRelocation(Relocation &relocation)
Definition: relocation_table.cpp:118
relocationsIterator end() const
Definition: relocation_table.cpp:101
const Relocation * getRelocation(std::size_t relocationIndex) const
Definition: relocation_table.cpp:29
std::vector< Relocation >::const_iterator relocationsIterator
Definition: relocation_table.h:23
void clear()
Definition: relocation_table.cpp:109
unsigned long long getLinkToSymbolTable() const
Definition: relocation_table.cpp:74
bool hasRelocations() const
Definition: relocation_table.cpp:127
relocationsIterator begin() const
Definition: relocation_table.cpp:92
bool hasRelocation(const std::string &name) const
Definition: relocation_table.cpp:137
const Relocation * getRelocationOnAddress(unsigned long long addr) const
Definition: relocation_table.cpp:57
void setLinkToSymbolTable(std::uint64_t symbolTableIndex)
Definition: relocation_table.cpp:83
std::size_t getNumberOfRelocations() const
Definition: relocation_table.cpp:19
unsigned long long linkToSymbolTable
link to associated symbol table
Definition: relocation_table.h:25
void dump(std::string &dumpTable) const
Definition: relocation_table.cpp:156
Definition: relocation.h:20
Class for one relocation.
Definition: archive_wrapper.h:19