From 49184566313fb31e3a7b715c7c22c71622716ecc Mon Sep 17 00:00:00 2001 From: jkim Date: Mon, 16 May 2016 22:42:09 +0000 Subject: [PATCH] Hide OPENSSL_cpuid_setup and OPENSSL_ia32cap_P symbols from libcrypto.so. Note this is a direct commit because it is merged from OpenSSL upstream and head (OpenSSL 1.0.2 branch) already has the same change: https://github.com/openssl/openssl/commit/6206682 git-svn-id: svn://svn.freebsd.org/base/stable/10@299983 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- crypto/openssl/crypto/perlasm/x86asm.pl | 2 ++ crypto/openssl/crypto/perlasm/x86gas.pl | 2 ++ crypto/openssl/crypto/x86cpuid.pl | 3 +++ secure/lib/libcrypto/i386/x86cpuid.S | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/crypto/openssl/crypto/perlasm/x86asm.pl b/crypto/openssl/crypto/perlasm/x86asm.pl index eb543db2f..3f190ae59 100644 --- a/crypto/openssl/crypto/perlasm/x86asm.pl +++ b/crypto/openssl/crypto/perlasm/x86asm.pl @@ -257,4 +257,6 @@ EOF &file($filename); } +sub ::hidden {} + 1; diff --git a/crypto/openssl/crypto/perlasm/x86gas.pl b/crypto/openssl/crypto/perlasm/x86gas.pl index 682a3a316..735c1ad2b 100755 --- a/crypto/openssl/crypto/perlasm/x86gas.pl +++ b/crypto/openssl/crypto/perlasm/x86gas.pl @@ -250,4 +250,6 @@ ___ sub ::dataseg { push(@out,".data\n"); } +*::hidden = sub { push(@out,".hidden\t$nmdecor$_[0]\n"); } if ($::elf); + 1; diff --git a/crypto/openssl/crypto/x86cpuid.pl b/crypto/openssl/crypto/x86cpuid.pl index b270b4433..0212a5b63 100644 --- a/crypto/openssl/crypto/x86cpuid.pl +++ b/crypto/openssl/crypto/x86cpuid.pl @@ -355,4 +355,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &initseg("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_ia32cap_P"); + &asm_finish(); diff --git a/secure/lib/libcrypto/i386/x86cpuid.S b/secure/lib/libcrypto/i386/x86cpuid.S index 8545196ae..049b344ec 100644 --- a/secure/lib/libcrypto/i386/x86cpuid.S +++ b/secure/lib/libcrypto/i386/x86cpuid.S @@ -344,6 +344,8 @@ OPENSSL_ia32_rdrand: cmovel %ecx,%eax ret .size OPENSSL_ia32_rdrand,.-.L_OPENSSL_ia32_rdrand_begin +.hidden OPENSSL_cpuid_setup +.hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,8,4 .section .init call OPENSSL_cpuid_setup @@ -679,6 +681,8 @@ OPENSSL_ia32_rdrand: cmovel %ecx,%eax ret .size OPENSSL_ia32_rdrand,.-.L_OPENSSL_ia32_rdrand_begin +.hidden OPENSSL_cpuid_setup +.hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,8,4 .section .init call OPENSSL_cpuid_setup -- 2.45.0