class RuntimeDynamicLinker
Defined at line 61 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-dynamic-linker.h
Public Methods
const ModuleList & modules ()
Defined at line 71 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-dynamic-linker.h
ModuleList & modules ()
Defined at line 72 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-dynamic-linker.h
size_t max_static_tls_modid ()
Defined at line 74 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-dynamic-linker.h
std::unique_ptr<RuntimeDynamicLinker> Create (const ld::abi::Abi<> & abi, fbl::AllocChecker & ac)
Create a RuntimeDynamicLinker with the passed in passive `abi`. The caller
is required to pass an AllocChecker and check it to verify the
RuntimeDynamicLinker was created and initialized successfully.
Defined at line 148 of file ../../sdk/lib/c/dlfcn/dl/runtime-dynamic-linker.cc
fit::result<Error, void *> LookupSymbol (const RuntimeModule & root, const char * ref)
Lookup a symbol from the given module, returning a pointer to it in memory,
or an error if not found (ie undefined symbol).
Defined at line 56 of file ../../sdk/lib/c/dlfcn/dl/runtime-dynamic-linker.cc
template <class Loader, typename RetrieveFile>
fit::result<Error, void *> Open (const char * file, int mode, RetrieveFile && retrieve_file)
Open `file` with the given `mode`, returning a pointer to the loaded module
for the file. The `retrieve_file` argument is to the LinkingSession and
is called as a `fit::result
<std
::optional
<Error
>, File>(Diagnostics
&
, std::string_view)`
with the following semantics:
- fit::error{std::nullopt} is a not found error
- fit::error{Error} is an error type that can be passed to
Diagnostics::SystemError (see
<lib
/elfldltl/diagnostics.h>) to give
more context to the error message.
- fit::ok{File} is the found elfldltl File API type for the module
(see
<lib
/elfldltl/memory.h>).
The Diagnostics reference passed to `retrieve_file` is not used by the
function itself to report its errors, but is plumbed into the created File
API object that will use it for reporting file read errors.
Defined at line 97 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-dynamic-linker.h
int IteratePhdrInfo (DlIteratePhdrCallback * callback, void * data)
Create a `dl_phdr_info` for each module in `modules_` and pass it
to the caller-supplied `callback`. Iteration ceases when `callback` returns
a non-zero value. The result of the last callback function to run is
returned to the caller.
Defined at line 178 of file ../../sdk/lib/c/dlfcn/dl/runtime-dynamic-linker.cc
fit::result<Error, int> DlInfo (void * handle, int request, void * info)
Information specified by `request` is stored in the location pointed to by
`info`. On success:
- Returns the number of program headers if `request` is `RTLD_DI_PHDR`.
- Returns 0 for all other valid `RTLD_DI_*` values.
An error message is returned on failure.
Defined at line 225 of file ../../sdk/lib/c/dlfcn/dl/runtime-dynamic-linker.cc
fit::result<Error> PrepareTlsBlocksForThread (void * tp)
Allocate and initialize the thread's dynamic TLS blocks. This will iterate
through all the currently loaded modules with dynamic TLS and populate this
thread's _dl_tlsdesc_runtime_dynamic_blocks variable with their TLS data.
This function will fail if allocation fails.
Defined at line 190 of file ../../sdk/lib/c/dlfcn/dl/runtime-dynamic-linker.cc
size_type max_tls_modid ()
Defined at line 193 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-dynamic-linker.h
size_type DynamicTlsCount ()
The number of dynamic TLS modules that are loaded.
Defined at line 196 of file ../../sdk/lib/c/dlfcn/dl/test/../runtime-dynamic-linker.h