1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
###MY_VER_RANGE [4.0.24,4.1_alpha)
--- mysql-4.0.24/strings/longlong2str-x86.s 2005-03-05 00:38:14.000000000 +0000
+++ mysql-4.0.24-fixed/strings/longlong2str-x86.s 2005-05-17 01:37:52.000000000 +0100
@@ -19,6 +19,13 @@
.file "longlong2str.s"
.version "1.01"
+ .section .rodata
+ .align 32
+ .type _dig_vec, @object
+ .size _dig_vec, 37
+_dig_vec:
+ .string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
.text
.align 4
@@ -31,11 +38,14 @@ longlong2str:
pushl %esi
pushl %edi
pushl %ebx
+
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_,%ebx
+
movl 100(%esp),%esi # Lower part of val
movl 104(%esp),%ebp # Higher part of val
movl 108(%esp),%edi # get dst
- movl 112(%esp),%ebx # Radix
- movl %ebx,%eax
+ movl 112(%esp),%eax # Radix
testl %eax,%eax
jge .L144
@@ -50,7 +60,7 @@ longlong2str:
adcl $0,%ebp
negl %ebp
.L146:
- negl %ebx # Change radix to positive
+ negl 112(%esp) # Change radix to positive
jmp .L148
.align 4
.L144:
@@ -77,12 +87,12 @@ longlong2str:
movl %ebp,%eax # High part of value
xorl %edx,%edx
- divl %ebx
+ divl 112(%esp)
movl %eax,%ebp
movl %esi,%eax
- divl %ebx
+ divl 112(%esp)
movl %eax,%esi # quotent in ebp:esi
- movb _dig_vec(%edx),%al # al is faster than dl
+ movb _dig_vec@GOTOFF(%ebx,%edx),%al # al is faster than dl
decl %ecx
movb %al,(%ecx) # store value in buff
.align 4
@@ -93,14 +103,13 @@ longlong2str:
jl .L153
je .L160 # Ready
movl %esi,%eax
- movl $_dig_vec,%ebp
.align 4
.L154: # Do rest with integer precision
cltd
- divl %ebx
+ divl 112(%esp)
decl %ecx
- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36
+ movb _dig_vec@GOTOFF(%ebx,%edx),%dl
testl %eax,%eax
movb %dl,(%ecx)
jne .L154
@@ -138,3 +147,13 @@ longlong10_to_str:
.L10end:
.size longlong10_to_str,.L10end-longlong10_to_str
+
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+.globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .type __i686.get_pc_thunk.bx, @function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+ .section .note.GNU-stack,"",@progbits
diff -Nurp mysql-4.0.24/strings/strings-x86.s mysql-4.0.24-fixed/strings/strings-x86.s
--- mysql-4.0.24/strings/strings-x86.s 2005-03-05 00:38:15.000000000 +0000
+++ mysql-4.0.24-fixed/strings/strings-x86.s 2005-05-17 01:37:47.000000000 +0100
@@ -403,3 +403,5 @@ next_str:
ret
.strxmov_end:
.size strxmov,.strxmov_end-strxmov
+
+ .section .note.GNU-stack,"",@progbits
|