]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/glibc/glibc-2.2.5/dl-machine-sparc.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / glibc / glibc-2.2.5 / dl-machine-sparc.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
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
8 @@ -148,23 +148,23 @@
9     and then redirect to the address it returns.  */
10  #define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name)    \
11    asm ( "\
12 -       .text
13 -       .globl  " #tramp_name "
14 -       .type   " #tramp_name ", @function
15 -       .align  32
16 -" #tramp_name ":
17 -       /* Set up the arguments to fixup --
18 -          %o0 = link_map out of plt0
19 -          %o1 = offset of reloc entry
20 -          %o2 = return address  */
21 -       ld      [%o7 + 8], %o0
22 -       srl     %g1, 10, %o1
23 -       mov     %i7, %o2
24 -       call    " #fixup_name "
25 -        sub    %o1, 4*12, %o1
26 -       jmp     %o0
27 -        restore
28 -       .size   " #tramp_name ", . - " #tramp_name "
29 +       .text\n\
30 +       .globl  " #tramp_name "\n\
31 +       .type   " #tramp_name ", @function\n\
32 +       .align  32\n\
33 +" #tramp_name ":\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\
39 +       srl     %g1, 10, %o1\n\
40 +       mov     %i7, %o2\n\
41 +       call    " #fixup_name "\n\
42 +        sub    %o1, 4*12, %o1\n\
43 +       jmp     %o0\n\
44 +        restore\n\
45 +       .size   " #tramp_name ", . - " #tramp_name "\n\
46         .previous")
47  
48  #ifndef PROF
49 @@ -199,96 +199,96 @@
50     its return value is the user program's entry point.  */
51  
52  #define RTLD_START __asm__ ("\
53 -       .text
54 -       .globl  _start
55 -       .type   _start, @function
56 -       .align  32
57 -_start:
58 -  /* Allocate space for functions to drop their arguments.  */
59 -       sub     %sp, 6*4, %sp
60 -  /* Pass pointer to argument block to _dl_start.  */
61 -       call    _dl_start
62 -        add    %sp, 22*4, %o0
63 -       /* FALTHRU */
64 -       .globl  _dl_start_user
65 -       .type   _dl_start_user, @function
66 -_dl_start_user:
67 -  /* Load the PIC register.  */
68 -1:     call    2f
69 -        sethi  %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
70 -2:     or      %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
71 -       add     %l7, %o7, %l7
72 -  /* Save the user entry point address in %l0 */
73 -       mov     %o0, %l0
74 -  /* Store the highest stack address.  */
75 -       sethi   %hi(__libc_stack_end), %g2
76 -       or      %g2, %lo(__libc_stack_end), %g2
77 -       ld      [%l7 + %g2], %l1
78 -       sethi   %hi(_dl_skip_args), %g2
79 -       add     %sp, 6*4, %l2
80 -       or      %g2, %lo(_dl_skip_args), %g2
81 -       st      %l2, [%l1]
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.  */
84 -       ld      [%l7+%g2], %i0
85 -       ld      [%i0], %i0
86 -       tst     %i0
87 -       beq     3f
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
92 -       ld      [%l7+%l3], %l3
93 -       sub     %i5, %i0, %i5
94 -       ld      [%l3], %l4
95 -       sll     %i0, 2, %i2
96 -       st      %i5, [%sp+22*4]
97 -       sub     %l4, %i2, %l4
98 -       add     %sp, 23*4, %i1
99 -       add     %i1, %i2, %i2
100 -       st      %l4, [%l3]
101 -       /* Copy down argv */
102 -21:    ld      [%i2], %i3
103 -       add     %i2, 4, %i2
104 -       tst     %i3
105 -       st      %i3, [%i1]
106 -       bne     21b
107 -        add    %i1, 4, %i1
108 -       /* Copy down env */
109 -22:    ld      [%i2], %i3
110 -       add     %i2, 4, %i2
111 -       tst     %i3
112 -       st      %i3, [%i1]
113 -       bne     22b
114 -        add    %i1, 4, %i1
115 -       /* Copy down auxiliary table.  */
116 -23:    ld      [%i2], %i3
117 -       ld      [%i2+4], %i4
118 -       add     %i2, 8, %i2
119 -       tst     %i3
120 -       st      %i3, [%i1]
121 -       st      %i4, [%i1+4]
122 -       bne     23b
123 -        add    %i1, 8, %i1
124 -  /* %o0 = _dl_loaded, %o1 = argc, %o2 = argv, %o3 = envp.  */
125 -3:     sethi   %hi(_dl_loaded), %o0
126 -       add     %sp, 23*4, %o2
127 -       orcc    %o0, %lo(_dl_loaded), %o0
128 -       sll     %i5, 2, %o3
129 -       ld      [%l7+%o0], %o0
130 -       add     %o3, 4, %o3
131 -       mov     %i5, %o1
132 -       add     %o2, %o3, %o3
133 -       call    _dl_init
134 -        ld     [%o0], %o0
135 -  /* Pass our finalizer function to the user in %g1.  */
136 -       sethi   %hi(_dl_fini), %g1
137 -       or      %g1, %lo(_dl_fini), %g1
138 -       ld      [%l7+%g1], %g1
139 -  /* Jump to the user's entry point and deallocate the extra stack we got.  */
140 -       jmp     %l0
141 -        add    %sp, 6*4, %sp
142 -       .size   _dl_start_user, . - _dl_start_user
143 +       .text\n\
144 +       .globl  _start\n\
145 +       .type   _start, @function\n\
146 +       .align  32\n\
147 +_start:\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\
151 +       call    _dl_start\n\
152 +        add    %sp, 22*4, %o0\n\
153 +       /* FALTHRU */\n\
154 +       .globl  _dl_start_user\n\
155 +       .type   _dl_start_user, @function\n\
156 +_dl_start_user:\n\
157 +  /* Load the PIC register.  */\n\
158 +1:     call    2f\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\
163 +       mov     %o0, %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\
171 +       st      %l2, [%l1]\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\
175 +       ld      [%i0], %i0\n\
176 +       tst     %i0\n\
177 +       beq     3f\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\
184 +       ld      [%l3], %l4\n\
185 +       sll     %i0, 2, %i2\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\
190 +       st      %l4, [%l3]\n\
191 +       /* Copy down argv */\n\
192 +21:    ld      [%i2], %i3\n\
193 +       add     %i2, 4, %i2\n\
194 +       tst     %i3\n\
195 +       st      %i3, [%i1]\n\
196 +       bne     21b\n\
197 +        add    %i1, 4, %i1\n\
198 +       /* Copy down env */\n\
199 +22:    ld      [%i2], %i3\n\
200 +       add     %i2, 4, %i2\n\
201 +       tst     %i3\n\
202 +       st      %i3, [%i1]\n\
203 +       bne     22b\n\
204 +        add    %i1, 4, %i1\n\
205 +       /* Copy down auxiliary table.  */\n\
206 +23:    ld      [%i2], %i3\n\
207 +       ld      [%i2+4], %i4\n\
208 +       add     %i2, 8, %i2\n\
209 +       tst     %i3\n\
210 +       st      %i3, [%i1]\n\
211 +       st      %i4, [%i1+4]\n\
212 +       bne     23b\n\
213 +        add    %i1, 8, %i1\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\
218 +       sll     %i5, 2, %o3\n\
219 +       ld      [%l7+%o0], %o0\n\
220 +       add     %o3, 4, %o3\n\
221 +       mov     %i5, %o1\n\
222 +       add     %o2, %o3, %o3\n\
223 +       call    _dl_init\n\
224 +        ld     [%o0], %o0\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\
230 +       jmp     %l0\n\
231 +        add    %sp, 6*4, %sp\n\
232 +       .size   _dl_start_user, . - _dl_start_user\n\
233         .previous");
234  
235  static inline Elf32_Addr