Since a running application will only have one set of XRay handlers, its
C++ function pointers all trampolines go to need to be explicitly put to
.dynsym for the runtime dynamic loader to find them. In contrast, local
symbols like the instrumentation map demarcation points, trampolines and
DSOContext must *not* be visible outside whatever we're linking, because
the world is full of broken software (libtool) instructing the toolchain
to apply broad policies on all symbols (-z defs, --export-dynamic) which
might confuse the loader into treating one DSO's instrumentation map for
other one's, for example, because the wrong visibilities have been set.
Therefore we'll maintain an explicit list of interfaces we want to share
and later (when this won't break any tests and I verify the install rule
does what I want in Gentoo's llvm-9999.ebuild) we'll instruct the driver
in Clang to pass these files as --dynamic-list and --version-script into
the final linker invocation. It will use the same /usr/lib/clang/7.0.0/
path as the XRay .a (+all sanitizers with their own .syms) currently do.
Obviously, this list will probably be altered later, as we progress.