From: Juergen Christ Date: Wed, 23 Mar 2022 12:26:13 +0000 (+0100) Subject: s390x: Hide internal cpuid symbol and function X-Git-Tag: OpenSSL_1_1_1o~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04a768fc5968fa463cf9624a67accdef35bce0e4;p=thirdparty%2Fopenssl.git s390x: Hide internal cpuid symbol and function The symbol OPENSSL_s390xcap_P and the OPENSSL_cpuid_setup function are not exported by the version script of OpenSSL. However, if someone uses the static library without the version script, these symbols all of a sudden become global symbols and their usage in assembler code does not correctly reflect that for PIC. Since these symbols should never be used outside of OpenSSL, hide them inside the binary. Signed-off-by: Juergen Christ Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17946) (cherry picked from commit 37816ef5757e458be9648481e56bf698ee3bfbb1) --- diff --git a/crypto/s390x_arch.h b/crypto/s390x_arch.h index 4d2cc02eb3d..b47dd53ad61 100644 --- a/crypto/s390x_arch.h +++ b/crypto/s390x_arch.h @@ -47,6 +47,9 @@ struct OPENSSL_s390xcap_st { unsigned long long kma[2]; }; +#if defined(__GNUC__) && defined(__linux) +__attribute__ ((visibility("hidden"))) +#endif extern struct OPENSSL_s390xcap_st OPENSSL_s390xcap_P; /* convert facility bit number or function code to bit mask */ diff --git a/crypto/s390xcap.c b/crypto/s390xcap.c index 5d58b2d807b..1878b6a4a7c 100644 --- a/crypto/s390xcap.c +++ b/crypto/s390xcap.c @@ -26,6 +26,9 @@ void OPENSSL_vx_probe(void); struct OPENSSL_s390xcap_st OPENSSL_s390xcap_P; +#if defined(__GNUC__) && defined(__linux) +__attribute__ ((visibility("hidden"))) +#endif void OPENSSL_cpuid_setup(void) { sigset_t oset;