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