#pragma once #include #include #include #include #include "ExecSpace.h" #include "ELFImage.h" class ELFLoader { public: #ifdef SERENITY ELFLoader(ExecSpace&, ByteBuffer&&); #else ELFLoader(ExecSpace&, MappedFile&&); #endif ~ELFLoader(); bool load(); private: bool layout(); bool performRelocations(); void exportSymbols(); void* lookup(const ELFImage::Symbol&); char* areaForSection(const ELFImage::Section&); char* areaForSectionName(const char*); ExecSpace& m_execSpace; HashMap m_sections; OwnPtr m_image; };