mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-23 09:43:32 +08:00
Set constructor/destructor priority to 1000
This commit is contained in:
parent
d14fbb177a
commit
224cb13491
5
ChangeLog.hjl
Normal file
5
ChangeLog.hjl
Normal file
@ -0,0 +1,5 @@
|
||||
2012-11-16 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* elf/tst-array1.c (init): Set constructor priority to 1000.
|
||||
(fini): Set destructor priority to 1000.
|
||||
* elf/tst-array2dep.c: Likewise.
|
@ -1,6 +1,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
static void init (void) __attribute__ ((constructor));
|
||||
/* Give init non-default priority so that it runs before init_array. */
|
||||
static void init (void) __attribute__ ((constructor (1000)));
|
||||
|
||||
static void
|
||||
init (void)
|
||||
@ -8,7 +9,8 @@ init (void)
|
||||
write (STDOUT_FILENO, "init\n", 5);
|
||||
}
|
||||
|
||||
static void fini (void) __attribute__ ((destructor));
|
||||
/* Give fini the same priority as init. */
|
||||
static void fini (void) __attribute__ ((destructor (1000)));
|
||||
|
||||
static void
|
||||
fini (void)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
static void init (void) __attribute__ ((constructor));
|
||||
/* Give init non-default priority so that it runs before init_array. */
|
||||
static void init (void) __attribute__ ((constructor (1000)));
|
||||
|
||||
static void
|
||||
init (void)
|
||||
@ -8,7 +9,8 @@ init (void)
|
||||
write (STDOUT_FILENO, "DSO init\n", 9);
|
||||
}
|
||||
|
||||
static void fini (void) __attribute__ ((destructor));
|
||||
/* Give fini the same priority as init. */
|
||||
static void fini (void) __attribute__ ((destructor (1000)));
|
||||
|
||||
static void
|
||||
fini (void)
|
||||
|
Loading…
Reference in New Issue
Block a user