blob: ccf521eb5d0eff028f308528622fa03ab466a296 [file] [log] [blame]
//===- MipsGOTPLT.h -------------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_MIPS_GOTPLT_H
#define MCLD_MIPS_GOTPLT_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
#include <mcld/Target/GOT.h>
#include <mcld/Support/MemoryRegion.h>
#include <llvm/ADT/DenseMap.h>
namespace mcld {
class LDSection;
/** \class MipsGOTPLT
* \brief Mips .got.plt section.
*/
class MipsGOTPLT : public GOT
{
public:
MipsGOTPLT(LDSection &pSection);
// hasGOT1 - return if this section has any GOT1 entry
bool hasGOT1() const;
uint64_t getEntryAddr(size_t num) const;
uint64_t emit(MemoryRegion& pRegion);
Fragment* consume();
void applyAllGOTPLT(uint64_t pltAddr);
public:
// GOT
void reserve(size_t pNum = 1);
private:
// the last consumed entry.
SectionData::iterator m_Last;
};
} // namespace of mcld
#endif