X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FLoader.h;h=c962f206119a9b67f22d11d52b9b58b806004b2e;hb=8ef435410d1f8aff339e4afef87a5757e77eba45;hp=0839ecb3d3212a946c32303f35340fff803f6355;hpb=1970312e983541d32d4ff73c81b8d90156a7bb99;p=l2e.git diff --git a/src/loader/Loader.h b/src/loader/Loader.h index 0839ecb..c962f20 100644 --- a/src/loader/Loader.h +++ b/src/loader/Loader.h @@ -4,8 +4,10 @@ #include "ObjectFile.h" #include "TypeDescription.h" +#include #include #include +#include #include namespace loader { @@ -21,6 +23,8 @@ public: const std::map &Exports() const { return exports; } + std::ostream &Dump(std::ostream &) const; + private: void LoadExports(char *src, Export *begin, Export *end); void LoadExternals(char *src, External *begin, External *end); @@ -29,12 +33,35 @@ private: void LoadObject(char *src, char *dest, const TypeDescription &); void LoadArrays(char *src, Array *begin, Array *end); + void InitObjects(Object *begin, Object *end); + void InitObject(char *object, const TypeDescription &); + void InitArrays(Array *begin, Array *end); + + struct MissingExternal { + std::string identifier; + char *dest; + int typeId; + bool inlined; + }; + void LinkExternal(const MissingExternal &, const LoadedExport &); + private: std::map objectFiles; std::map exports; std::map images; + std::vector unlinked; }; } + + +namespace std { + +inline ostream &operator <<(ostream &o, const loader::Loader &l) { + return l.Dump(o); +} + +} + #endif