diff --git a/secure/lib/libcrypto/Makefile.common b/secure/lib/libcrypto/Makefile.common --- a/secure/lib/libcrypto/Makefile.common +++ b/secure/lib/libcrypto/Makefile.common @@ -114,6 +114,8 @@ CFLAGS+= -I${LCRYPTO_SRC}/crypto/modes CFLAGS+= -I${.OBJDIR} +LDFLAGS+= -Wl,-Bsymbolic + .if !empty(SRCS:M*.S) ACFLAGS+= -Wa,--noexecstack .endif diff --git a/secure/lib/libcrypto/modules/fips/Makefile b/secure/lib/libcrypto/modules/fips/Makefile --- a/secure/lib/libcrypto/modules/fips/Makefile +++ b/secure/lib/libcrypto/modules/fips/Makefile @@ -299,6 +299,8 @@ .include +SOLINKOPTS+= -Wl,-Bsymbolic + .if defined(ASM_${MACHINE_CPUARCH}) .PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} .if defined(ASM_amd64) diff --git a/secure/lib/libcrypto/modules/legacy/Makefile b/secure/lib/libcrypto/modules/legacy/Makefile --- a/secure/lib/libcrypto/modules/legacy/Makefile +++ b/secure/lib/libcrypto/modules/legacy/Makefile @@ -31,6 +31,8 @@ .include +SOLINKOPTS+= -Wl,-Bsymbolic + .PATH: ${LCRYPTO_SRC}/providers/implementations/ciphers \ ${LCRYPTO_SRC}/providers/implementations/digests \ ${LCRYPTO_SRC}/providers/implementations/kdfs \ diff --git a/secure/lib/libssl/Makefile b/secure/lib/libssl/Makefile --- a/secure/lib/libssl/Makefile +++ b/secure/lib/libssl/Makefile @@ -40,6 +40,8 @@ CFLAGS+= -I${LCRYPTO_SRC}/ssl CFLAGS+= -I${.OBJDIR:H}/libcrypto +LDFLAGS+= -Wl,-Bsymbolic + .include PICFLAG+= -DOPENSSL_PIC