[lld] r199236 - [Mips] Factor out constant represents gp value offset to the
Simon Atanasyan
simon at atanasyan.com
Tue Jan 14 10:19:26 PST 2014
Author: atanasyan
Date: Tue Jan 14 12:19:26 2014
New Revision: 199236
URL: http://llvm.org/viewvc/llvm-project?rev=199236&view=rev
Log:
[Mips] Factor out constant represents gp value offset to the
MipsTargetLayout class method.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp?rev=199236&r1=199235&r2=199236&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp Tue Jan 14 12:19:26 2014
@@ -178,7 +178,8 @@ void MipsTargetHandler::finalizeSymbolVa
assert(gpDispAtomIter != _targetLayout.absoluteAtoms().end());
_gpDispSymAtom = (*gpDispAtomIter);
_gpDispSymAtom->_virtualAddr =
- gotSection ? gotSection->virtualAddr() + 0x7FF0 : 0;
+ gotSection ? gotSection->virtualAddr() + _targetLayout.getGPOffset()
+ : 0;
}
}
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h?rev=199236&r1=199235&r2=199236&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h Tue Jan 14 12:19:26 2014
@@ -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> *
More information about the llvm-commits
mailing list