summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha/asm
diff options
context:
space:
mode:
authormiod <>2023-01-13 17:11:41 +0000
committermiod <>2023-01-13 17:11:41 +0000
commit364fc1ecd2d96b869246574350c6925835b991ab (patch)
tree754902f7e6ad288b35b04ef817ed997460a00546 /src/lib/libcrypto/sha/asm
parentf80a4029bb2f43fe5f0270857d48bc9d41d3ea4e (diff)
downloadopenbsd-364fc1ecd2d96b869246574350c6925835b991ab.tar.gz
openbsd-364fc1ecd2d96b869246574350c6925835b991ab.tar.bz2
openbsd-364fc1ecd2d96b869246574350c6925835b991ab.zip
Move all data tables from .text section to .rodata, and update the code to
fetch them correctly when building PIC. Also drop unused data, and remove --no-execute-only from linker flags. ok jsing@ kettenis@
Diffstat (limited to 'src/lib/libcrypto/sha/asm')
-rw-r--r--src/lib/libcrypto/sha/asm/sha1-parisc.pl8
-rwxr-xr-xsrc/lib/libcrypto/sha/asm/sha512-parisc.pl22
2 files changed, 9 insertions, 21 deletions
diff --git a/src/lib/libcrypto/sha/asm/sha1-parisc.pl b/src/lib/libcrypto/sha/asm/sha1-parisc.pl
index 6cb4656422..783c26272b 100644
--- a/src/lib/libcrypto/sha/asm/sha1-parisc.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-parisc.pl
@@ -146,12 +146,7 @@ ___
146 146
147$code=<<___; 147$code=<<___;
148 .LEVEL $LEVEL 148 .LEVEL $LEVEL
149#if 0
150 .SPACE \$TEXT\$
151 .SUBSPA \$CODE\$,QUAD=0,ALIGN=8,ACCESS=0x2C,CODE_ONLY
152#else
153 .text 149 .text
154#endif
155 150
156 .EXPORT sha1_block_data_order,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR 151 .EXPORT sha1_block_data_order,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR
157sha1_block_data_order 152sha1_block_data_order
@@ -254,9 +249,6 @@ $code.=<<___;
254 .EXIT 249 .EXIT
255 $POPMB -$FRAME(%sp),%r3 250 $POPMB -$FRAME(%sp),%r3
256 .PROCEND 251 .PROCEND
257
258 .data
259 .STRINGZ "SHA1 block transform for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
260___ 252___
261 253
262$code =~ s/\`([^\`]*)\`/eval $1/gem; 254$code =~ s/\`([^\`]*)\`/eval $1/gem;
diff --git a/src/lib/libcrypto/sha/asm/sha512-parisc.pl b/src/lib/libcrypto/sha/asm/sha512-parisc.pl
index 0704302d2a..42832e29f1 100755
--- a/src/lib/libcrypto/sha/asm/sha512-parisc.pl
+++ b/src/lib/libcrypto/sha/asm/sha512-parisc.pl
@@ -159,13 +159,9 @@ ___
159 159
160$code=<<___; 160$code=<<___;
161 .LEVEL $LEVEL 161 .LEVEL $LEVEL
162#if 0
163 .SPACE \$TEXT\$
164 .SUBSPA \$CODE\$,QUAD=0,ALIGN=8,ACCESS=0x2C,CODE_ONLY
165#else
166 .text 162 .text
167#endif
168 163
164 .section .rodata
169 .ALIGN 64 165 .ALIGN 64
170L\$table 166L\$table
171___ 167___
@@ -230,6 +226,7 @@ $code.=<<___ if ($SZ==4);
230 .WORD 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 226 .WORD 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
231___ 227___
232$code.=<<___; 228$code.=<<___;
229 .previous
233 230
234 .EXPORT $func,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR 231 .EXPORT $func,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR
235 .ALIGN 64 232 .ALIGN 64
@@ -262,11 +259,13 @@ $func
262 $PUSH $inp,`-$FRAME_MARKER-3*$SIZE_T`(%sp) 259 $PUSH $inp,`-$FRAME_MARKER-3*$SIZE_T`(%sp)
263 $PUSH $ctx,`-$FRAME_MARKER-2*$SIZE_T`(%sp) 260 $PUSH $ctx,`-$FRAME_MARKER-2*$SIZE_T`(%sp)
264 261
265 blr %r0,$Tbl 262#ifdef __PIC__
266 ldi 3,$t1 263 addil LT'L\$table, %r19
267L\$pic 264 ldw RT'L\$table(%r1), $Tbl
268 andcm $Tbl,$t1,$Tbl ; wipe privilege level 265#else
269 ldo L\$table-L\$pic($Tbl),$Tbl 266 ldil L'L\$table, %t1
267 ldo R'L\$table(%t1), $Tbl
268#endif
270___ 269___
271$code.=<<___ if ($SZ==8 && $SIZE_T==4); 270$code.=<<___ if ($SZ==8 && $SIZE_T==4);
272#ifndef __OpenBSD__ 271#ifndef __OpenBSD__
@@ -692,9 +691,6 @@ $code.=<<___;
692 .EXIT 691 .EXIT
693 $POPMB -$FRAME(%sp),%r3 692 $POPMB -$FRAME(%sp),%r3
694 .PROCEND 693 .PROCEND
695
696 .data
697 .STRINGZ "SHA`64*$SZ` block transform for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
698___ 694___
699 695
700# Explicitly encode PA-RISC 2.0 instructions used in this module, so 696# Explicitly encode PA-RISC 2.0 instructions used in this module, so