Skip to content

Commit

Permalink
* dlfcn/dlfcn.c (init): Put it in .init_array section.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland McGrath committed Feb 10, 2005
1 parent 91adb52 commit 1a53c05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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>

[BZ #632]
Expand Down
12 changes: 9 additions & 3 deletions dlfcn/dlfcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1a53c05

Please sign in to comment.