An application crate that has been loaded into a CrateNamespace
.
This struct represents a namespace of crates and their “global” (publicly-visible) symbols.
A crate namespace struct is basically a container around many crates
that have all been loaded and linked against each other,
completely separate and in isolation from any other crate namespace
(although a given crate may be shared across multiple namespaces).
Represents a single crate whose object file has been
loaded and linked into at least one CrateNamespace
.
Represents a section that has been loaded and is part of a LoadedCrate
.
The containing SectionType
enum determines which type of section it is.
The parts of a LoadedSection
that may be mutable, i.e.,
only the parts that could change after a section is initially loaded and linked.
A wrapper around a Directory
reference that offers special convenience functions
for getting and inserting crate object files into a directory.
The information necessary to calculate and write a relocation value,
based on a source section and a target section, in which a value
based on the location of the source section is written somwhere in the target section.
A wrapper around an Arc<str>
: an immutable shared reference to a string slice.
A representation that the owner A
of (a LoadedSection
object containing) this struct
depends on the given section
B
in this struct.
The dependent section A
is not specifically included here;
since it’s the owner of this struct, it’s implicit that it’s the dependent one.
A representation that the section
A
in this struct
depends on the owner B
of (the LoadedSection
object containing) this struct.
The target dependency B
is not specifically included here;
it’s implicitly the owner of this struct.
Returns the crate name that is derived from a crate object file path.
Create a new application CrateNamespace
that uses the default application directory
and is structured atop the given recursive_namespace
.
If no recursive_namespace
is provided, the default initial kernel namespace will be used.
Returns a reference to the symbol table in the given ElfFile
.
Parses the given symbol string to try to find the name of the parent crate
that contains the symbol.
Depending on the symbol, there may be multiple potential parent crates;
if so, they are returned in order of likeliness:
the first crate name in the symbol is most likely to contain it.
If the parent crate cannot be determined (e.g., a no_mangle
symbol),
then an empty Vec
is returned.
Same as
get_containing_crate_name()
,
but returns the substring
Range
s of where the parent crate names
are located in the given
demangled_full_symbol
string.
Returns a reference to the default kernel namespace,
which must exist because it contains the initially-loaded kernel crates.
Returns None if the default namespace hasn’t yet been initialized.
Returns the top-level directory that contains all of the namespaces.
Initializes the module management system based on the bootloader-provided modules,
and creates and returns the default CrateNamespace
for kernel crates.
Crate names must be only alphanumeric characters, an underscore, or a dash.
Replaces the old_crate_name
substring in the given demangled_full_symbol
with the given new_crate_name
,
if it can be found, and if the parent crate name matches the old_crate_name
.
If the parent crate name can be found but does not match the expected old_crate_name
,
then None is returned.
Returns the default name for the given
SectionType
as a
StrRef
.
Actually write the value of a relocation entry.