class RuntimeModule

Defined at line 66 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

Forward declaration; defined below.

Public Methods

void ~RuntimeModule ()

See unmap-[posix|zircon].cc for the dtor. On destruction, the module's load

image is unmapped per the semantics of the OS implementation.

Defined at line 11 of file ../../sdk/lib/c/dlfcn/dl/unmap-zircon.cc

bool ReifyModuleTree (Diagnostics & diag)

Constructs this module's `module_tree` if it has not been set yet.

Defined at line 14 of file ../../sdk/lib/c/dlfcn/dl/runtime-module.cc

void InitializeModuleTree ()

Run the init functions for this module (as the root module) and the init

functions for all its dependencies.

Defined at line 50 of file ../../sdk/lib/c/dlfcn/dl/runtime-module.cc

void Initialize ()

Run only this module's init functions. This is called if this module is

loaded as a dependency to another module.

Defined at line 63 of file ../../sdk/lib/c/dlfcn/dl/runtime-module.cc

void RuntimeModule (const RuntimeModule & )

Not copyable, but movable.

Defined at line 74 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

void RuntimeModule (RuntimeModule && )

Defined at line 75 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

bool operator== (const Soname & other)

The name of the runtime module is set to the filename passed to dlopen() to

create the runtime module. This is usually the same as the DT_SONAME of the

AbiModule, but that is not guaranteed. When performing an equality check,

match against both possible name values.

Defined at line 85 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

const Soname & name ()

Defined at line 89 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

const RuntimeModule & FromPtr (const void * ptr)

Translate a void * pointer, as when passed to public-facing

<dlfcn

.h> APIs,

into a RuntimeModule reference.

Defined at line 93 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

RuntimeModule & FromPtr (void * ptr)

Defined at line 96 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

std::unique_ptr<RuntimeModule> Create (fbl::AllocChecker & ac, Soname soname)

TODO(https://fxbug.dev/333920495): pass in the symbolizer_modid.

Defined at line 99 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

void SetStartupModule (const AbiModule & abi_module, const ld::abi::Abi<> & abi)

This is called if the RuntimeModule is created from a startup module (i.e.

a module that was linked and loaded with the running program). This sets

the abi, TLS, and direct_deps information onto the RuntimeModule.

Defined at line 126 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

AbiModule & module ()

Defined at line 139 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

const AbiModule & module ()

Defined at line 140 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

void set_tls_module (TlsModule tls_module)

Defined at line 142 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

const TlsModule & tls_module ()

Defined at line 143 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

size_t vaddr_size ()

Defined at line 145 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

const SymbolInfo & symbol_info ()

The following methods satisfy the Module template API for use with

elfldltl::ResolverDefinition (see

<lib

/elfldltl/resolve.h>).

Defined at line 150 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

const ld::abi::Abi<>::LinkMap & link_map ()

Defined at line 152 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

const struct link_map * user_link_map ()

The ld::abi::Abi

<

>::LinkMap embedded in the RuntimeModule's ABI module is

compatible with `struct link_map` (see

<lib

/elfldltl/svr4-abi.h>). This

will cast the module's LinkMap into the `struct link_map` type used by

users of the public-facing

<dlfcn

.h> API.

Defined at line 158 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

Addr load_bias ()

Defined at line 162 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

size_type tls_module_id ()

Defined at line 164 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

bool uses_static_tls ()

Defined at line 166 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

size_t static_tls_bias ()

Defined at line 168 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

fit::result<bool, const typename Elf::Sym *> Lookup (Diagnostics & diag, elfldltl::SymbolName & name)

Defined at line 170 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

Vector<RuntimeModule *> & direct_deps ()

This is a list of module pointers to this module's DT_NEEDEDs, i.e. the

first level of dependencies in this module's module tree. If this list is

empty, the module does not have any dependencies.

Defined at line 178 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

decltype(transform_view<views::all_t<const elfldltl::AllocCheckerContainer<fbl::Vector>::Container<dl::RuntimeModule *> &>, dl::RuntimeModule::Deref<const dl::RuntimeModule>>(std::forward<const elfldltl::AllocCheckerContainer<fbl::Vector>::Container<dl::RuntimeModule *> &>(__range), std::forward<dl::RuntimeModule::Deref<const dl::RuntimeModule>>(__f))) module_tree ()

This is the breadth-first ordered list of module references, representing

this module's tree of modules. A reference to this module (the root) is

always the first in this list. The other modules in this list are

non-owning references to modules that were explicitly linked with this

module; global modules that may have been used for relocations, but are

not a DT_NEEDED of any dependency, are not included in this list. This

list is set when dlopen() is called on this module.

Defined at line 187 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

decltype(transform_view<views::all_t<elfldltl::AllocCheckerContainer<fbl::Vector>::Container<dl::RuntimeModule *> &>, dl::RuntimeModule::Deref<dl::RuntimeModule>>(std::forward<elfldltl::AllocCheckerContainer<fbl::Vector>::Container<dl::RuntimeModule *> &>(__range), std::forward<dl::RuntimeModule::Deref<dl::RuntimeModule>>(__f))) module_tree ()

Defined at line 193 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

bool is_global ()

Whether this module is a global module: either the module was loaded at

startup or loaded by dlopen() with the RTLD_GLOBAL flag.

Defined at line 203 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

void set_global ()

Defined at line 204 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

bool is_local ()

Defined at line 205 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

void set_no_delete ()

Prevent this module from being unloaded. Once this is set (usually by

passing RTLD_NODELETE to dlopen), it cannot be unset. Setting this on a

module implies that none of its dependencies can be unloaded either: since

this module will live for the lifetime of the main program, so will its

dependencies.

Defined at line 212 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

TlsdescIndirectList & tls_desc_indirect_list ()

This is the list of TlsDesc objects (see tls-desc-resolver.h) that was set

during TLS relocation for this module. The RuntimeModule owns this list:

it will get destroyed with the module.

Defined at line 217 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

dl_phdr_info MakeDlPhdrInfo (void * tls_data, ld::DlPhdrInfoCounts counts)

Construct the `dl_phdr_info` for this module.

Defined at line 228 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-module.h

Records