DynamicLinker.h 697 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2021, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Result.h>
  8. #include <AK/Vector.h>
  9. #include <LibELF/DynamicObject.h>
  10. namespace ELF {
  11. using EntryPointFunction = int (*)(int, char**, char**);
  12. class DynamicLinker {
  13. public:
  14. static Optional<DynamicObject::SymbolLookupResult> lookup_global_symbol(StringView symbol);
  15. static EntryPointFunction linker_main(ByteString&& main_program_path, int fd, bool is_secure, char** envp);
  16. static Optional<ByteString> resolve_library(ByteString const& name, DynamicObject const& parent_object);
  17. private:
  18. DynamicLinker() = delete;
  19. ~DynamicLinker() = delete;
  20. };
  21. }