retdec
relocation_table.h
Go to the documentation of this file.
1 
7 #ifndef FILEINFO_FILE_INFORMATION_FILE_INFORMATION_TYPES_RELOCATION_TABLE_RELOCATION_TABLE_H
8 #define FILEINFO_FILE_INFORMATION_FILE_INFORMATION_TYPES_RELOCATION_TABLE_RELOCATION_TABLE_H
9 
10 #include <vector>
11 
13 
14 namespace retdec {
15 namespace fileinfo {
16 
24 {
25  private:
26  std::string name;
28  std::string appliesSectionName;
29  unsigned long long associatedSymbolTableIndex = std::numeric_limits<unsigned long long>::max();
30  unsigned long long appliesSectionIndex = std::numeric_limits<unsigned long long>::max();
31  unsigned long long declaredRelocations = std::numeric_limits<unsigned long long>::max();
32  std::vector<Relocation> table;
33  public:
36  std::size_t getNumberOfStoredRelocations() const;
37  std::string getNumberOfStoredRelocationsStr() const;
38  std::string getNumberOfDeclaredRelocationsStr() const;
39  std::string getTableName() const;
40  std::string getAssociatedSymbolTableName() const;
41  std::string getAppliesSectionName() const;
42  std::string getAssociatedSymbolTableIndex() const;
43  std::string getAppliesSectionIndex() const;
44  std::string getRelocationSymbolName(std::size_t position) const;
45  std::string getRelocationOffsetStr(std::size_t position, std::ios_base &(* format)(std::ios_base &)) const;
46  std::string getRelocationSymbolValueStr(std::size_t position) const;
47  std::string getRelocationTypeStr(std::size_t position) const;
48  std::string getRelocationAddendStr(std::size_t position) const;
49  std::string getRelocationCalculatedValueStr(std::size_t position) const;
51 
54  void setTableName(std::string tableName);
55  void setAssociatedSymbolTableName(std::string symbolTableName);
56  void setAppliesSectionName(std::string sectionName);
57  void setAssociatedSymbolTableIndex(unsigned long long index);
58  void setAppliesSectionIndex(unsigned long long index);
59  void setNumberOfDeclaredRelocations(unsigned long long relocations);
61 
64  void addRelocation(Relocation &relocation);
65  void clearRelocations();
67 };
68 
69 } // namespace fileinfo
70 } // namespace retdec
71 
72 #endif
Definition: relocation_table.h:24
std::string associatedSymbolTableName
name of symbol table associated with relocation table
Definition: relocation_table.h:27
void setAssociatedSymbolTableName(std::string symbolTableName)
Definition: relocation_table.cpp:165
unsigned long long associatedSymbolTableIndex
index of symbol table associated with relocation table
Definition: relocation_table.h:29
std::string appliesSectionName
name of section to which the relocation applies
Definition: relocation_table.h:28
unsigned long long appliesSectionIndex
index of section to which the relocation applies
Definition: relocation_table.h:30
void setNumberOfDeclaredRelocations(unsigned long long relocations)
Definition: relocation_table.cpp:201
std::string getNumberOfStoredRelocationsStr() const
Definition: relocation_table.cpp:29
std::string getRelocationCalculatedValueStr(std::size_t position) const
Definition: relocation_table.cpp:147
void clearRelocations()
Definition: relocation_table.cpp:218
std::string getRelocationAddendStr(std::size_t position) const
Definition: relocation_table.cpp:137
void addRelocation(Relocation &relocation)
Definition: relocation_table.cpp:210
std::string getRelocationSymbolName(std::size_t position) const
Definition: relocation_table.cpp:96
void setTableName(std::string tableName)
Definition: relocation_table.cpp:156
std::size_t getNumberOfStoredRelocations() const
Definition: relocation_table.cpp:20
std::string getAssociatedSymbolTableName() const
Definition: relocation_table.cpp:59
std::string getRelocationTypeStr(std::size_t position) const
Definition: relocation_table.cpp:127
void setAppliesSectionIndex(unsigned long long index)
Definition: relocation_table.cpp:192
std::string getRelocationOffsetStr(std::size_t position, std::ios_base &(*format)(std::ios_base &)) const
Definition: relocation_table.cpp:107
std::string name
name of relocation table
Definition: relocation_table.h:26
std::string getAssociatedSymbolTableIndex() const
Definition: relocation_table.cpp:77
std::string getAppliesSectionName() const
Definition: relocation_table.cpp:68
unsigned long long declaredRelocations
declared number of relocations in table
Definition: relocation_table.h:31
std::string getAppliesSectionIndex() const
Definition: relocation_table.cpp:86
void setAppliesSectionName(std::string sectionName)
Definition: relocation_table.cpp:174
void setAssociatedSymbolTableIndex(unsigned long long index)
Definition: relocation_table.cpp:183
std::string getTableName() const
Definition: relocation_table.cpp:50
std::string getRelocationSymbolValueStr(std::size_t position) const
Definition: relocation_table.cpp:117
std::vector< Relocation > table
relocation entries
Definition: relocation_table.h:32
std::string getNumberOfDeclaredRelocationsStr() const
Definition: relocation_table.cpp:41
Definition: relocation.h:23
Definition: archive_wrapper.h:19
Class for one relocation.