dlfcn: Move RTLD_DEFAULT/RTLD_NEXT outside __USE_GNU

POSIX reserves the RTLD_ namespace, and this is already reflected in our
conform tests.
Note: RTLD_DEFAULT and RTLD_NEXT appear in IEEE Std 1003.1-2004.  Many
systems (e.g. FreeBSD, musl) just define the macros unconditionally.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Tested-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Fangrui Song 2022-05-23 10:23:23 -07:00
parent 9a421348cd
commit 748df8126a
1 changed files with 10 additions and 12 deletions

View File

@ -30,6 +30,14 @@
#ifdef __USE_GNU
#include <bits/dl_find_object.h>
/* Type for namespace indices. */
typedef long int Lmid_t;
/* Special namespace ID values. */
# define LM_ID_BASE 0 /* Initial namespace. */
# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */
#endif
/* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT
the run-time address of the symbol called NAME in the next shared
object is returned. The "next" relation is defined by the order
@ -41,16 +49,6 @@
is returned. */
#define RTLD_DEFAULT ((void *) 0)
/* Type for namespace indices. */
typedef long int Lmid_t;
/* Special namespace ID values. */
# define LM_ID_BASE 0 /* Initial namespace. */
# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */
#endif
__BEGIN_DECLS
/* Open the shared object FILE and map it in; return a handle that can be