class TestElfLoadSet
Defined at line 67 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-elf-object.h
This represents a named list of ld::testing::TestElfObject records, as
generated by an test_elf_load_set() target in GN.
Each test_elf_load_set() target produces one corresponding initialized const
TestElfLoadSet C++ object with internal linkage, so linking it into a test
just runs its constructor. The only TestElfLoadSet objects ever constructed
are these static constructors, so every one is registered in a table that
TestElfLoadSet::Get looks up by name.
If the build graph was arranged properly, then the last object in the list
is the test executable or other kind of root module and the others are its
DT_NEEDED dependencies or other kinds of dependencies (post-order traversal
of the build graph). Those other modules will be used at runtime via their
DT_SONAME strings, and their build-time metadata order is not necessarily
their runtime load order. So they are always looked up via the SonameMap.
Public Methods
void TestElfLoadSet (elfldltl::Soname<> name, TestElfObjectList objects)
Defined at line 31 of file ../../sdk/lib/ld/testing/test-elf-object.cc
const TestElfLoadSet * Get (elfldltl::Soname<> name)
Returns the set by the given name, usually the build-time name of the main
module (which may well have no SONAME or other runtime name). Precisely,
the name is the `output_name` parameter to test_elf_load_set() in GN.
Defined at line 39 of file ../../sdk/lib/ld/testing/test-elf-object.cc
SonameMap MakeSonameMap ()
Construct a map from SONAME to TestElfObject from the data.
Defined at line 47 of file ../../sdk/lib/ld/testing/test-elf-object.cc
void TestElfLoadSet ()
Defined at line 71 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-elf-object.h
void TestElfLoadSet (const TestElfLoadSet & )
Defined at line 72 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-elf-object.h
const TestElfObject & main_module ()
Return the main module. This winds up last in the list because the
initializer order flows from the post-order GN metadata walk in
test_elf_load_set() from the main module to reach its dependencies. The
order is not otherwise meaningful, and might not correspond to load order.
Everything but the main module is found by SONAME via MakeSonameMap().
Defined at line 86 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-elf-object.h