void Stub::applyFixup(Relocation& pSrcReloc, IRBuilder& pBuilder, BranchIsland& pIsland) { // build a name for stub symbol std::string sym_name("__"); sym_name.append(pSrcReloc.symInfo()->name()) .append("_") .append(name()) .append("@") .append(pIsland.name()); // create LDSymbol for the stub LDSymbol* symbol = pBuilder.AddSymbol<IRBuilder::Force, IRBuilder::Unresolve>( sym_name, ResolveInfo::Function, ResolveInfo::Define, ResolveInfo::Local, size(), initSymValue(), FragmentRef::Create(*this, initSymValue()), ResolveInfo::Default); setSymInfo(symbol->resolveInfo()); // add relocations of this stub (i.e., set the branch target of the stub) for (fixup_iterator it = fixup_begin(), ie = fixup_end(); it != ie; ++it) { Relocation* reloc = Relocation::Create((*it)->type(), *(FragmentRef::Create(*this, (*it)->offset())), (*it)->addend()); reloc->setSymInfo(pSrcReloc.symInfo()); pIsland.addRelocation(*reloc); } }
Stub* AArch64CA53Erratum843419Stub2::doClone() { return new AArch64CA53Erratum843419Stub2(getData(), size(), "erratum_843419_veneer", fixup_begin(), fixup_end()); }
int RangeNode::SubtractVal(int val) { // Knock out one value from this node, which may involve splitting // it into two nodes, which will be silently inserted into the list. fixup_end(); if ( !(val < start || val > end || ((val-start)%step) != 0)) { if (val == start) { start += step; } else if (val == end) { end -= step; } else { // Need to split the list next = new RangeNode(next, val + step, end, step); end = val - step; } } return (n_pts() > 0); }
Stub* MipsLA25Stub::doClone() { return new MipsLA25Stub( m_Target, m_pData, m_Size, fixup_begin(), fixup_end()); }
Stub::~Stub() { for (fixup_iterator fixup = fixup_begin(); fixup != fixup_end(); ++fixup) delete (*fixup); }
Stub* ARMToTHMStub::doClone() { return new ARMToTHMStub(m_pData, m_Size, fixup_begin(), fixup_end()); }
Stub* THMToTHMStub::doClone() { return new THMToTHMStub( m_pData, m_Size, fixup_begin(), fixup_end(), m_bUsingThumb2); }