From a23c28ec0d1cd67d25972181f613ef6dbfe4e299 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 2 Jun 2021 07:32:20 +0200 Subject: dlfcn: Move dlerror into libc The symbol was moved using scripts/move-symbol-to-libc.py. There is a minor functionality enhancement: dlerror now sets errno if it was set as part of the exception. (This is the result of using %m in asprintf, to avoid the strerror PLT call.) The previous errno value upon function return was unpredictable. Documenting this as a feature is premature; we need to make sure that the error codes are meaningful when they are set by the dynamic loader. Reviewed-by: Adhemerval Zanella --- include/dlfcn.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/dlfcn.h') diff --git a/include/dlfcn.h b/include/dlfcn.h index a8d48bdada..a92b2aefb8 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -96,8 +96,8 @@ extern void *_dl_vsym (void *handle, const char *name, const char *version, _dl_catch_error. Returns zero for success, nonzero for failure; and arranges for `dlerror' to return the error details. ARGS is passed as argument to OPERATE. */ -extern int _dlerror_run (void (*operate) (void *), void *args) - attribute_hidden; +extern int _dlerror_run (void (*operate) (void *), void *args); +libc_hidden_proto (_dlerror_run) #ifdef SHARED # define DL_CALLER_DECL /* Nothing */ @@ -124,7 +124,7 @@ struct dlfcn_hook }; extern struct dlfcn_hook *_dlfcn_hook; -libdl_hidden_proto (_dlfcn_hook) +libc_hidden_proto (_dlfcn_hook) extern void *__dlopen (const char *file, int mode DL_CALLER_DECL) attribute_hidden; @@ -137,8 +137,6 @@ extern void *__dlsym (void *handle, const char *name DL_CALLER_DECL) extern void *__dlvsym (void *handle, const char *name, const char *version DL_CALLER_DECL) attribute_hidden; -extern char *__dlerror (void) - attribute_hidden; extern int __dladdr (const void *address, Dl_info *info) attribute_hidden; extern int __dladdr1 (const void *address, Dl_info *info, -- cgit v1.2.3