Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (2)
......@@ -1472,6 +1472,8 @@ void ElfEhWriter_t<ptrsize>::GenerateEhOutput()
{
output_fde(fde,out, fde_num++);
}
out << "\t.int 0 " << asm_comment << " null terminator " << endl;
};
auto generate_gcc_except_table=[&](ostream& out) -> void
{
......
......@@ -827,16 +827,15 @@ void ZiprImpl_t::PlaceDollops()
/*
* used to check if a reference dollop needs to be added to the placement queue
*/
const auto handle_reloc=[&](const Relocation_t* reloc)
const auto ensure_insn_is_placed=[&](Instruction_t* insn)
{
auto wrt_insn=dynamic_cast<Instruction_t*>(reloc->getWRT());
if(wrt_insn)
if(insn != nullptr)
{
auto containing=m_dollop_mgr.getContainingDollop(wrt_insn);
auto containing=m_dollop_mgr.addNewDollops(insn);
assert(containing!=nullptr);
if(!containing->isPlaced())
{
placement_queue.insert({containing, wrt_insn->getAddress()->getVirtualOffset()});
placement_queue.insert({containing, insn->getAddress()->getVirtualOffset()});
}
}
};
......@@ -844,7 +843,13 @@ void ZiprImpl_t::PlaceDollops()
// Make sure each instruction referenced in a relocation (regardless
// of if that relocation is on an instruction or a scoop) gets placed.
for(const auto &reloc : m_firp->getRelocations())
handle_reloc(reloc);
ensure_insn_is_placed(dynamic_cast<Instruction_t*>(reloc->getWRT()));
// Make sure each landing pad in a program gets placed.
for(const auto &cs : m_firp->getAllEhCallSites())
ensure_insn_is_placed(cs->getLandingPad());
m_dollop_mgr.UpdateAllTargets();
while (!placement_queue.empty())
{
......
......@@ -159,11 +159,10 @@ namespace zipr {
}
}
Zipr_SDK::Dollop_t *ZiprDollopManager_t::getContainingDollop(IRDB_SDK::Instruction_t *insn) {
InsnToDollopMap_t::iterator it=m_insn_to_dollop.find(insn);
if(it!=m_insn_to_dollop.end())
return it->second;
return nullptr;
Zipr_SDK::Dollop_t *ZiprDollopManager_t::getContainingDollop(IRDB_SDK::Instruction_t *insn)
{
const auto it=m_insn_to_dollop.find(insn);
return it!=m_insn_to_dollop.end() ? it->second : nullptr;
}
......