about summary refs log tree commit diff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-08-14 12:57:50 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-08-14 15:08:48 +0200
commitb3f85fd2e43b1d69384396a6d99fa2135dbf46e3 (patch)
treea2f23e7f5247f1737c29ee348b23df26f92342f8 /sysdeps/i386
parent630bf4916f10bdba28a99480ef32170b977ea5fc (diff)
downloadglibc-b3f85fd2e43b1d69384396a6d99fa2135dbf46e3.tar.gz
glibc-b3f85fd2e43b1d69384396a6d99fa2135dbf46e3.tar.xz
glibc-b3f85fd2e43b1d69384396a6d99fa2135dbf46e3.zip
_dl_init: Remove internal_function attribute
The function is called from the i386 startup code, which needs minor
adjustments due to the changed ABI.
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/dl-machine.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 924de953b7..2e17eba5c0 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -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\