arm-trusted-firmware/docs
Jimmy Brisson d95d56bd2b fix(romlib): wrap indirectly included functions
The problem that this resolves is a bit involved; the following
must be met at the same time for some function <to_be_wrapped>:

 * to_be_wrapped must be specified as part of the romlib
 * to_be_wrapped must _not_ be referenced by any translation unit
   in TF-A
 * to_be_wrapped must be referenced by a translation unit in a
   dependent library, mbedtls for example.

Under these circumstances, to_be_wrapped will not be wrapped, and
will instead reference its original definition while simultaneously
residing in romlib.

This is a side effect of two issues with romlib prior to this patch:

 1 to_be_wrapped is expected to wrap by duplicating its definition.
    This causes any condition that links against both the base and
    wrapper functions to be a link error (duplicate symbol definition).
 2 to_be_wrapped is in its own translation unit
    This causes the wrappers to be used by TF-A in an as needed.

The duplicate function definitions can be worked around using the
linker's `--wrap` flag, which redirects all references to a symbol
to resolve to `__wrap_<symbol>` and the original symbol to be
available as `__real_<symbol>`. Most of the changes handle creating
this arguments and passing them to the linker.

Further, once you use the linker's wrap, you will encounter another
issue: if TF-A does not use a function, its wrapper is not present.
This causes link issues when a library and not TF-A uses the wrapper.
Note that this issue would have been resolved previously by ignoring
the wrapper and using the base definition.

This further issue is worked around by concatenating the assembly for
all of the wrappers into a single translation unit. It's possible to
work around this issue in a few other ways, including reordering the
libraries passed to the linker to place libwrapper.a last or grouping
the libraries so that symbols from later libraries may be resolved
with prior libraries.

I chose the translation unit concatenation approach as it revealed
that a jumptable has duplicate symbols within it.

Change-Id: Ie57b5ae69bde2fc8705bdc7a93fae3ddb5341ed9
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2024-08-15 10:49:07 -05:00
..
_static/css docs(threat model): add TF-A threat model 2021-04-30 17:59:22 +02:00
about feat(nxp-drivers): add clock skeleton for s32cc 2024-06-28 08:33:39 +03:00
components fix(romlib): wrap indirectly included functions 2024-08-15 10:49:07 -05:00
design fix(cpus): workaround for Cortex-X4 erratum 2763018 2024-04-23 15:14:15 -05:00
design_documents refactor(docs): update RSE docs to match the example CCA token 2024-06-17 16:29:04 +02:00
getting_started feat(debugv8p9): add support for FEAT_Debugv8p9 2024-07-18 13:49:43 -05:00
perf docs(juno): update PSCI instrumentation data 2024-05-21 13:25:16 +00:00
plat fix(docs): fix CPU type for mt8195 2024-07-17 11:47:39 +08:00
process docs: remove reference to phabricator pages 2024-05-15 14:27:45 +02:00
resources fix(docs): replace "ARM-TF" with "TF-A" in diagrams 2024-06-13 15:55:42 +02:00
security_advisories chore: rename Poseidon to Neoverse V3 2024-03-26 11:27:31 -05:00
threat_model docs: change all occurrences of RSS to RSE 2024-04-22 15:44:38 +02:00
tools feat(memmap): add topological memory view 2023-05-12 14:38:22 +01:00
change-log.md docs(changelog): changelog for v2.11 release 2024-05-22 19:19:54 -05:00
conf.py docs(changelog): changelog for v2.11 release 2024-05-22 19:19:54 -05:00
global_substitutions.txt docs(errata_abi): document the errata abi changes 2023-05-05 13:24:59 -05:00
glossary.rst feat(dice): add typedefs from the Open DICE repo 2024-03-06 15:44:55 +01:00
index.rst feat(fwu): update the URL links for the FWU specification 2024-03-01 14:19:56 +05:30
license.rst feat(dice): add typedefs from the Open DICE repo 2024-03-06 15:44:55 +01:00
Makefile build: unify verbosity handling 2024-06-14 15:54:48 +00:00
porting-guide.rst feat(bl): add plat handler for image loading 2024-06-13 11:30:29 +02:00