Blame bits/dlfcn.h

Packit 6c4009
/* System dependent definitions for run-time dynamic loading.
Packit 6c4009
   Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _DLFCN_H
Packit 6c4009
# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* The MODE argument to `dlopen' contains one of the following: */
Packit 6c4009
#define RTLD_LAZY	0x00001	/* Lazy function call binding.  */
Packit 6c4009
#define RTLD_NOW	0x00002	/* Immediate function call binding.  */
Packit 6c4009
#define	RTLD_BINDING_MASK   0x3	/* Mask of binding time value.  */
Packit 6c4009
#define RTLD_NOLOAD	0x00004	/* Do not load the object.  */
Packit 6c4009
#define RTLD_DEEPBIND	0x00008	/* Use deep binding.  */
Packit 6c4009
Packit 6c4009
/* If the following bit is set in the MODE argument to `dlopen',
Packit 6c4009
   the symbols of the loaded object and its dependencies are made
Packit 6c4009
   visible as if the object were linked directly into the program.  */
Packit 6c4009
#define RTLD_GLOBAL	0x00100
Packit 6c4009
Packit 6c4009
/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
Packit 6c4009
   The implementation does this by default and so we can define the
Packit 6c4009
   value to zero.  */
Packit 6c4009
#define RTLD_LOCAL	0
Packit 6c4009
Packit 6c4009
/* Do not delete object when closed.  */
Packit 6c4009
#define RTLD_NODELETE	0x01000
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* To support profiling of shared objects it is a good idea to call
Packit 6c4009
   the function found using `dlsym' using the following macro since
Packit 6c4009
   these calls do not use the PLT.  But this would mean the dynamic
Packit 6c4009
   loader has no chance to find out when the function is called.  The
Packit 6c4009
   macro applies the necessary magic so that profiling is possible.
Packit 6c4009
   Rewrite
Packit 6c4009
	foo = (*fctp) (arg1, arg2);
Packit 6c4009
   into
Packit 6c4009
        foo = DL_CALL_FCT (fctp, (arg1, arg2));
Packit 6c4009
*/
Packit 6c4009
# define DL_CALL_FCT(fctp, args) \
Packit 6c4009
  (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* This function calls the profiling functions.  */
Packit 6c4009
extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif