3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 --- glibc-2.2.5/sysdeps/sparc/sparc32/dl-machine.h~dl-machine-sparc.patch 2004-09-03 19:00:33.000000000 -0500
7 +++ glibc-2.2.5/sysdeps/sparc/sparc32/dl-machine.h 2004-09-03 19:00:37.000000000 -0500
9 and then redirect to the address it returns. */
10 #define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \
13 - .globl " #tramp_name "
14 - .type " #tramp_name ", @function
17 - /* Set up the arguments to fixup --
18 - %o0 = link_map out of plt0
19 - %o1 = offset of reloc entry
20 - %o2 = return address */
24 - call " #fixup_name "
28 - .size " #tramp_name ", . - " #tramp_name "
30 + .globl " #tramp_name "\n\
31 + .type " #tramp_name ", @function\n\
34 + /* Set up the arguments to fixup --\n\
35 + %o0 = link_map out of plt0\n\
36 + %o1 = offset of reloc entry\n\
37 + %o2 = return address */\n\
38 + ld [%o7 + 8], %o0\n\
41 + call " #fixup_name "\n\
42 + sub %o1, 4*12, %o1\n\
45 + .size " #tramp_name ", . - " #tramp_name "\n\
50 its return value is the user program's entry point. */
52 #define RTLD_START __asm__ ("\
55 - .type _start, @function
58 - /* Allocate space for functions to drop their arguments. */
60 - /* Pass pointer to argument block to _dl_start. */
64 - .globl _dl_start_user
65 - .type _dl_start_user, @function
67 - /* Load the PIC register. */
69 - sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
70 -2: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
72 - /* Save the user entry point address in %l0 */
74 - /* Store the highest stack address. */
75 - sethi %hi(__libc_stack_end), %g2
76 - or %g2, %lo(__libc_stack_end), %g2
78 - sethi %hi(_dl_skip_args), %g2
80 - or %g2, %lo(_dl_skip_args), %g2
82 - /* See if we were run as a command with the executable file name as an
83 - extra leading argument. If so, adjust the contents of the stack. */
88 - ld [%sp+22*4], %i5 /* load argc */
89 - /* Find out how far to shift. */
90 - sethi %hi(_dl_argv), %l3
91 - or %l3, %lo(_dl_argv), %l3
101 - /* Copy down argv */
108 - /* Copy down env */
115 - /* Copy down auxiliary table. */
124 - /* %o0 = _dl_loaded, %o1 = argc, %o2 = argv, %o3 = envp. */
125 -3: sethi %hi(_dl_loaded), %o0
127 - orcc %o0, %lo(_dl_loaded), %o0
135 - /* Pass our finalizer function to the user in %g1. */
136 - sethi %hi(_dl_fini), %g1
137 - or %g1, %lo(_dl_fini), %g1
139 - /* Jump to the user's entry point and deallocate the extra stack we got. */
142 - .size _dl_start_user, . - _dl_start_user
145 + .type _start, @function\n\
148 + /* Allocate space for functions to drop their arguments. */\n\
149 + sub %sp, 6*4, %sp\n\
150 + /* Pass pointer to argument block to _dl_start. */\n\
152 + add %sp, 22*4, %o0\n\
154 + .globl _dl_start_user\n\
155 + .type _dl_start_user, @function\n\
157 + /* Load the PIC register. */\n\
159 + sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7\n\
160 +2: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7\n\
161 + add %l7, %o7, %l7\n\
162 + /* Save the user entry point address in %l0 */\n\
164 + /* Store the highest stack address. */\n\
165 + sethi %hi(__libc_stack_end), %g2\n\
166 + or %g2, %lo(__libc_stack_end), %g2\n\
167 + ld [%l7 + %g2], %l1\n\
168 + sethi %hi(_dl_skip_args), %g2\n\
169 + add %sp, 6*4, %l2\n\
170 + or %g2, %lo(_dl_skip_args), %g2\n\
172 + /* See if we were run as a command with the executable file name as an\n\
173 + extra leading argument. If so, adjust the contents of the stack. */\n\
174 + ld [%l7+%g2], %i0\n\
178 + ld [%sp+22*4], %i5 /* load argc */\n\
179 + /* Find out how far to shift. */\n\
180 + sethi %hi(_dl_argv), %l3\n\
181 + or %l3, %lo(_dl_argv), %l3\n\
182 + ld [%l7+%l3], %l3\n\
183 + sub %i5, %i0, %i5\n\
186 + st %i5, [%sp+22*4]\n\
187 + sub %l4, %i2, %l4\n\
188 + add %sp, 23*4, %i1\n\
189 + add %i1, %i2, %i2\n\
191 + /* Copy down argv */\n\
192 +21: ld [%i2], %i3\n\
198 + /* Copy down env */\n\
199 +22: ld [%i2], %i3\n\
205 + /* Copy down auxiliary table. */\n\
206 +23: ld [%i2], %i3\n\
214 + /* %o0 = _dl_loaded, %o1 = argc, %o2 = argv, %o3 = envp. */\n\
215 +3: sethi %hi(_dl_loaded), %o0\n\
216 + add %sp, 23*4, %o2\n\
217 + orcc %o0, %lo(_dl_loaded), %o0\n\
219 + ld [%l7+%o0], %o0\n\
222 + add %o2, %o3, %o3\n\
225 + /* Pass our finalizer function to the user in %g1. */\n\
226 + sethi %hi(_dl_fini), %g1\n\
227 + or %g1, %lo(_dl_fini), %g1\n\
228 + ld [%l7+%g1], %g1\n\
229 + /* Jump to the user's entry point and deallocate the extra stack we got. */\n\
231 + add %sp, 6*4, %sp\n\
232 + .size _dl_start_user, . - _dl_start_user\n\
235 static inline Elf32_Addr