patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-dl-machine-i386.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 	* sysdeps/i386/dl-machine.h (RTLD_START): Don't use multi-line
     2 	strings.
     3 	(ELF_MACHINE_RUNTIME_TRAMPOLINE): Likewise.
     4 
     5 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/dl-machine.h.diff?r1=1.82&r2=1.83&cvsroot=glibc&hideattic=0
     6 backported a bit
     7 
     8 --- glibc-2.1.3/sysdeps/i386/dl-machine.h.old	1999-02-20 10:19:47.000000000 -0800
     9 +++ glibc-2.1.3/sysdeps/i386/dl-machine.h	2004-03-05 15:56:25.000000000 -0800
    10 @@ -124,68 +124,68 @@
    11     and then redirect to the address it returns.  */
    12  #ifndef PROF
    13  # define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
    14 -	.text
    15 -	.globl _dl_runtime_resolve
    16 -	.type _dl_runtime_resolve, @function
    17 -	.align 16
    18 -_dl_runtime_resolve:
    19 -	pushl %eax		# Preserve registers otherwise clobbered.
    20 -	pushl %ecx
    21 -	pushl %edx
    22 -	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note
    23 -	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.
    24 -	call fixup		# Call resolver.
    25 -	popl %edx		# Get register content back.
    26 -	popl %ecx
    27 -	xchgl %eax, (%esp)	# Get %eax contents end store function address.
    28 -	ret $8			# Jump to function address.
    29 -	.size _dl_runtime_resolve, .-_dl_runtime_resolve
    30 -
    31 -	.globl _dl_runtime_profile
    32 -	.type _dl_runtime_profile, @function
    33 -	.align 16
    34 -_dl_runtime_profile:
    35 -	pushl %eax		# Preserve registers otherwise clobbered.
    36 -	pushl %ecx
    37 -	pushl %edx
    38 -	movl 20(%esp), %ecx	# Load return address
    39 -	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note
    40 -	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.
    41 -	call profile_fixup	# Call resolver.
    42 -	popl %edx		# Get register content back.
    43 -	popl %ecx
    44 -	xchgl %eax, (%esp)	# Get %eax contents end store function address.
    45 -	ret $8			# Jump to function address.
    46 -	.size _dl_runtime_profile, .-_dl_runtime_profile
    47 -	.previous
    48 +	.text\n\
    49 +	.globl _dl_runtime_resolve\n\
    50 +	.type _dl_runtime_resolve, @function\n\
    51 +	.align 16\n\
    52 +_dl_runtime_resolve:\n\
    53 +	pushl %eax		# Preserve registers otherwise clobbered.\n\
    54 +	pushl %ecx\n\
    55 +	pushl %edx\n\
    56 +	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note\n\
    57 +	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.\n\
    58 +	call fixup		# Call resolver.\n\
    59 +	popl %edx		# Get register content back.\n\
    60 +	popl %ecx\n\
    61 +	xchgl %eax, (%esp)	# Get %eax contents end store function address.\n\
    62 +	ret $8			# Jump to function address.\n\
    63 +	.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
    64 +\n\
    65 +	.globl _dl_runtime_profile\n\
    66 +	.type _dl_runtime_profile, @function\n\
    67 +	.align 16\n\
    68 +_dl_runtime_profile:\n\
    69 +	pushl %eax		# Preserve registers otherwise clobbered.\n\
    70 +	pushl %ecx\n\
    71 +	pushl %edx\n\
    72 +	movl 20(%esp), %ecx	# Load return address\n\
    73 +	movl 16(%esp), %edx	# Copy args pushed by PLT in register.  Note\n\
    74 +	movl 12(%esp), %eax	# that `fixup' takes its parameters in regs.\n\
    75 +	call profile_fixup	# Call resolver.\n\
    76 +	popl %edx		# Get register content back.\n\
    77 +	popl %ecx\n\
    78 +	xchgl %eax, (%esp)	# Get %eax contents end store function address.\n\
    79 +	ret $8			# Jump to function address.\n\
    80 +	.size _dl_runtime_profile, .-_dl_runtime_profile\n\
    81 +	.previous\n\
    82  ");
    83  #else
    84 -# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
    85 -	.text
    86 -	.globl _dl_runtime_resolve
    87 -	.globl _dl_runtime_profile
    88 -	.type _dl_runtime_resolve, @function
    89 -	.type _dl_runtime_profile, @function
    90 -	.align 16
    91 -_dl_runtime_resolve:
    92 -_dl_runtime_profile:
    93 -	pushl %eax		# Preserve registers otherwise clobbered.
    94 -	pushl %ecx
    95 -	pushl %edx
    96 -	movl 16(%esp), %edx	# Push the arguments for `fixup'
    97 -	movl 12(%esp), %eax
    98 -	pushl %edx
    99 -	pushl %eax
   100 -	call fixup		# Call resolver.
   101 -	popl %edx		# Pop the parameters
   102 -	popl %ecx
   103 -	popl %edx		# Get register content back.
   104 -	popl %ecx
   105 -	xchgl %eax, (%esp)	# Get %eax contents end store function address.
   106 -	ret $8			# Jump to function address.
   107 -	.size _dl_runtime_resolve, .-_dl_runtime_resolve
   108 -	.size _dl_runtime_profile, .-_dl_runtime_profile
   109 -	.previous
   110 +# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
   111 +	.text\n\
   112 +	.globl _dl_runtime_resolve\n\
   113 +	.globl _dl_runtime_profile\n\
   114 +	.type _dl_runtime_resolve, @function\n\
   115 +	.type _dl_runtime_profile, @function\n\
   116 +	.align 16\n\
   117 +_dl_runtime_resolve:\n\
   118 +_dl_runtime_profile:\n\
   119 +	pushl %eax		# Preserve registers otherwise clobbered.\n\
   120 +	pushl %ecx\n\
   121 +	pushl %edx\n\
   122 +	movl 16(%esp), %edx	# Push the arguments for `fixup'\n\
   123 +	movl 12(%esp), %eax\n\
   124 +	pushl %edx\n\
   125 +	pushl %eax\n\
   126 +	call fixup		# Call resolver.\n\
   127 +	popl %edx		# Pop the parameters\n\
   128 +	popl %ecx\n\
   129 +	popl %edx		# Get register content back.\n\
   130 +	popl %ecx\n\
   131 +	xchgl %eax, (%esp)	# Get %eax contents end store function address.\n\
   132 +	ret $8			# Jump to function address.\n\
   133 +	.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
   134 +	.size _dl_runtime_profile, .-_dl_runtime_profile\n\
   135 +	.previous\n\
   136  ");
   137  #endif
   138  
   139 @@ -197,10 +197,10 @@
   140     The C function `_dl_start' is the real entry point;
   141     its return value is the user program's entry point.  */
   142  
   143 -#define RTLD_START asm ("\
   144 -.text\n\
   145 -.globl _start\n\
   146 -.globl _dl_start_user\n\
   147 +#define RTLD_START asm ("\n\
   148 +	.text\n\
   149 +	.globl _start\n\
   150 +	.globl _dl_start_user\n\
   151  _start:\n\
   152  	pushl %esp\n\
   153  	call _dl_start\n\
   154 @@ -208,7 +208,7 @@
   155  _dl_start_user:\n\
   156  	# Save the user entry point address in %edi.\n\
   157  	movl %eax, %edi\n\
   158 -	# Point %ebx at the GOT.
   159 +	# Point %ebx at the GOT.\n\
   160  	call 0f\n\
   161  0:	popl %ebx\n\
   162  	addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx\n\
   163 @@ -255,7 +255,7 @@
   164  	movl _dl_fini@GOT(%ebx), %edx\n\
   165  	# Jump to the user's entry point.\n\
   166  	jmp *%edi\n\
   167 -.previous\n\
   168 +	.previous\n\
   169  ");
   170  
   171  /* Nonzero iff TYPE should not be allowed to resolve to one of