Bug 982014 - Fix what sections are copied from injection object after bug 932737. r=nfroyd

This commit is contained in:
Mike Hommey 2014-04-04 14:56:36 +09:00
parent 0cd8749fc6
commit 275cb98921

View File

@ -196,6 +196,11 @@ private:
void add_code_section(ElfSection *section)
{
if (section) {
/* Don't add section if it's already been added in the past */
for (auto s = code.begin(); s != code.end(); ++s) {
if (section == *s)
return;
}
code.push_back(section);
find_code(section);
}
@ -224,13 +229,6 @@ private:
ElfSymtab_Section *symtab = (ElfSymtab_Section *)rel->getLink();
for (auto r = rel->rels.begin(); r != rel->rels.end(); r++) {
ElfSection *section = symtab->syms[ELF32_R_SYM(r->r_info)].value.getSection();
if (section) {
for (ElfSection *s = elf->getSection(1); s != nullptr; s = s->getNext()) {
if (section == s)
section = nullptr;
break;
}
}
add_code_section(section);
}
}