commit
bba5c8a39a
109 files changed
+14085
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#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
|
||||
Reference in new issue
Block a user