* dlfcn/dlfcn.c (init): Put it in .init_array section.

This commit is contained in:
Roland McGrath 2005-02-10 09:25:49 +00:00
parent 91adb529b0
commit 1a53c052c3
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2005-01-25 H.J. Lu <hongjiu.lu@intel.com>
* dlfcn/dlfcn.c (init): Put it in .init_array section.
2005-02-10 Roland McGrath <roland@redhat.com> 2005-02-10 Roland McGrath <roland@redhat.com>
[BZ #632] [BZ #632]

View File

@ -23,11 +23,17 @@
int __dlfcn_argc attribute_hidden; int __dlfcn_argc attribute_hidden;
char **__dlfcn_argv attribute_hidden; char **__dlfcn_argv attribute_hidden;
#ifdef HAVE_INITFINI_ARRAY
void static void
__attribute__ ((constructor))
init (int argc, char *argv[]) init (int argc, char *argv[])
{ {
__dlfcn_argc = argc; __dlfcn_argc = argc;
__dlfcn_argv = argv; __dlfcn_argv = argv;
} }
static void (*const init_array []) (int argc, char *argv[])
__attribute__ ((section (".init_array"), aligned (sizeof (void *))))
__attribute_used__ = { init };
#else
# error "Need linker with .init_array support."
#endif