Home | History | Annotate | Download | only in LD

Lines Matching refs:stub

15 #include <mcld/Fragment/Stub.h>
33 /// addPrototype - register a stub prototype
34 void StubFactory::addPrototype(Stub* pPrototype)
39 /// create - create a stub if needed, otherwise return NULL
40 Stub* StubFactory::create(Relocation& pReloc,
45 // find if there is a prototype stub for the input relocation
46 Stub* prototype = findPrototype(pReloc,
56 // find if there is such a stub in the island already
58 Stub* stub = island->findStub(prototype, pReloc);
59 if (NULL != stub) {
60 // reset the branch target to the stub instead!
61 pReloc.setSymInfo(stub->symInfo());
64 // create a stub from the prototype
65 stub = prototype->clone();
67 // build a name for stub symbol
71 name.append(stub->name());
75 // create LDSymbol for the stub
82 stub->size(), // size
83 stub->initSymValue(), // value
84 FragmentRef::Create(*stub, stub->initSymValue()),
86 stub->setSymInfo(symbol->resolveInfo());
88 // add relocations of this stub (i.e., set the branch target of the stub)
89 for (Stub::fixup_iterator it = stub->fixup_begin(),
90 ie = stub->fixup_end(); it != ie; ++it) {
93 *(FragmentRef::Create(*stub, (*it)->offset())),
99 // add stub to the branch island
100 island->addStub(prototype, pReloc, *stub);
102 // reset the branch target of the input reloc to this stub instead!
103 pReloc.setSymInfo(stub->symInfo());
104 return stub;
110 /// findPrototype - find if there is a registered stub prototype for the given
112 Stub* StubFactory::findPrototype(const Relocation& pReloc,