summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-05-26 08:32:38 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-05-26 08:32:38 +0000
commite145a7da87d6be3e0ebc571d2bfaaaab66a37203 (patch)
tree8dec881c334474a74d4c3cf1086e0a89bb1a365d
parentba1b6bb667df50c54d903b815e5ba26118231d27 (diff)
downloadbcm5719-llvm-e145a7da87d6be3e0ebc571d2bfaaaab66a37203.tar.gz
bcm5719-llvm-e145a7da87d6be3e0ebc571d2bfaaaab66a37203.zip
[Mips] Do not count global GOT entries using the separate variable. Use
size of global GOT entries map for that. llvm-svn: 209616
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h b/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
index a3fecc0da2d..a8ae8b3d11d 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
@@ -21,19 +21,18 @@ public:
MipsGOTSection(const MipsLinkingContext &context)
: AtomSection<ELFType>(context, ".got", DefinedAtom::typeGOT,
DefinedAtom::permRW_,
- MipsTargetLayout<ELFType>::ORDER_GOT),
- _globalCount(0) {
+ MipsTargetLayout<ELFType>::ORDER_GOT) {
this->_flags |= SHF_MIPS_GPREL;
this->_align2 = 4;
}
/// \brief Number of local GOT entries.
std::size_t getLocalCount() const {
- return this->_atoms.size() - _globalCount;
+ return this->_atoms.size() - getGlobalCount();
}
/// \brief Number of global GOT entries.
- std::size_t getGlobalCount() const { return _globalCount; }
+ std::size_t getGlobalCount() const { return _posMap.size(); }
/// \brief Does the atom have a global GOT entry?
bool hasGlobalGOTEntry(const Atom *a) const { return _posMap.count(a); }
@@ -63,18 +62,13 @@ public:
}
}
- if (ta) {
+ if (ta)
_posMap[ta] = _posMap.size();
- ++_globalCount;
- }
return AtomSection<ELFType>::appendAtom(atom);
}
private:
- /// \brief Number of global GOT entries.
- std::size_t _globalCount;
-
/// \brief Map Atoms to their GOT entry index.
llvm::DenseMap<const Atom *, std::size_t> _posMap;
};
OpenPOWER on IntegriCloud