Page MenuHomePhabricator

[XRay] [compiler-rt] [DSO] start deciding which symbols to hide/export
Needs ReviewPublic

Authored by pelikan on Oct 17 2017, 1:56 AM.

Details

Reviewers
dberris
Summary

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.

Event Timeline

pelikan created this revision.Oct 17 2017, 1:56 AM
pelikan updated this revision to Diff 142163.Apr 12 2018, 6:19 AM

rebase + try to use this diff from a different machine

Herald added subscribers: Restricted Project, delcypher. · View Herald TranscriptApr 12 2018, 6:19 AM
pelikan edited the summary of this revision. (Show Details)Apr 12 2018, 6:30 AM
pelikan updated this revision to Diff 142357.Apr 13 2018, 1:56 AM

sync & add a failing test

pelikan updated this revision to Diff 142359.Apr 13 2018, 2:01 AM

more tidbits and context