
While on it, add a few spec links and remove needless conversions between DynamicLoader objects and their respective filesystem paths.
29 lines
697 B
C++
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;
|
|
};
|
|
|
|
}
|