Home | History | Annotate | Download | only in LD

Lines Matching refs:Stub

14 #include "mcld/Fragment/Stub.h"
34 /// addPrototype - register a stub prototype
35 void StubFactory::addPrototype(Stub* pPrototype) {
39 /// create - create a stub if needed, otherwise return NULL
40 Stub* StubFactory::create(Relocation& pReloc,
44 // find if there is a prototype stub for the input relocation
45 Stub* stub = NULL;
46 Stub* prototype = findPrototype(pReloc, pReloc.place(), pTargetSymValue);
57 // find if there is such a stub in the backward island first.
59 stub = islands.second->findStub(prototype, pReloc);
62 if (stub == NULL) {
63 // find if there is such a stub in the forward island.
64 stub = islands.first->findStub(prototype, pReloc);
65 if (stub == NULL) {
66 // create a stub from the prototype
67 stub = prototype->clone();
69 // apply fixups in this new stub
70 stub->applyFixup(pReloc, pBuilder, *islands.first);
72 // add stub to the forward branch island
73 islands.first->addStub(prototype, pReloc, *stub);
77 return stub;
80 Stub* StubFactory::create(FragmentRef& pFragRef,
83 Stub* prototype = findPrototype(pFragRef);
93 // create a stub from the prototype
94 Stub* stub = prototype->clone();
96 // apply fixups in this new stub
97 stub->applyFixup(pFragRef, pBuilder, *islands.first);
99 // add stub to the forward branch island
100 islands.first->addStub(*stub);
102 return stub;
107 /// findPrototype - find if there is a registered stub prototype for the given
109 Stub* StubFactory::findPrototype(const Relocation& pReloc,
120 Stub* StubFactory::findPrototype(const FragmentRef& pFragRef) const {