mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
Make loading /bin/bash ~250x faster.
The ELF loader was doing huge amounts of unnecessary work. Got rid of the "export symbols" and relocation passes since we don't need them. They were useful things when bringing up the ELF loading code. Also added a simple TSC-based Stopwatch RAII thingy to help debug performance issues.
This commit is contained in:
parent
1cf20a2fe2
commit
dea474dfd5
5 changed files with 81 additions and 40 deletions
|
@ -107,11 +107,13 @@ bool ELFImage::parse()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef SUPPORT_RELOCATIONS
|
||||
// Then create a name-to-index map.
|
||||
for (unsigned i = 0; i < section_count(); ++i) {
|
||||
auto& section = this->section(i);
|
||||
m_sections.set(section.name(), move(i));
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -172,6 +174,7 @@ const ELFImage::ProgramHeader ELFImage::program_header(unsigned index) const
|
|||
return ProgramHeader(*this, index);
|
||||
}
|
||||
|
||||
#ifdef SUPPORT_RELOCATIONS
|
||||
const ELFImage::Relocation ELFImage::RelocationSection::relocation(unsigned index) const
|
||||
{
|
||||
ASSERT(index < relocation_count());
|
||||
|
@ -204,4 +207,5 @@ const ELFImage::Section ELFImage::lookupSection(const char* name) const
|
|||
return section((*it).value);
|
||||
return section(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue