]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
_dl_init: Remove internal_function attribute
authorFlorian Weimer <fweimer@redhat.com>
Mon, 14 Aug 2017 10:57:50 +0000 (12:57 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 14 Aug 2017 13:08:48 +0000 (15:08 +0200)
The function is called from the i386 startup code, which needs minor
adjustments due to the changed ABI.

ChangeLog
elf/dl-init.c
sysdeps/generic/ldsodefs.h
sysdeps/i386/dl-machine.h

index 74ad96d80000784173e841c8350fd5aa1acf86e8..ac21eae7139dd0d27ae8174b49c69111d37e4ba3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-14  Florian Weimer  <fweimer@redhat.com>
+
+       * elf/dl-init.c (_dl_init): Remove internal_function.
+       * sysdeps/generic/ldsodefs.h (_dl_init): Likewise.
+       * sysdeps/i386/dl-machine.h (RTLD_START): Adjust call to _dl_init.
+
 2017-08-14  Florian Weimer  <fweimer@redhat.com>
 
        * elf/rtld.c (_dl_start): Remove internal_function.
index 5c5f3de3659aac3b41b312b3489c8d44b7fd42fb..fb3734590b5ea45bb5e714fdf2ece6426bb238a2 100644 (file)
@@ -75,7 +75,6 @@ call_init (struct link_map *l, int argc, char **argv, char **env)
 
 
 void
-internal_function
 _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
 {
   ElfW(Dyn) *preinit_array = main_map->l_info[DT_PREINIT_ARRAY];
index 4540096688e6c5afd7f809b5d18b1595dcc9612d..49e673dd24847e42c4ce090a12164e975fa4cfb7 100644 (file)
@@ -964,7 +964,7 @@ extern int _dl_check_map_versions (struct link_map *map, int verbose,
 /* Initialize the object in SCOPE by calling the constructors with
    ARGC, ARGV, and ENV as the parameters.  */
 extern void _dl_init (struct link_map *main_map, int argc, char **argv,
-                     char **env) internal_function attribute_hidden;
+                     char **env) attribute_hidden;
 
 /* Call the finalizer functions of all shared objects whose
    initializer functions have completed.  */
index 924de953b72a4202dc0213d9aeab6f3199eb44c4..2e17eba5c08042ac5cad563afa6078fe70dc3222 100644 (file)
@@ -177,17 +177,20 @@ _dl_start_user:\n\
        # switch stacks if it moves these contents over.\n\
 " RTLD_START_SPECIAL_INIT "\n\
        # Load the parameters again.\n\
-       # (eax, edx, ecx, *--esp) = (_dl_loaded, argc, argv, envp)\n\
+       # (eax, edx, ecx, esi) = (_dl_loaded, argc, argv, envp)\n\
        movl _rtld_local@GOTOFF(%ebx), %eax\n\
        leal 8(%esp,%edx,4), %esi\n\
        leal 4(%esp), %ecx\n\
        movl %esp, %ebp\n\
        # Make sure _dl_init is run with 16 byte aligned stack.\n\
        andl $-16, %esp\n\
-       pushl %eax\n\
-       pushl %eax\n\
+        subl $12, %esp\n\
        pushl %ebp\n\
+        # Arguments for _dl_init.\n\
        pushl %esi\n\
+       pushl %ecx\n\
+       pushl %edx\n\
+       pushl %eax\n\
        # Clear %ebp, so that even constructors have terminated backchain.\n\
        xorl %ebp, %ebp\n\
        # Call the function to run the initializers.\n\
@@ -195,7 +198,7 @@ _dl_start_user:\n\
        # Pass our finalizer function to the user in %edx, as per ELF ABI.\n\
        leal _dl_fini@GOTOFF(%ebx), %edx\n\
        # Restore %esp _start expects.\n\
-       movl (%esp), %esp\n\
+       movl 16(%esp), %esp\n\
        # Jump to the user's entry point.\n\
        jmp *%edi\n\
        .previous\n\