2021-01-01 23:54:43 +00:00
|
|
|
/*
|
2021-01-20 21:36:13 +01:00
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
2021-01-01 23:54:43 +00:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-01-01 23:54:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Result.h>
|
|
|
|
|
#include <AK/Vector.h>
|
|
|
|
|
#include <LibELF/DynamicObject.h>
|
|
|
|
|
|
|
|
|
|
namespace ELF {
|
|
|
|
|
|
|
|
|
|
class DynamicLinker {
|
|
|
|
|
public:
|
2021-11-11 00:55:02 +01:00
|
|
|
static Optional<DynamicObject::SymbolLookupResult> lookup_global_symbol(StringView symbol);
|
2023-12-16 17:49:34 +03:30
|
|
|
[[noreturn]] static void linker_main(ByteString&& main_program_path, int fd, bool is_secure, int argc, char** argv, char** envp);
|
2021-01-01 23:54:43 +00:00
|
|
|
|
2023-12-16 17:49:34 +03:30
|
|
|
static Optional<ByteString> resolve_library(ByteString const& name, DynamicObject const& parent_object);
|
2022-12-18 16:41:09 +02:00
|
|
|
|
2021-01-01 23:54:43 +00:00
|
|
|
private:
|
|
|
|
|
DynamicLinker() = delete;
|
|
|
|
|
~DynamicLinker() = delete;
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-03 17:26:03 +01:00
|
|
|
}
|