]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - dlfcn/dlvsym.c
elf: Refuse to dlopen PIE objects [BZ #24323]
[thirdparty/glibc.git] / dlfcn / dlvsym.c
index 7aa1063a440b7b897527eacdacc0a4179fd10727..b3ed31e8b87d1211dc1e18ff9f25643afa639808 100644 (file)
@@ -1,5 +1,5 @@
 /* Look up a versioned symbol in a shared object loaded by `dlopen'.
-   Copyright (C) 1995-2000, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
 
 #include <ldsodefs.h>
 
-#if !defined SHARED && defined IS_IN_libdl
+#if !defined SHARED && IS_IN (libdl)
 
 void *
 weak_function
@@ -58,7 +58,7 @@ __dlvsym (void *handle, const char *name, const char *version_str
          DL_CALLER_DECL)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (!rtld_active ())
     return _dlfcn_hook->dlvsym (handle, name, version_str, DL_CALLER);
 # endif