[Mips] Factor out constant represents gp value offset to the

MipsTargetLayout class method.

llvm-svn: 199236
This commit is contained in:
Simon Atanasyan 2014-01-14 18:19:26 +00:00
parent acb301fab1
commit 0b4dd91582
2 changed files with 5 additions and 1 deletions

View File

@ -178,7 +178,8 @@ void MipsTargetHandler::finalizeSymbolValues() {
assert(gpDispAtomIter != _targetLayout.absoluteAtoms().end());
_gpDispSymAtom = (*gpDispAtomIter);
_gpDispSymAtom->_virtualAddr =
gotSection ? gotSection->virtualAddr() + 0x7FF0 : 0;
gotSection ? gotSection->virtualAddr() + _targetLayout.getGPOffset()
: 0;
}
}

View File

@ -26,6 +26,9 @@ public:
: TargetLayout<ELFType>(ctx),
_gotSection(new (_alloc) MipsGOTSection<ELFType>(ctx)) {}
/// \brief GP offset relative to .got section.
uint64_t getGPOffset() const { return 0x7FF0; }
const MipsGOTSection<ELFType> &getGOTSection() const { return *_gotSection; }
virtual AtomSection<ELFType> *