Files
faumaray bba5c8a39a initial commit
Signed-off-by: Aleksey Selihov <faumaray@gmail.com>
2026-05-22 02:40:32 +03:00

26 lines
777 B
C++

#pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace voidlibc::loader::linux_handoff {
struct LoadResult {
void* dl_handle = nullptr; // opaque handle from dlopen
std::string error; // empty on success
bool ok = false;
};
// Take a synthesized ELF DSO buffer, place it in a memfd (or fallback
// temp file), and dlopen it. Returns the raw dlopen handle. Callers
// own it and must dlclose() it.
LoadResult dlopen_buffer(const std::vector<std::uint8_t>& elf_bytes,
const char* debug_name = "voidlibc.elf");
// Thin wrappers so the caller never includes <dlfcn.h>.
void* sym(void* handle, const char* name);
int close_(void* handle);
} // namespace voidlibc::loader::linux_handoff