diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2023-02-01 20:45:05 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2023-02-01 20:45:05 +0000 |
commit | 5f59efbdf609ac302476ee5a23a3557285be5b19 (patch) | |
tree | f3f554845a427741edd72210976671586d424801 /lib/libcrypto/rc4/asm | |
parent | 461a7552b676e4b3aa94480b628e8a3776759fff (diff) |
Move all data blocks from .text to .rodata and cleanup up and homogeneize code
responsible from getting the proper address of those blocks.
ok tb@ jsing@
Diffstat (limited to 'lib/libcrypto/rc4/asm')
-rw-r--r-- | lib/libcrypto/rc4/asm/rc4-586.pl | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/libcrypto/rc4/asm/rc4-586.pl b/lib/libcrypto/rc4/asm/rc4-586.pl index f3c3e117bc3..4991c37c2c1 100644 --- a/lib/libcrypto/rc4/asm/rc4-586.pl +++ b/lib/libcrypto/rc4/asm/rc4-586.pl @@ -188,7 +188,8 @@ if ($alt=0) { &mov (&wparam(3),$out); # $out as accumulator in these loops &jz (&label("go4loop4")); - &picmeup($out,"OPENSSL_ia32cap_P"); + &picsetup($out); + &picsymbol($out, "OPENSSL_ia32cap_P", $out); # check SSE2 bit [could have been MMX] &bt (&DWP(0,$out),"\$IA32CAP_BIT0_SSE2"); &jnc (&label("go4loop4")); @@ -305,7 +306,9 @@ $idx="edx"; &mov ($out,&wparam(0)); # load key &mov ($idi,&wparam(1)); # load len &mov ($inp,&wparam(2)); # load data - &picmeup($idx,"OPENSSL_ia32cap_P"); + + &picsetup($idx); + &picsymbol($idx, "OPENSSL_ia32cap_P", $idx); &lea ($out,&DWP(2*4,$out)); # &key->data &lea ($inp,&DWP(0,$inp,$idi)); # $inp to point at the end @@ -382,12 +385,12 @@ $idx="edx"; &function_end("RC4_set_key"); # const char *RC4_options(void); +&static_label("opts"); &function_begin_B("RC4_options"); - &call (&label("pic_point")); -&set_label("pic_point"); - &blindpop("eax"); - &lea ("eax",&DWP(&label("opts")."-".&label("pic_point"),"eax")); - &picmeup("edx","OPENSSL_ia32cap_P"); + &picsetup("edx"); + &picsymbol("eax", &label("opts"), "edx"); + &picsymbol("edx", "OPENSSL_ia32cap_P", "edx");; + &mov ("edx",&DWP(0,"edx")); &bt ("edx","\$IA32CAP_BIT0_INTELP4"); &jc (&label("1xchar")); @@ -399,13 +402,14 @@ $idx="edx"; &add ("eax",12); &set_label("ret"); &ret (); -&set_label("opts",64); +&function_end_B("RC4_options"); + + &rodataseg(); +&set_label("opts"); &asciz ("rc4(4x,int)"); &asciz ("rc4(1x,char)"); &asciz ("rc4(8x,mmx)"); -&asciz ("RC4 for x86, CRYPTOGAMS by <appro\@openssl.org>"); -&align (64); -&function_end_B("RC4_options"); + &previous(); &asm_finish(); |