Elf2Mac: don't insist that sections actually exist

This commit is contained in:
Wolfgang Thaller 2022-12-04 10:28:33 +01:00
parent b7f956111a
commit a966fd5f8a
2 changed files with 4 additions and 3 deletions

View File

@ -97,7 +97,7 @@ Object::Object(string input)
if(boost::algorithm::starts_with(name,".rela."))
{
string progbitsName = name.substr(5);
assert(sections.find(progbitsName) != sections.end());
if(sections.find(progbitsName) != sections.end())
sections[progbitsName]->SetRela(scn);
}
}

View File

@ -36,6 +36,7 @@ Symbol::Symbol(Object& theObject, const GElf_Sym &sym)
if(st_shndx != SHN_UNDEF && st_shndx < SHN_LORESERVE)
{
section = theObject.sectionsByElfIndex[st_shndx];
if (section)
sectionKind = section->kind;
}
if(st_name)