From e28bacf5785e4c1b3f7c6fc219163dbec9b8addb Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 24 Jul 1999 22:17:17 +0000 Subject: Update. * elf/Makefile (dl-routines): Add preinit. * elf/Versions [ld.so] (GLIBC_2.2): Export _dl_preinit_next. * elf/link.h (struct link_map): Add new field l_preinitcount. * elf/dl-preinit.c: New file. * elf/dynamic-link.h: Initialize l_preinitcount. * sysdeps/i386/dl-machine.h (RTLD_START): Call pre-init functions. --- sysdeps/i386/dl-machine.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sysdeps/i386/dl-machine.h') diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 0377157bd7..2a14d73364 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -229,6 +229,18 @@ _dl_start_user:\n\ # _dl_init_next call below.\n\ movl _dl_main_searchlist@GOT(%ebx), %eax\n\ movl (%eax), %esi\n\ + # First run the pre-initializers.\n\ +0: movl %esi,%eax\n\ + # Call _dl_init_next to return the address of an initializer\n\ + # function to run.\n\ + call _dl_preinit_next@PLT\n\ + # Check for zero return, when out of initializers.\n\ + testl %eax, %eax\n\ + jz 0f\n\ + # Call the pre-initilizer.\n\ + call *%eax\n\ + # Loop to call _dl_preinit_next for the next initializer.\n\ + jmp 0b\n\ 0: movl %esi,%eax\n\ # Call _dl_init_next to return the address of an initializer\n\ # function to run.\n\ -- cgit v1.2.3