1 //===- Stub.cpp -----------------------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #include "mcld/Fragment/Stub.h" 10 11 namespace mcld { 12 Stub()13Stub::Stub() : Fragment(Fragment::Stub), m_pSymInfo(NULL) { 14 } 15 ~Stub()16Stub::~Stub() { 17 for (fixup_iterator fixup = fixup_begin(); fixup != fixup_end(); ++fixup) 18 delete (*fixup); 19 } 20 setSymInfo(ResolveInfo * pSymInfo)21void Stub::setSymInfo(ResolveInfo* pSymInfo) { 22 m_pSymInfo = pSymInfo; 23 } 24 addFixup(DWord pOffset,SWord pAddend,Type pType)25void Stub::addFixup(DWord pOffset, SWord pAddend, Type pType) { 26 assert(pOffset < size()); 27 m_FixupList.push_back(new Fixup(pOffset, pAddend, pType)); 28 } 29 addFixup(const Fixup & pFixup)30void Stub::addFixup(const Fixup& pFixup) { 31 assert(pFixup.offset() < size()); 32 m_FixupList.push_back(new Fixup(pFixup)); 33 } 34 35 } // namespace mcld 36