Add linker version script to explicitly expose symbols. Refs #683

* When statically linking libstdc++ by default the symbols are all
  default visibility. This causes a problem if you statically link an
  old libstdc++ then inject librenderdoc.so, and the application starts
  using the old libstdc++ instead of the system's.
* Really we only want to use the static one for calls from
  librenderdoc.so. In theory -Wl,--exclude-libs,libstdc++ should do this
  for us, but it starts to cause bizarre crashes.
* Instead, we have to resort to a manual linker script which whitelists
  which symbols should be visible. Normally we can do this just for our
  own symbols with -fvisibility=hidden and __attribute__((visibility))
  but that doesn't work for linked symbols apparently.
This commit is contained in:
baldurk
2017-07-17 16:34:13 +01:00
parent 2f6dffffc5
commit 389cff23f3
2 changed files with 16 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
{
global:
_init;
_fini;
gl[A-Z]*;
dlopen;
_exit;
RENDERDOC_*;
VK_LAYER_RENDERDOC_*;
local:
*;
};