Codebase list openssl / 8697856
* pic.patch: upstream made OPENSSL_ia32cap_P hidden on amd64, no need to access it PIC anymore. * pic.patch: Make OPENSSL_ia32cap_P hidden on i386 too (Closes: #663977) Kurt Roeckx 12 years ago
2 changed file(s) with 72 addition(s) and 74 deletion(s). Raw diff Collapse all Expand all
66 the new functions.
77 * Disable modexp512-x86_64 and the new RSAX internal engine for now, the
88 perl script to generate modexp512-x86_64 has some problems.
9
9 * pic.patch: upstream made OPENSSL_ia32cap_P hidden on amd64, no need to
10 access it PIC anymore.
11 * pic.patch: Make OPENSSL_ia32cap_P hidden on i386 too (Closes: #663977)
1012
1113 -- Kurt Roeckx <kurt@roeckx.be> Sat, 17 Mar 2012 12:19:07 +0100
1214
00 Index: openssl-1.0.1/crypto/Makefile
11 ===================================================================
2 --- openssl-1.0.1.orig/crypto/Makefile 2011-12-10 01:37:55.000000000 +0000
3 +++ openssl-1.0.1/crypto/Makefile 2012-03-17 09:29:15.000000000 +0000
2 --- openssl-1.0.1.orig/crypto/Makefile 2011-12-10 02:37:55.000000000 +0100
3 +++ openssl-1.0.1/crypto/Makefile 2012-03-17 14:03:25.000000000 +0100
44 @@ -60,7 +60,7 @@
55 echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
66 echo '#endif' ) >buildinf.h
2121 pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
2222 Index: openssl-1.0.1/crypto/x86_64cpuid.pl
2323 ===================================================================
24 --- openssl-1.0.1.orig/crypto/x86_64cpuid.pl 2011-11-14 21:01:16.000000000 +0000
25 +++ openssl-1.0.1/crypto/x86_64cpuid.pl 2012-03-17 09:20:04.000000000 +0000
24 --- openssl-1.0.1.orig/crypto/x86_64cpuid.pl 2011-11-14 22:01:16.000000000 +0100
25 +++ openssl-1.0.1/crypto/x86_64cpuid.pl 2012-03-17 14:03:25.000000000 +0100
2626 @@ -20,7 +20,11 @@
2727 .extern OPENSSL_cpuid_setup
2828 .hidden OPENSSL_cpuid_setup
3737 .comm OPENSSL_ia32cap_P,8,4
3838 Index: openssl-1.0.1/crypto/des/asm/desboth.pl
3939 ===================================================================
40 --- openssl-1.0.1.orig/crypto/des/asm/desboth.pl 2001-10-24 21:20:56.000000000 +0000
41 +++ openssl-1.0.1/crypto/des/asm/desboth.pl 2012-03-17 09:20:04.000000000 +0000
40 --- openssl-1.0.1.orig/crypto/des/asm/desboth.pl 2001-10-24 23:20:56.000000000 +0200
41 +++ openssl-1.0.1/crypto/des/asm/desboth.pl 2012-03-17 14:03:25.000000000 +0100
4242 @@ -16,6 +16,11 @@
4343
4444 &push("edi");
7878 &mov($L,&DWP(0,"ebx","",0));
7979 Index: openssl-1.0.1/crypto/rc4/Makefile
8080 ===================================================================
81 --- openssl-1.0.1.orig/crypto/rc4/Makefile 2011-11-14 20:42:21.000000000 +0000
82 +++ openssl-1.0.1/crypto/rc4/Makefile 2012-03-17 09:20:04.000000000 +0000
81 --- openssl-1.0.1.orig/crypto/rc4/Makefile 2011-11-14 21:42:21.000000000 +0100
82 +++ openssl-1.0.1/crypto/rc4/Makefile 2012-03-17 14:03:25.000000000 +0100
8383 @@ -44,7 +44,7 @@
8484 rc4-586.s: asm/rc4-586.pl ../perlasm/x86asm.pl
8585 $(PERL) asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
8989 $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@
9090 rc4-md5-x86_64.s: asm/rc4-md5-x86_64.pl
9191 $(PERL) asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME) > $@
92 Index: openssl-1.0.1/crypto/rc4/asm/rc4-x86_64.pl
93 ===================================================================
94 --- openssl-1.0.1.orig/crypto/rc4/asm/rc4-x86_64.pl 2011-07-01 14:13:52.000000000 +0000
95 +++ openssl-1.0.1/crypto/rc4/asm/rc4-x86_64.pl 2012-03-17 09:28:11.000000000 +0000
96 @@ -157,7 +157,11 @@
97 mov -4($dat),$YY#b
98 cmpl \$-1,256($dat)
99 je .LRC4_CHAR
100 +#ifdef OPENSSL_PIC
101 + mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%r8d
102 +#else
103 mov OPENSSL_ia32cap_P(%rip),%r8d
104 +#endif
105 xor $TX[1],$TX[1]
106 inc $XX[0]#b
107 sub $XX[0],$TX[1]
108 @@ -442,7 +446,11 @@
109 xor %r10,%r10
110 xor %r11,%r11
111
112 +#ifdef OPENSSL_PIC
113 + mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),$idx#d
114 +#else
115 mov OPENSSL_ia32cap_P(%rip),$idx#d
116 +#endif
117 bt \$20,$idx#d # RC4_CHAR?
118 jc .Lc1stloop
119 jmp .Lw1stloop
120 @@ -506,7 +514,11 @@
121 .align 16
122 RC4_options:
123 lea .Lopts(%rip),%rax
124 +#ifdef OPENSSL_PIC
125 + mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%edx
126 +#else
127 mov OPENSSL_ia32cap_P(%rip),%edx
128 +#endif
129 bt \$20,%edx
130 jc .L8xchar
131 bt \$30,%edx
13292 Index: openssl-1.0.1/crypto/perlasm/cbc.pl
13393 ===================================================================
134 --- openssl-1.0.1.orig/crypto/perlasm/cbc.pl 2011-07-13 06:22:46.000000000 +0000
135 +++ openssl-1.0.1/crypto/perlasm/cbc.pl 2012-03-17 09:20:04.000000000 +0000
94 --- openssl-1.0.1.orig/crypto/perlasm/cbc.pl 2011-07-13 08:22:46.000000000 +0200
95 +++ openssl-1.0.1/crypto/perlasm/cbc.pl 2012-03-17 14:03:25.000000000 +0100
13696 @@ -122,7 +122,11 @@
13797 &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
13898 &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
187147 &mov("ebx", &DWP($data_off+4,"esp","",0)); #
188148 Index: openssl-1.0.1/crypto/perlasm/x86_64-xlate.pl
189149 ===================================================================
190 --- openssl-1.0.1.orig/crypto/perlasm/x86_64-xlate.pl 2012-03-17 09:19:38.000000000 +0000
191 +++ openssl-1.0.1/crypto/perlasm/x86_64-xlate.pl 2012-03-17 09:20:04.000000000 +0000
150 --- openssl-1.0.1.orig/crypto/perlasm/x86_64-xlate.pl 2012-03-13 20:19:31.000000000 +0100
151 +++ openssl-1.0.1/crypto/perlasm/x86_64-xlate.pl 2012-03-17 14:03:25.000000000 +0100
192152 @@ -786,7 +786,7 @@
193153
194154 chomp($line);
200160
201161 Index: openssl-1.0.1/crypto/perlasm/x86gas.pl
202162 ===================================================================
203 --- openssl-1.0.1.orig/crypto/perlasm/x86gas.pl 2011-12-09 19:16:35.000000000 +0000
204 +++ openssl-1.0.1/crypto/perlasm/x86gas.pl 2012-03-17 09:30:54.000000000 +0000
205 @@ -218,6 +218,15 @@
163 --- openssl-1.0.1.orig/crypto/perlasm/x86gas.pl 2011-12-09 20:16:35.000000000 +0100
164 +++ openssl-1.0.1/crypto/perlasm/x86gas.pl 2012-03-17 14:03:25.000000000 +0100
165 @@ -161,6 +161,7 @@
166 if ($::macosx) { push (@out,"$tmp,2\n"); }
167 elsif ($::elf) { push (@out,"$tmp,4\n"); }
168 else { push (@out,"$tmp\n"); }
169 + if ($::elf) { push (@out,".hidden\tOPENSSL_ia32cap_P\n"); }
170 }
171 push(@out,$initseg) if ($initseg);
172 }
173 @@ -218,7 +219,17 @@
206174 elsif ($::elf)
207175 { $initseg.=<<___;
208176 .section .init
216184 + popl %ebx
217185 +#else
218186 call $f
187 +#endif
219188 ___
220189 }
221 Index: openssl-1.0.1/crypto/aes/asm/aes-x86_64.pl
222 ===================================================================
223 --- openssl-1.0.1.orig/crypto/aes/asm/aes-x86_64.pl 2011-11-14 21:01:17.000000000 +0000
224 +++ openssl-1.0.1/crypto/aes/asm/aes-x86_64.pl 2012-03-17 09:20:04.000000000 +0000
225 @@ -1678,7 +1678,11 @@
226 lea .LAES_Td(%rip),$sbox
227 .Lcbc_picked_te:
228
229 +#ifdef OPENSSL_PIC
230 + mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%r10d
231 +#else
232 mov OPENSSL_ia32cap_P(%rip),%r10d
233 +#endif
234 cmp \$$speed_limit,%rdx
235 jb .Lcbc_slow_prologue
236 test \$15,%rdx
190 elsif ($::coff)
237191 Index: openssl-1.0.1/crypto/aes/Makefile
238192 ===================================================================
239 --- openssl-1.0.1.orig/crypto/aes/Makefile 2011-11-14 20:42:21.000000000 +0000
240 +++ openssl-1.0.1/crypto/aes/Makefile 2012-03-17 09:20:04.000000000 +0000
193 --- openssl-1.0.1.orig/crypto/aes/Makefile 2011-11-14 21:42:21.000000000 +0100
194 +++ openssl-1.0.1/crypto/aes/Makefile 2012-03-17 14:03:25.000000000 +0100
241195 @@ -55,7 +55,7 @@
242196 aesni-x86.s: asm/aesni-x86.pl ../perlasm/x86asm.pl
243197 $(PERL) asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
247201 $(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
248202 vpaes-x86_64.s: asm/vpaes-x86_64.pl
249203 $(PERL) asm/vpaes-x86_64.pl $(PERLASM_SCHEME) > $@
204 Index: openssl-1.0.1/crypto/x86cpuid.pl
205 ===================================================================
206 --- openssl-1.0.1.orig/crypto/x86cpuid.pl 2012-02-28 15:20:34.000000000 +0100
207 +++ openssl-1.0.1/crypto/x86cpuid.pl 2012-03-17 14:13:56.000000000 +0100
208 @@ -8,6 +8,8 @@
209
210 for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
211
212 +push(@out, ".hidden OPENSSL_ia32cap_P\n");
213 +
214 &function_begin("OPENSSL_ia32_cpuid");
215 &xor ("edx","edx");
216 &pushf ();
217 @@ -139,9 +141,7 @@
218 &set_label("nocpuid");
219 &function_end("OPENSSL_ia32_cpuid");
220
221 -&external_label("OPENSSL_ia32cap_P");
222 -
223 -&function_begin_B("OPENSSL_rdtsc","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
224 +&function_begin_B("OPENSSL_rdtsc");
225 &xor ("eax","eax");
226 &xor ("edx","edx");
227 &picmeup("ecx","OPENSSL_ia32cap_P");
228 @@ -155,7 +155,7 @@
229 # This works in Ring 0 only [read DJGPP+MS-DOS+privileged DPMI host],
230 # but it's safe to call it on any [supported] 32-bit platform...
231 # Just check for [non-]zero return value...
232 -&function_begin_B("OPENSSL_instrument_halt","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
233 +&function_begin_B("OPENSSL_instrument_halt");
234 &picmeup("ecx","OPENSSL_ia32cap_P");
235 &bt (&DWP(0,"ecx"),4);
236 &jnc (&label("nohalt")); # no TSC
237 @@ -222,7 +222,7 @@
238 &ret ();
239 &function_end_B("OPENSSL_far_spin");
240
241 -&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
242 +&function_begin_B("OPENSSL_wipe_cpu");
243 &xor ("eax","eax");
244 &xor ("edx","edx");
245 &picmeup("ecx","OPENSSL_ia32cap_P");