aboutsummaryrefslogtreecommitdiff
path: root/secure
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2016-05-05 21:25:41 +0000
committerEd Maste <emaste@FreeBSD.org>2016-05-05 21:25:41 +0000
commit50b5c1f0e659018e482db46ea6dbd5d413c2e087 (patch)
treebcb7f5209895287535d14fda3edc1e7e73b5db0a /secure
parentc43c22982e876f2f61cdf14fdbe6b5990b49b992 (diff)
downloadsrc-50b5c1f0e659018e482db46ea6dbd5d413c2e087.tar.gz
src-50b5c1f0e659018e482db46ea6dbd5d413c2e087.zip
Make libcrypto position independent on i386
Prior to this change libcrypto ended up with a .text relocation. Submitted by: Rafael EspĂ­ndola (earlier version) Reviewed by: kib Approved by: so (glebius) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6164
Notes
Notes: svn path=/head/; revision=299139
Diffstat (limited to 'secure')
-rw-r--r--secure/lib/libcrypto/Makefile2
-rw-r--r--secure/lib/libcrypto/i386/crypt586.S (renamed from secure/lib/libcrypto/i386/crypt586.s)8
2 files changed, 9 insertions, 1 deletions
diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile
index fbb38e950c72..b41f533d16e8 100644
--- a/secure/lib/libcrypto/Makefile
+++ b/secure/lib/libcrypto/Makefile
@@ -137,7 +137,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c des_old.c \
fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \
rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c
.if ${MACHINE_CPUARCH} == "i386"
-SRCS+= crypt586.s des-586.s
+SRCS+= crypt586.S des-586.s
.else
SRCS+= des_enc.c fcrypt_b.c
.endif
diff --git a/secure/lib/libcrypto/i386/crypt586.s b/secure/lib/libcrypto/i386/crypt586.S
index 43f903a02d3c..a02a3fc0bd8b 100644
--- a/secure/lib/libcrypto/i386/crypt586.s
+++ b/secure/lib/libcrypto/i386/crypt586.S
@@ -14,7 +14,15 @@ fcrypt_body:
xorl %edi,%edi
xorl %esi,%esi
+#ifdef PIC
+ calll .L1
+.L1:
+ popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+(.-.L1), %edx
+ movl DES_SPtrans@GOT(%edx), %edx
+#else
leal DES_SPtrans,%edx
+#endif
pushl %edx
movl 28(%esp),%ebp
pushl $25