diff options
author | Roland McGrath <roland@gnu.org> | 2005-02-10 09:25:49 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2005-02-10 09:25:49 +0000 |
commit | 1a53c052c34ec4e934ba177b4f5bcf0b51be2ceb (patch) | |
tree | dc5220b044cd42bcfd925042424f4c11323cc95d /dlfcn | |
parent | 91adb529b07eca93e25a84d0054418335e2fc6cf (diff) | |
download | glibc-1a53c052c34ec4e934ba177b4f5bcf0b51be2ceb.zip glibc-1a53c052c34ec4e934ba177b4f5bcf0b51be2ceb.tar.gz glibc-1a53c052c34ec4e934ba177b4f5bcf0b51be2ceb.tar.bz2 |
* dlfcn/dlfcn.c (init): Put it in .init_array section.
Diffstat (limited to 'dlfcn')
-rw-r--r-- | dlfcn/dlfcn.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/dlfcn/dlfcn.c b/dlfcn/dlfcn.c index 9c0a84a..8047150 100644 --- a/dlfcn/dlfcn.c +++ b/dlfcn/dlfcn.c @@ -23,11 +23,17 @@ int __dlfcn_argc attribute_hidden; char **__dlfcn_argv attribute_hidden; - -void -__attribute__ ((constructor)) +#ifdef HAVE_INITFINI_ARRAY +static void init (int argc, char *argv[]) { __dlfcn_argc = argc; __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 |