This is an archive of the discontinued LLVM Phabricator instance.

[elf] Remove one copy of the section merging code
ClosedPublic

Authored by labath on Mar 6 2018, 8:44 AM.

Details

Summary

Besides being superfluous, this double merging was actually wrong and
causing some sections to be added twice. The reason for that was that
the code assumes sectoin IDs are unique in the section list, but this is
only true if all sections in the list come from the same object file.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Mar 6 2018, 8:44 AM
jankratochvil accepted this revision.Mar 8 2018, 9:36 AM

Yes, it should be the same I think; some notes of mine:

Module::GetSectionList()->obj_file->CreateSections(*GetUnifiedSectionList());
        Module::GetUnifiedSectionList()->Module::m_sections_ap.get();

ObjectFileELF::CreateSections()->removal
        ObjectFileELF::m_sections_ap.get() ---> Module::m_sections_ap.get();

SymbolVendorELF::CreateInstance()
        ObjectFileSP dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
        SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
        dsym_objfile_sp->GetSectionList(); ---> module_sp->GetSectionList();
This revision is now accepted and ready to land.Mar 8 2018, 9:36 AM
This revision was automatically updated to reflect the committed changes.