Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mysql-extras:master commit in: /
Date: Tue, 26 Apr 2011 09:52:04
Message-Id: 0a625e604209ffa117ca42c91a70cc2f722c15c1.robbat2@gentoo
1 commit: 0a625e604209ffa117ca42c91a70cc2f722c15c1
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 26 09:51:49 2011 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 26 09:51:49 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mysql-extras.git;a=commit;h=0a625e60
7
8 Avoiding more patch problems with case insensitive systems.
9
10 ---
11 07341_all_mysql-5.1.56_hardened_x86_strings.patch | 420 ---------------------
12 1 files changed, 0 insertions(+), 420 deletions(-)
13
14 diff --git a/07341_all_mysql-5.1.56_hardened_x86_strings.patch b/07341_all_mysql-5.1.56_hardened_x86_strings.patch
15 index 1e25fd6..4bf44ae 100644
16 --- a/07341_all_mysql-5.1.56_hardened_x86_strings.patch
17 +++ b/07341_all_mysql-5.1.56_hardened_x86_strings.patch
18 @@ -87,426 +87,6 @@ diff -Nuar --exclude '*.orig' mysql.orig//strings/Makefile.in mysql//strings/Mak
19 longlong2str.c longlong2str-x86.s longlong2str_asm.c \
20 my_strtoll10.c my_strtoll10-x86.s \
21 strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
22 -diff -Nuar --exclude '*.orig' mysql.orig//strings/strings-x86.s mysql//strings/strings-x86.s
23 ---- mysql.orig//strings/strings-x86.s 2011-02-11 19:20:41.000000000 +0000
24 -+++ mysql//strings/strings-x86.s 1970-01-01 00:00:00.000000000 +0000
25 -@@ -1,416 +0,0 @@
26 --# Copyright (C) 2000 MySQL AB
27 --# This program is free software; you can redistribute it and/or modify
28 --# it under the terms of the GNU General Public License as published by
29 --# the Free Software Foundation; version 2 of the License.
30 --#
31 --# This program is distributed in the hope that it will be useful,
32 --# but WITHOUT ANY WARRANTY; without even the implied warranty of
33 --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 --# GNU General Public License for more details.
35 --#
36 --# You should have received a copy of the GNU General Public License
37 --# along with this program; if not, write to the Free Software
38 --# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 --
40 --# Optimized string functions Intel 80x86 (gcc/gas syntax)
41 --
42 -- .file "strings.s"
43 -- .version "1.00"
44 --
45 --.text
46 --
47 --# Move a alligned, not overlapped, by (long) divided memory area
48 --# Args: to,from,length
49 --
50 --.globl bmove_align
51 -- .type bmove_align,@function
52 --bmove_align:
53 -- movl %edi,%edx
54 -- push %esi
55 -- movl 4(%esp),%edi # to
56 -- movl 8(%esp),%esi # from
57 -- movl 12(%esp),%ecx # length
58 -- addw $3,%cx # fix if not divisible with long
59 -- shrw $2,%cx
60 -- jz .ba_20
61 -- .p2align 4,,7
62 --.ba_10:
63 -- movl -4(%esi,%ecx),%eax
64 -- movl %eax,-4(%edi,%ecx)
65 -- decl %ecx
66 -- jnz .ba_10
67 --.ba_20: pop %esi
68 -- movl %edx,%edi
69 -- ret
70 --
71 --.bmove_align_end:
72 -- .size bmove_align,.bmove_align_end-bmove_align
73 --
74 -- # Move a string from higher to lower
75 -- # Arg from_end+1,to_end+1,length
76 --
77 --.globl bmove_upp
78 -- .type bmove_upp,@function
79 --bmove_upp:
80 -- movl %edi,%edx # Remember %edi
81 -- push %esi
82 -- movl 8(%esp),%edi # dst
83 -- movl 16(%esp),%ecx # length
84 -- movl 12(%esp),%esi # source
85 -- test %ecx,%ecx
86 -- jz .bu_20
87 -- subl %ecx,%esi # To start of strings
88 -- subl %ecx,%edi
89 --
90 -- .p2align 4,,7
91 --.bu_10: movb -1(%esi,%ecx),%al
92 -- movb %al,-1(%edi,%ecx)
93 -- decl %ecx
94 -- jnz .bu_10
95 --.bu_20: pop %esi
96 -- movl %edx,%edi
97 -- ret
98 --
99 --.bmove_upp_end:
100 -- .size bmove_upp,.bmove_upp_end-bmove_upp
101 --
102 -- # Append fillchars to string
103 -- # Args: dest,len,fill
104 --
105 --.globl strappend
106 -- .type strappend,@function
107 --strappend:
108 -- pushl %edi
109 -- movl 8(%esp),%edi # Memory pointer
110 -- movl 12(%esp),%ecx # Length
111 -- clrl %eax # Find end of string
112 -- repne
113 -- scasb
114 -- jnz sa_99 # String to long, shorten it
115 -- movzb 16(%esp),%eax # Fillchar
116 -- decl %edi # Point at end null
117 -- incl %ecx # rep made one dec for null-char
118 --
119 -- movb %al,%ah # (2) Set up a 32 bit pattern.
120 -- movw %ax,%dx # (2)
121 -- shll $16,%eax # (3)
122 -- movw %dx,%ax # (2) %eax has the 32 bit pattern.
123 --
124 -- movl %ecx,%edx # (2) Save the count of bytes.
125 -- shrl $2,%ecx # (2) Number of dwords.
126 -- rep
127 -- stosl # (5 + 5n)
128 -- movb $3,%cl # (2)
129 -- and %edx,%ecx # (2) Fill in the odd bytes
130 -- rep
131 -- stosb # Move last bytes if any
132 --
133 --sa_99: movb $0,(%edi) # End of string
134 -- popl %edi
135 -- ret
136 --.strappend_end:
137 -- .size strappend,.strappend_end-strappend
138 --
139 -- # Find if string contains any char in another string
140 -- # Arg: str,set
141 -- # Ret: Pointer to first found char in str
142 --
143 --.globl strcont
144 -- .type strcont,@function
145 --strcont:
146 -- movl %edi,%edx
147 -- pushl %esi
148 -- movl 8(%esp),%esi # str
149 -- movl 12(%esp),%ecx # set
150 -- clrb %ah # For endtest
151 -- jmp sc_60
152 --
153 --sc_10: scasb
154 -- jz sc_fo # Found char
155 --sc_20: cmp (%edi),%ah # Test if null
156 -- jnz sc_10 # Not end of set yet
157 -- incl %esi # Next char in str
158 --sc_60: movl %ecx,%edi # %edi = Set
159 -- movb (%esi),%al # Test if this char exist
160 -- andb %al,%al
161 -- jnz sc_20 # Not end of string
162 -- clrl %esi # Return Null
163 --sc_fo: movl %esi,%eax # Char found here
164 -- movl %edx,%edi # Restore
165 -- popl %esi
166 -- ret
167 --.strcont_end:
168 -- .size strcont,.strcont_end-strcont
169 --
170 -- # Find end of string
171 -- # Arg: str
172 -- # ret: Pointer to end null
173 --
174 --.globl strend
175 -- .type strend,@function
176 --strend:
177 -- movl %edi,%edx # Save
178 -- movl 4(%esp),%edi # str
179 -- clrl %eax # Find end of string
180 -- movl %eax,%ecx
181 -- decl %ecx # ECX = -1
182 -- repne
183 -- scasb
184 -- movl %edi,%eax
185 -- decl %eax # End of string
186 -- movl %edx,%edi # Restore
187 -- ret
188 --.strend_end:
189 -- .size strend,.strend_end-strend
190 --
191 -- # Make a string with len fill-chars and endnull
192 -- # Args: dest,len,fill
193 -- # Ret: dest+len
194 --
195 --.globl strfill
196 -- .type strfill,@function
197 --strfill:
198 -- pushl %edi
199 -- movl 8(%esp),%edi # Memory pointer
200 -- movl 12(%esp),%ecx # Length
201 -- movzb 16(%esp),%eax # Fill
202 --
203 -- movb %al,%ah # (2) Set up a 32 bit pattern
204 -- movw %ax,%dx # (2)
205 -- shll $16,%eax # (3)
206 -- movw %dx,%ax # (2) %eax has the 32 bit pattern.
207 --
208 -- movl %ecx,%edx # (2) Save the count of bytes.
209 -- shrl $2,%ecx # (2) Number of dwords.
210 -- rep
211 -- stosl # (5 + 5n)
212 -- movb $3,%cl # (2)
213 -- and %edx,%ecx # (2) Fill in the odd bytes
214 -- rep
215 -- stosb # Move last bytes if any
216 --
217 -- movb %cl,(%edi) # End NULL
218 -- movl %edi,%eax # End i %eax
219 -- popl %edi
220 -- ret
221 --.strfill_end:
222 -- .size strfill,.strfill_end-strfill
223 --
224 --
225 -- # Find a char in or end of a string
226 -- # Arg: str,char
227 -- # Ret: pointer to found char or NullS
228 --
229 --.globl strcend
230 -- .type strcend,@function
231 --strcend:
232 -- movl %edi,%edx
233 -- movl 4(%esp),%edi # str
234 -- movb 8(%esp),%ah # search
235 -- clrb %al # for scasb to find end
236 --
237 --se_10: cmpb (%edi),%ah
238 -- jz se_20 # Found char
239 -- scasb
240 -- jnz se_10 # Not end
241 -- dec %edi # Not found, point at end of string
242 --se_20: movl %edi,%eax
243 -- movl %edx,%edi # Restore
244 -- ret
245 --.strcend_end:
246 -- .size strcend,.strcend_end-strcend
247 --
248 -- # Test if string has a given suffix
249 --
250 --.globl is_prefix
251 -- .type is_prefix,@function
252 --is_prefix:
253 -- movl %edi,%edx # Save %edi
254 -- pushl %esi # and %esi
255 -- movl 12(%esp),%esi # get suffix
256 -- movl 8(%esp),%edi # s1
257 -- movl $1,%eax # Ok and zero-test
258 --ip_10: cmpb (%esi),%ah
259 -- jz suf_ok # End of string/ found suffix
260 -- cmpsb # Compare strings
261 -- jz ip_10 # Same, possible prefix
262 -- xor %eax,%eax # Not suffix
263 --suf_ok: popl %esi
264 -- movl %edx,%edi
265 -- ret
266 --.is_prefix_end:
267 -- .size is_prefix,.is_prefix_end-is_prefix
268 --
269 -- # Find a substring in string
270 -- # Arg: str,search
271 --
272 --.globl strstr
273 -- .type strstr,@function
274 --
275 --strstr:
276 -- pushl %edi
277 -- pushl %esi
278 -- movl 12(%esp),%esi # str
279 -- movl 16(%esp),%edi # search
280 -- movl %edi,%ecx
281 -- incl %ecx # %ecx = search+1
282 -- movb (%edi),%ah # %ah = First char in search
283 -- jmp sf_10
284 --
285 --sf_00: movl %edx,%esi # si = Current str-pos
286 --sf_10: movb (%esi),%al # Test if this char exist
287 -- andb %al,%al
288 -- jz sf_90 # End of string, didn't find search
289 -- incl %esi
290 -- cmpb %al,%ah
291 -- jnz sf_10 # Didn't find first char, continue
292 -- movl %esi,%edx # Save str-pos in %edx
293 -- movl %ecx,%edi
294 --sf_20: cmpb $0,(%edi)
295 -- jz sf_fo # Found substring
296 -- cmpsb
297 -- jz sf_20 # Char ok
298 -- jmp sf_00 # Next str-pos
299 --
300 --sf_90: movl $1,%edx # Return Null
301 --sf_fo: movl %edx,%eax # Char found here
302 -- decl %eax # Pointed one after
303 -- popl %esi
304 -- popl %edi
305 -- ret
306 --.strstr_end:
307 -- .size strstr,.strstr_end-strstr
308 --
309 --
310 -- # Find a substring in string, return index
311 -- # Arg: str,search
312 --
313 --.globl strinstr
314 -- .type strinstr,@function
315 --
316 --strinstr:
317 -- pushl %ebp
318 -- movl %esp,%ebp
319 -- pushl 12(%ebp) # search
320 -- pushl 8(%ebp) # str
321 -- call strstr
322 -- add $8,%esp
323 -- or %eax,%eax
324 -- jz si_99 # Not found, return NULL
325 -- sub 8(%ebp),%eax # Pos from start
326 -- inc %eax # And first pos = 1
327 --si_99: popl %ebp
328 -- ret
329 --.strinstr_end:
330 -- .size strinstr,.strinstr_end-strinstr
331 --
332 -- # Make a string of len length from another string
333 -- # Arg: dst,src,length
334 -- # ret: end of dst
335 --
336 --.globl strmake
337 -- .type strmake,@function
338 --
339 --strmake:
340 -- pushl %edi
341 -- pushl %esi
342 -- mov 12(%esp),%edi # dst
343 -- movl $0,%edx
344 -- movl 20(%esp),%ecx # length
345 -- movl 16(%esp),%esi # src
346 -- cmpl %edx,%ecx
347 -- jz sm_90
348 --sm_00: movb (%esi,%edx),%al
349 -- cmpb $0,%al
350 -- jz sm_90
351 -- movb %al,(%edi,%edx)
352 -- incl %edx
353 -- cmpl %edx,%ecx
354 -- jnz sm_00
355 --sm_90: movb $0,(%edi,%edx)
356 --sm_99: lea (%edi,%edx),%eax # Return pointer to end null
357 -- pop %esi
358 -- pop %edi
359 -- ret
360 --.strmake_end:
361 -- .size strmake,.strmake_end-strmake
362 --
363 -- # Move a string with max len chars
364 -- # arg: dst,src,len
365 -- # ret: pos to first null or dst+len
366 --
367 --.globl strnmov
368 -- .type strnmov,@function
369 --strnmov:
370 -- pushl %edi
371 -- pushl %esi
372 -- movl 12(%esp),%edi # dst
373 -- movl 16(%esp),%esi # src
374 -- movl 20(%esp),%ecx # Length of memory-area
375 -- jecxz snm_99 # Nothing to do
376 -- clrb %al # For test of end-null
377 --
378 --snm_10: cmpb (%esi),%al # Next char to move
379 -- movsb # move arg
380 -- jz snm_20 # last char, fill with null
381 -- loop snm_10 # Continue moving
382 -- incl %edi # Point two after last
383 --snm_20: decl %edi # Point at first null (or last+1)
384 --snm_99: movl %edi,%eax # Pointer at last char
385 -- popl %esi
386 -- popl %edi
387 -- ret
388 --.strnmov_end:
389 -- .size strnmov,.strnmov_end-strnmov
390 --
391 --
392 --.globl strmov
393 -- .type strmov,@function
394 --strmov:
395 -- movl %esi,%ecx # Save old %esi and %edi
396 -- movl %edi,%edx
397 -- movl 8(%esp),%esi # get source pointer (s2)
398 -- movl 4(%esp),%edi # %edi -> s1
399 --smo_10: movb (%esi),%al
400 -- movsb # move arg
401 -- andb %al,%al
402 -- jnz smo_10 # Not last
403 -- movl %edi,%eax
404 -- dec %eax
405 -- movl %ecx,%esi # Restore
406 -- movl %edx,%edi
407 -- ret
408 --.strmov_end:
409 -- .size strmov,.strmov_end-strmov
410 --
411 --.globl strxmov
412 -- .type strxmov,@function
413 --strxmov:
414 -- movl %ebx,%edx # Save %ebx, %esi and %edi
415 -- mov %esi,%ecx
416 -- push %edi
417 -- leal 8(%esp),%ebx # Get destination
418 -- movl (%ebx),%edi
419 -- xorb %al,%al
420 -- jmp next_str # Handle source ebx+4
421 --
422 --start_str:
423 -- movsb
424 -- cmpb -1(%edi),%al
425 -- jne start_str
426 -- decl %edi # Don't copy last null
427 --
428 --next_str:
429 -- addl $4,%ebx
430 -- movl (%ebx),%esi
431 -- orl %esi,%esi
432 -- jne start_str
433 -- movb %al,0(%edi) # Force last to ASCII 0
434 --
435 -- movl %edi,%eax # Return ptr to ASCII 0
436 -- pop %edi # Restore registers
437 -- movl %ecx,%esi
438 -- movl %edx,%ebx
439 -- ret
440 --.strxmov_end:
441 -- .size strxmov,.strxmov_end-strxmov
442 diff -Nuar --exclude '*.orig' mysql.orig//strings/strings-x86.S mysql//strings/strings-x86.S
443 --- mysql.orig//strings/strings-x86.S 1970-01-01 00:00:00.000000000 +0000
444 +++ mysql//strings/strings-x86.S 2011-04-17 22:35:39.806527767 +0000