@@ -41,6 +41,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4141#include " Gen4_IR.hpp"
4242
4343#include " include/gtpin_IGC_interface.h"
44+ #include " inc/common/RelocationInfo.h"
4445
4546namespace vISA
4647{
@@ -1187,15 +1188,11 @@ class gtPinData
11871188 gtpin::igc::igc_init_t * gtpin_init = nullptr ;
11881189};
11891190
1190- enum class RelocationType
1191- {
1192- R_SYM_ADDR // patched value is the address of a symbol
1193- };
1194-
11951191class RelocationEntry
11961192{
11971193 G4_INST* inst; // instruction to be relocated
11981194 int opndPos; // operand to be relocated. This should be a RelocImm
1195+ typedef IGC::GenRelocType RelocationType;
11991196 RelocationType relocType;
12001197 std::string symName; // the symbol name that it's address to be resolved
12011198
@@ -1284,8 +1281,13 @@ class G4_Kernel
12841281
12851282 bool m_hasIndirectCall = false ;
12861283
1284+ public:
1285+ typedef std::vector<RelocationEntry> RelocationTableTy;
1286+
1287+ private:
12871288 // stores all relocations to be performed after binary encoding
1288- std::vector<RelocationEntry> relocationTable;
1289+ RelocationTableTy relocationTable;
1290+
12891291
12901292 // id -> function map for all functions (transitively) called by this kernel
12911293 // this differs from the "callees" in IR_Builder as the one in builder only contain
@@ -1469,6 +1471,16 @@ class G4_Kernel
14691471 relocationTable.push_back (entry);
14701472 }
14711473
1474+ RelocationTableTy& getRelocationTable ()
1475+ {
1476+ return relocationTable;
1477+ }
1478+
1479+ const RelocationTableTy& getRelocationTable () const
1480+ {
1481+ return relocationTable;
1482+ }
1483+
14721484 void doRelocation (void * binary, uint32_t binarySize);
14731485
14741486 void addCallee (uint32_t funcId, G4_Kernel* function) { allCallees.emplace (funcId, function); }
0 commit comments