Skip to content

Commit

Permalink
Use FE query to add relocations for TR_HelperAddress (#4454)
Browse files Browse the repository at this point in the history
Use FE query to add relocations for TR_HelperAddress
  • Loading branch information
fjeremic authored Oct 31, 2019
2 parents ad3f01b + 464c81d commit b28a393
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions compiler/codegen/OMRCodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,10 @@ class OMR_EXTENSIBLE CodeGenerator
bool needRelocationsForBodyInfoData() { return false; }
bool needRelocationsForPersistentInfoData() { return false; }

// This query can be used if we need to decide whether data represented by TR_HelperAddress or TR_AbsoluteHelperAddress
// relocation type needs a relocation record.
bool needRelocationsForHelpers() { return false; }

// --------------------------------------------------------------------------
// Snippets
//
Expand Down
2 changes: 1 addition & 1 deletion compiler/x/codegen/X86BinaryEncoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,7 @@ TR::AMD64RegImm64Instruction::addMetaDataForCodeAddress(uint8_t *cursor)
TR::SymbolReference *methodSymRef = getNode()->getOpCode().hasSymbolReference()?getNode()->getSymbolReference():NULL;

#ifdef J9_PROJECT_SPECIFIC
if (comp->fej9()->helpersNeedRelocation())
if (cg()->needRelocationsForHelpers())
{
if (getNode()->getOpCode().hasSymbolReference() &&
methodSymRef &&
Expand Down
2 changes: 1 addition & 1 deletion compiler/z/codegen/OpMemToMem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ MemToMemVarLenMacroOp::generateLoop()
_raReg = _cg->allocateRegister();

//use literal for aot to make it easier for relocation
if (comp->compileRelocatableCode())
if (_cg->needRelocationsForHelpers())
{
generateRegLitRefInstruction(_cg, TR::InstOpCode::getLoadOpCode(), _rootNode, _raReg, (uintptrj_t)getHelperSymRef(), TR_HelperAddress, NULL, NULL, NULL);
}
Expand Down

0 comments on commit b28a393

Please sign in to comment.