Back to index

glibc  2.9
tst-array5dep.c
Go to the documentation of this file.
00001 #include <string.h>
00002 #include <unistd.h>
00003 
00004 static void
00005 init_0 (int argc __attribute__ ((unused)), char **argv)
00006 {
00007   char *p = strrchr (argv [0], '/');
00008 
00009   if (p == NULL)
00010       return;
00011 
00012   p++;
00013   size_t len = strlen (p);
00014   write (STDOUT_FILENO, "init array in DSO: ", 19);
00015   write (STDOUT_FILENO, p, len);
00016   write (STDOUT_FILENO, "\n", 1);
00017 }
00018 
00019 void (*const init_array []) (int, char **)
00020      __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) =
00021 {
00022   &init_0,
00023 };