diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2005-07-14 17:02:11 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2005-07-14 17:02:11 +0000 |
commit | 24edc24dbe07ea0c08288b37682103a4751e47d0 (patch) | |
tree | c145b86b43fdb2e23cdb13580b95ef5310f42f76 /ld/testsuite/ld-elf/preinit.c | |
parent | 6c5cf62cc910b5f946c67f987f21e150de88666a (diff) | |
download | binutils-gdb-24edc24dbe07ea0c08288b37682103a4751e47d0.tar.gz |
2005-07-14 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/elf.exp (array_tests): New.
Call run_ld_link_exec_tests with array_tests.
* ld-elf/fini.c: New file.
* ld-elf/fini.out: Likewise.
* ld-elf/init.c: Likewise.
* ld-elf/init.out: Likewise.
* ld-elf/preinit.c: Likewise.
* ld-elf/preinit.out: Likewise.
* lib/ld-lib.exp (run_ld_link_exec_tests): New.
Diffstat (limited to 'ld/testsuite/ld-elf/preinit.c')
-rw-r--r-- | ld/testsuite/ld-elf/preinit.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/preinit.c b/ld/testsuite/ld-elf/preinit.c new file mode 100644 index 00000000000..9ef2a89c6c3 --- /dev/null +++ b/ld/testsuite/ld-elf/preinit.c @@ -0,0 +1,34 @@ +#include <stdio.h> + +static void +preinit_0 (void) +{ + printf ("preinit array 0\n"); +} + +static void +preinit_1 (void) +{ + printf ("preinit array 1\n"); +} + +static void +preinit_2 (void) +{ + printf ("preinit array 2\n"); +} + +void (*const preinit_array []) (void) + __attribute__ ((section (".preinit_array"), + aligned (sizeof (void *)))) = +{ + &preinit_0, + &preinit_1, + &preinit_2 +}; + +int +main (void) +{ + return 0; +} |