Skip to content

Commit

Permalink
Stubs for fixing PPC binaries without OPD sections
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwilliams committed Nov 17, 2016
1 parent 116fccd commit f2c3983
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions parseAPI/src/IA_powerDetails.C
Expand Up @@ -514,12 +514,8 @@ bool IA_powerDetails::parseJumpTable(Block* currBlk,
patternIter = currentBlock->curInsnIter;
patternIter--;
RegisterAST::Ptr jumpAddrReg;
static RegisterAST::Ptr linkReg(new RegisterAST(ppc32::lr));
static RegisterAST::Ptr countReg(new RegisterAST(ppc32::ctr));
std::set<RegisterAST::Ptr> regs;
if(patternIter->second->getOperation().getID() == power_op_mtspr &&
(patternIter->second->isWritten(linkReg) ||
patternIter->second->isWritten(countReg)))
if(patternIter->second->getOperation().getID() == power_op_mtspr)
{
regs.clear();
patternIter->second->getReadSet(regs);
Expand Down
6 changes: 5 additions & 1 deletion symtabAPI/src/Object-elf.C
Expand Up @@ -1669,7 +1669,9 @@ void Object::load_object(bool alloc_syms)

if (opd_scnp) {
parse_opd(opd_scnp);
}
} else if (got_scnp) {
// Add a single global TOC value...
}

return;
} // end binding contour (for "goto cleanup2")
Expand Down Expand Up @@ -1965,6 +1967,7 @@ void Object::parse_opd(Elf_X_Shdr *opd_hdr) {
// special location 0 and only record differences.
Offset baseTOC = buf[1];
TOC_table_[0] = baseTOC;
create_printf("Set base TOC to %p\n", baseTOC);

// Note the lack of 32/64 here: okay because the only platform with an OPD
// is 64-bit elf.
Expand All @@ -1982,6 +1985,7 @@ void Object::parse_opd(Elf_X_Shdr *opd_hdr) {

if (toc != baseTOC) {
TOC_table_[func] = toc;
create_printf("Set TOC for %p to %p\n", func, toc);
}
i += 2;
}
Expand Down

0 comments on commit f2c3983

Please sign in to comment.