int __dlclose (void *handle) { # ifdef SHARED if (__builtin_expect (_dlfcn_hook != NULL, 0)) return _dlfcn_hook->dlclose (handle); # endif return _dlerror_run (dlclose_doit, handle) ? -1 : 0; }
void * __dlvsym (void *handle, const char *name, const char *version_str) { struct dlvsym_args args; args.handle = handle; args.name = name; args.who = RETURN_ADDRESS (0); args.version = version_str; return (_dlerror_run (dlvsym_doit, &args) ? NULL : args.sym); }
args->sym = _dl_sym (args->handle, args->name, args->who); } void * __dlsym (void *handle, const char *name DL_CALLER_DECL) { # ifdef SHARED if (!rtld_active ()) return _dlfcn_hook->dlsym (handle, name, DL_CALLER); # endif struct dlsym_args args; args.who = DL_CALLER; args.handle = handle; args.name = name; /* Protect against concurrent loads and unloads. */ __rtld_lock_lock_recursive (GL(dl_load_lock)); void *result = (_dlerror_run (dlsym_doit, &args) ? NULL : args.sym); __rtld_lock_unlock_recursive (GL(dl_load_lock)); return result; } # ifdef SHARED strong_alias (__dlsym, dlsym) # endif #endif