ladybird/Userland/Libraries/LibELF/DynamicLinker.h
Dan Klishch b0b1817b06 LibELF: Make orders in which we store/call things explicit
While on it, add a few spec links and remove needless conversions
between DynamicLoader objects and their respective filesystem paths.
2024-05-08 09:53:58 -06:00

29 lines
697 B
C++

/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Result.h>
#include <AK/Vector.h>
#include <LibELF/DynamicObject.h>
namespace ELF {
using EntryPointFunction = int (*)(int, char**, char**);
class DynamicLinker {
public:
static Optional<DynamicObject::SymbolLookupResult> lookup_global_symbol(StringView symbol);
static EntryPointFunction linker_main(ByteString&& main_program_path, int fd, bool is_secure, char** envp);
static Optional<ByteString> resolve_library(ByteString const& name, DynamicObject const& parent_object);
private:
DynamicLinker() = delete;
~DynamicLinker() = delete;
};
}