Loader::Loader(const std::string& path) : Loader(std::ifstream(path, std::ios::in | std::ios::binary)) {} Loader::Loader(std::ifstream&& fileStream) : fileStream_(std::move(fileStream)) { if (!fileStream_) { throw std::runtime_error("open file failed"); } }
接下来将实现上面所说的步骤, 首先是解析ELF文件