summary refs log tree commit diff
path: root/pkgs/build-support/libredirect
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-05-04 05:53:18 +0200
committerJan Tojnar <jtojnar@gmail.com>2019-05-04 05:53:18 +0200
commita0c6efb9fd23b8e9b44a123252afc863b88eb8d7 (patch)
treeb64414625cb79ebfcce389cc35c87a9b3dfc91e8 /pkgs/build-support/libredirect
parent6f7e06bd5a022d49972a92e7d317420fddd41a88 (diff)
downloadnixpkgs-a0c6efb9fd23b8e9b44a123252afc863b88eb8d7.tar
nixpkgs-a0c6efb9fd23b8e9b44a123252afc863b88eb8d7.tar.gz
nixpkgs-a0c6efb9fd23b8e9b44a123252afc863b88eb8d7.tar.bz2
nixpkgs-a0c6efb9fd23b8e9b44a123252afc863b88eb8d7.tar.lz
nixpkgs-a0c6efb9fd23b8e9b44a123252afc863b88eb8d7.tar.xz
nixpkgs-a0c6efb9fd23b8e9b44a123252afc863b88eb8d7.tar.zst
nixpkgs-a0c6efb9fd23b8e9b44a123252afc863b88eb8d7.zip
libredirect: remove dlopen support
While it might be useful in some cases, there are too many caveats to be worth it.
When libredirect intercepts dlopen call and calls the original function, the dynamic
loader will use libredirect.so's DT_RUNPATH entry instead of the one from the ELF file
the dlopen call originated from. That means that when program tries to dlopen a library
that it expects to find on its RPATH, the call will fail.
This broke Sublime Text for just that reason.
Diffstat (limited to 'pkgs/build-support/libredirect')
-rw-r--r--pkgs/build-support/libredirect/libredirect.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/pkgs/build-support/libredirect/libredirect.c b/pkgs/build-support/libredirect/libredirect.c
index dcf3a2016bc..655399af58f 100644
--- a/pkgs/build-support/libredirect/libredirect.c
+++ b/pkgs/build-support/libredirect/libredirect.c
@@ -166,10 +166,3 @@ int execv(const char *path, char *const argv[])
     char buf[PATH_MAX];
     return execv_real(rewrite(path, buf), argv);
 }
-
-void *dlopen(const char *filename, int flag)
-{
-    void * (*__dlopen_real) (const char *, int) = dlsym(RTLD_NEXT, "dlopen");
-    char buf[PATH_MAX];
-    return __dlopen_real(rewrite(filename, buf), flag);
-}