template <class Loader>

struct StartupLoadModule

Defined at line 70 of file ../../sdk/lib/ld/startup-load.h

Public Methods

void StartupLoadModule<Loader> ()

Defined at line 81 of file ../../sdk/lib/ld/startup-load.h

void StartupLoadModule<Loader> (StartupLoadModule<Loader> && )

Defined at line 83 of file ../../sdk/lib/ld/startup-load.h

template <typename... LoaderArgs>
void StartupLoadModule<Loader> (const elfldltl::Soname<> & name, LoaderArgs &&... loader_args)

Defined at line 86 of file ../../sdk/lib/ld/startup-load.h

template <typename... LoaderArgs>
void StartupLoadModule<Loader> (const elfldltl::Soname<> & name, LoaderArgs &&... loader_args)

Defined at line 86 of file ../../sdk/lib/ld/startup-load.h

template <class Allocator, typename... LoaderArgs>
StartupLoadModule<Loader> * New (Diagnostics & diag, Allocator & allocator, const elfldltl::Soname<> & name, LoaderArgs &&... loader_args)

This uses the given scratch allocator to create a new module object.

Defined at line 91 of file ../../sdk/lib/ld/startup-load.h

template <class Allocator, typename... LoaderArgs>
StartupLoadModule<Loader> * New (Diagnostics & diag, Allocator & allocator, const elfldltl::Soname<> & name, LoaderArgs &&... loader_args)

This uses the given scratch allocator to create a new module object.

Defined at line 91 of file ../../sdk/lib/ld/startup-load.h

template <class Allocator, class File, class... PhdrObservers>
StartupLoadResult Load (Diagnostics & diag, Allocator & allocator, File && file, uint32_t symbolizer_modid, size_type & max_tls_modid, PhdrObservers &&... phdr_observers)

Read the file and use Loader::Load on it. If at least partially

successful, this uses the given initial-exec allocator to set up the

passive ABI module in this->module(). The allocator only guarantees two

mutable allocations at a time, so the caller must then promptly splice it

into the link_map list before the next Load call allocates the next one.

Defined at line 106 of file ../../sdk/lib/ld/startup-load.h

template <class Allocator, class File, class... PhdrObservers>
StartupLoadResult Load (Diagnostics & diag, Allocator & allocator, File && file, uint32_t symbolizer_modid, size_type & max_tls_modid, PhdrObservers &&... phdr_observers)

Read the file and use Loader::Load on it. If at least partially

successful, this uses the given initial-exec allocator to set up the

passive ABI module in this->module(). The allocator only guarantees two

mutable allocations at a time, so the caller must then promptly splice it

into the link_map list before the next Load call allocates the next one.

Defined at line 106 of file ../../sdk/lib/ld/startup-load.h

void set_dynamic (std::span<const Dyn> dynamic)

If a module is constructed manually rather than by Load, this points it at

its PT_DYNAMIC segment in memory.

Defined at line 154 of file ../../sdk/lib/ld/startup-load.h

void set_dynamic (std::span<const Dyn> dynamic)

If a module is constructed manually rather than by Load, this points it at

its PT_DYNAMIC segment in memory.

Defined at line 154 of file ../../sdk/lib/ld/startup-load.h

void Relocate (Diagnostics & diag, const List & modules)

Defined at line 156 of file ../../sdk/lib/ld/startup-load.h

void CommitAndProtectRelro (Diagnostics & diag)

Since later failures will be fatal anyway, we can go ahead and commit the

mappings so the Loader destructor won't unmap the module. Transferring

ownership of the mappings and ending the lifetime of the Loader object is

part of preparing to apply RELRO protections. But we have no need to hold

onto the Loader::Relro capability any longer.

Defined at line 168 of file ../../sdk/lib/ld/startup-load.h

List MakeList ()

Defined at line 172 of file ../../sdk/lib/ld/startup-load.h

auto & memory ()

This is only valid until CommitAndProtectRelro() is called.

Defined at line 179 of file ../../sdk/lib/ld/startup-load.h

template <typename ScratchAllocator, typename InitialExecAllocator, typename GetDepFile, typename... LoaderArgs>
void LinkModules (Diagnostics & diag, ScratchAllocator & scratch, InitialExecAllocator & initial_exec, StartupLoadModule<Loader> * main_executable, GetDepFile && get_dep_file, StartupBootstrap & bootstrap, size_t executable_needed_count, LoaderArgs &&... loader_args)

Defined at line 183 of file ../../sdk/lib/ld/startup-load.h

template <typename ScratchAllocator, typename InitialExecAllocator, typename GetDepFile, typename... LoaderArgs>
void LinkModules (Diagnostics & diag, ScratchAllocator & scratch, InitialExecAllocator & initial_exec, StartupLoadModule<Loader> * main_executable, GetDepFile && get_dep_file, StartupBootstrap & bootstrap, size_t executable_needed_count, LoaderArgs &&... loader_args)

Defined at line 183 of file ../../sdk/lib/ld/startup-load.h