[roll] Roll fuchsia [ld][testing] Add test_elf_object() GN templates and API

This replaces the old load-test-modules-info mechanism with a new
mechanism that's formalized and exported by the testing library.

The new scheme relies on metadata and generator targets for each
linked ELF object, i.e. executable, shared library or loadable
module.  In the ld test modules (and ld-startup) these are wired
up to make the ELF data extractable.  These all roll up to
producing a "load set", which is a collection of the objects in
the dependency graph of a root module or executable.  These are
represented by ld::TestElfObject and ld::TestElfLoadSet objects
in the <lib/ld/testing/test-elf-object.h> API.

Finally, instead of collecting all data for all modules, each
test_elf_load_set() (e.g. test executable or root module) of
interest can be explicitly referenced in a test_elf_source_set()
target that is where the generated constinit initializer code
gets generated and compiled.  The source_set() for an individual
gtest case that needs ELF data about a certain load set depends
on a test_elf_source_set() written specifically to collect only
the test_elf_load_set() data that's actually needed.

The new ld::TestElfObject type is designed to be constinit.  The
ld::TestElfLoadSet type is not constinit because every one is
registered for lookup by name in tests.  But it has simple
constructor arguments so the generated initializer calls won't be
very large.  Moreover, the new scheme avoids including
unnecessary TestElfLoadSet and uses a separate TU for each
fine-grained test_elf_source_set() so they can be broken up down
even to one TestElfLoadSet per TU if desired.

Original-Bug: 335737373
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1107153
Original-Revision: da36163f82a7ed2a5c50fc04e8cf332c780436dc
GitOrigin-RevId: 3cd5bf38e1d65fea160466610fa795116e73dd74
Change-Id: I86106d4106b05940b79046bf58add48a81ac1f6c
1 file changed
tree: ba2b6f0757f95c182424c732f45e755bf027787f
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cts
  6. firmware
  7. flower
  8. jiri.lock
  9. MILESTONE
  10. minimal
  11. prebuilts
  12. README.md
  13. stem
  14. test_durations
  15. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.