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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
###MY_VER_RANGE [4.1,4.1.13-r1)
diff -Nurp mysql/strings/longlong2str-x86.s mysql-fixed/strings/longlong2str-x86.s
--- mysql/strings/longlong2str-x86.s 2005-05-13 12:32:11.000000000 +0100
+++ mysql-fixed/strings/longlong2str-x86.s 2005-05-25 01:19:32.000000000 +0100
@@ -19,6 +19,13 @@
.file "longlong2str.s"
.version "1.01"
+ .section .rodata
+ .align 32
+ .type _dig_vec_upper, @object
+ .size _dig_vec_upper, 37
+_dig_vec_upper:
+ .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,13 +87,13 @@ 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)
decl %ecx
movl %eax,%esi # quotent in ebp:esi
- movb _dig_vec_upper(%edx),%al # al is faster than dl
+ movb _dig_vec_upper@GOTOFF(%ebx,%edx),%al # al is faster than dl
movb %al,(%ecx) # store value in buff
.align 4
.L155:
@@ -93,14 +103,13 @@ longlong2str:
jl .L153
je .L10_mov # Ready
movl %esi,%eax
- movl $_dig_vec_upper,%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_upper@GOTOFF(%ebx,%edx),%dl
testl %eax,%eax
movb %dl,(%ecx)
jne .L154
@@ -137,9 +146,6 @@ longlong2str:
#
.align 4
-.Ltmp:
- .long 0xcccccccd
- .align 4
.globl longlong10_to_str
.type longlong10_to_str,@function
@@ -202,7 +208,7 @@ longlong10_to_str:
# The following code uses some tricks to change division by 10 to
# multiplication and shifts
- movl .Ltmp,%esi # set %esi to 0xcccccccd
+ movl $0xcccccccd,%esi # set %esi to 0xcccccccd
.L10_40:
movl %ebx,%eax
@@ -221,3 +227,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/strings/my_strtoll10-x86.s mysql-fixed/strings/my_strtoll10-x86.s
--- mysql/strings/my_strtoll10-x86.s 2005-05-13 12:32:22.000000000 +0100
+++ mysql-fixed/strings/my_strtoll10-x86.s 2005-05-25 01:13:23.000000000 +0100
@@ -18,7 +18,7 @@
.file "my_strtoll10-x86.s"
.version "01.01"
-.data
+.section .rodata
.align 32
.type lfactor,@object
.size lfactor,36
@@ -315,7 +315,11 @@ my_strtoll10:
.Lend_i_and_j:
movl %esi,%ecx
subl -12(%ebp),%ecx # ecx= number of digits in second part
- movl lfactor(,%ecx,4),%eax
+
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_,%ebx
+
+ movl lfactor@GOTOFF(%ebx,%ecx,4),%eax
jmp .L523
# Return -8(%ebp) * $1000000000 + edi
@@ -400,3 +404,13 @@ my_strtoll10:
.comm end_ptr,120,32
.comm error,120,32
.ident "Monty"
+
+ .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/strings/strings-x86.s mysql-fixed/strings/strings-x86.s
--- mysql/strings/strings-x86.s 2005-05-13 12:32:40.000000000 +0100
+++ mysql-fixed/strings/strings-x86.s 2005-05-23 23:19:13.000000000 +0100
@@ -415,3 +415,5 @@ next_str:
ret
.strxmov_end:
.size strxmov,.strxmov_end-strxmov
+
+ .section .note.GNU-stack,"",@progbits
|