git: e25527f75f73 - main - libmd: symbol versioning

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Mon, 30 Sep 2024 03:36:06 UTC
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=e25527f75f73665517c7a449cdc6a29fa4c90c1c

commit e25527f75f73665517c7a449cdc6a29fa4c90c1c
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-03-08 16:12:19 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2024-09-30 03:34:19 +0000

    libmd: symbol versioning
    
    The primary benefit sought is exporting _libmd_* symbols in a private
    namespace, and avoiding export of some other implementation details that
    are shared amongst TUs.
    
    PR:             280784 (exp-run)
    Reviewed by:    fuz
    Differential Revision:  https://reviews.freebsd.org/D34499
---
 lib/libmd/Makefile   |   3 +
 lib/libmd/Symbol.map | 272 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 275 insertions(+)

diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile
index 0a0890e06550..9412adaf5a56 100644
--- a/lib/libmd/Makefile
+++ b/lib/libmd/Makefile
@@ -19,6 +19,9 @@ INCS=	md4.h md5.h ripemd.h sha.h sha224.h sha256.h sha384.h sha512.h \
 
 WARNS?=	0
 
+VERSION_DEF=	${SRCTOP}/lib/libc/Versions.def
+SYMBOL_MAPS=	${.CURDIR}/Symbol.map
+
 MAN+=	md4.3 md5.3 ripemd.3 sha.3 sha256.3 sha512.3 skein.3
 MLINKS+=md4.3 MD4Init.3 md4.3 MD4Update.3 md4.3 MD4Final.3
 MLINKS+=md4.3 MD4End.3  md4.3 MD4File.3   md4.3 MD4FileChunk.3
diff --git a/lib/libmd/Symbol.map b/lib/libmd/Symbol.map
new file mode 100644
index 000000000000..9ac73e5bb5fd
--- /dev/null
+++ b/lib/libmd/Symbol.map
@@ -0,0 +1,272 @@
+FBSD_1.7 {
+	MD4Data;
+	MD4End;
+	MD4Fd;
+	MD4FdChunk;
+	MD4File;
+	MD4FileChunk;
+	MD4Final;
+	MD4Init;
+	MD4Pad;
+	MD4Update;
+	MD5Data;
+	MD5End;
+	MD5Fd;
+	MD5FdChunk;
+	MD5File;
+	MD5FileChunk;
+	MD5Final;
+	MD5Init;
+	MD5Transform;
+	MD5Update;
+	RIPEMD160_Data;
+	RIPEMD160_End;
+	RIPEMD160_Fd;
+	RIPEMD160_FdChunk;
+	RIPEMD160_File;
+	RIPEMD160_FileChunk;
+	RIPEMD160_Final;
+	RIPEMD160_Init;
+	RIPEMD160_Transform;
+	RIPEMD160_Update;
+	RMD160_version;
+	SHA1_Data;
+	SHA1_End;
+	SHA1_Fd;
+	SHA1_FdChunk;
+	SHA1_File;
+	SHA1_FileChunk;
+	SHA1_Final;
+	SHA1_Init;
+	SHA1_Transform;
+	SHA1_Update;
+	SHA1_version;
+	SHA224_Data;
+	SHA224_End;
+	SHA224_Fd;
+	SHA224_FdChunk;
+	SHA224_File;
+	SHA224_FileChunk;
+	SHA224_Final;
+	SHA224_Init;
+	SHA224_Update;
+	SHA256_Data;
+	SHA256_End;
+	SHA256_Fd;
+	SHA256_FdChunk;
+	SHA256_File;
+	SHA256_FileChunk;
+	SHA256_Final;
+	SHA256_Init;
+	SHA256_Transform;
+	SHA256_Update;
+	SHA384_Data;
+	SHA384_End;
+	SHA384_Fd;
+	SHA384_FdChunk;
+	SHA384_File;
+	SHA384_FileChunk;
+	SHA384_Final;
+	SHA384_Init;
+	SHA384_Update;
+	SHA512_224_Data;
+	SHA512_224_End;
+	SHA512_224_Fd;
+	SHA512_224_FdChunk;
+	SHA512_224_File;
+	SHA512_224_FileChunk;
+	SHA512_224_Final;
+	SHA512_224_Init;
+	SHA512_224_Update;
+	SHA512_256_Data;
+	SHA512_256_End;
+	SHA512_256_Fd;
+	SHA512_256_FdChunk;
+	SHA512_256_File;
+	SHA512_256_FileChunk;
+	SHA512_256_Final;
+	SHA512_256_Init;
+	SHA512_256_Update;
+	SHA512_Data;
+	SHA512_End;
+	SHA512_Fd;
+	SHA512_FdChunk;
+	SHA512_File;
+	SHA512_FileChunk;
+	SHA512_Final;
+	SHA512_Init;
+	SHA512_Transform;
+	SHA512_Update;
+	SHA_Data;
+	SHA_End;
+	SHA_Fd;
+	SHA_FdChunk;
+	SHA_File;
+	SHA_FileChunk;
+	SKEIN1024_Data;
+	SKEIN1024_End;
+	SKEIN1024_Fd;
+	SKEIN1024_FdChunk;
+	SKEIN1024_File;
+	SKEIN1024_FileChunk;
+	SKEIN1024_Final;
+	SKEIN1024_Init;
+	SKEIN1024_Update;
+	SKEIN256_Data;
+	SKEIN256_End;
+	SKEIN256_Fd;
+	SKEIN256_FdChunk;
+	SKEIN256_File;
+	SKEIN256_FileChunk;
+	SKEIN256_Final;
+	SKEIN256_Init;
+	SKEIN256_Update;
+	SKEIN512_Data;
+	SKEIN512_End;
+	SKEIN512_Fd;
+	SKEIN512_FdChunk;
+	SKEIN512_File;
+	SKEIN512_FileChunk;
+	SKEIN512_Final;
+	SKEIN512_Init;
+	SKEIN512_Update;
+};
+
+FBSDprivate_1.0 {
+	_libmd_MD4Data;
+	_libmd_MD4End;
+	_libmd_MD4Fd;
+	_libmd_MD4FdChunk;
+	_libmd_MD4File;
+	_libmd_MD4FileChunk;
+	_libmd_MD4Final;
+	_libmd_MD4Init;
+	_libmd_MD4Pad;
+	_libmd_MD4Update;
+	_libmd_MD5Data;
+	_libmd_MD5End;
+	_libmd_MD5Fd;
+	_libmd_MD5FdChunk;
+	_libmd_MD5File;
+	_libmd_MD5FileChunk;
+	_libmd_MD5Final;
+	_libmd_MD5Init;
+	_libmd_MD5Transform;
+	_libmd_MD5Update;
+	_libmd_RIPEMD160_Data;
+	_libmd_RIPEMD160_End;
+	_libmd_RIPEMD160_Fd;
+	_libmd_RIPEMD160_FdChunk;
+	_libmd_RIPEMD160_File;
+	_libmd_RIPEMD160_FileChunk;
+	_libmd_RIPEMD160_Final;
+	_libmd_RIPEMD160_Init;
+	_libmd_RIPEMD160_Transform;
+	_libmd_RIPEMD160_Update;
+	_libmd_RMD160_version;
+	_libmd_SHA1_Data;
+	_libmd_SHA1_End;
+	_libmd_SHA1_Fd;
+	_libmd_SHA1_FdChunk;
+	_libmd_SHA1_File;
+	_libmd_SHA1_FileChunk;
+	_libmd_SHA1_Final;
+	_libmd_SHA1_Init;
+	_libmd_SHA1_Transform;
+	_libmd_SHA1_Update;
+	_libmd_SHA1_version;
+	_libmd_SHA224_Data;
+	_libmd_SHA224_End;
+	_libmd_SHA224_Fd;
+	_libmd_SHA224_FdChunk;
+	_libmd_SHA224_File;
+	_libmd_SHA224_FileChunk;
+	_libmd_SHA224_Final;
+	_libmd_SHA224_Init;
+	_libmd_SHA224_Update;
+	_libmd_SHA256_Data;
+	_libmd_SHA256_End;
+	_libmd_SHA256_Fd;
+	_libmd_SHA256_FdChunk;
+	_libmd_SHA256_File;
+	_libmd_SHA256_FileChunk;
+	_libmd_SHA256_Final;
+	_libmd_SHA256_Init;
+	_libmd_SHA256_Transform;
+	_libmd_SHA256_Update;
+	_libmd_SHA384_Data;
+	_libmd_SHA384_End;
+	_libmd_SHA384_Fd;
+	_libmd_SHA384_FdChunk;
+	_libmd_SHA384_File;
+	_libmd_SHA384_FileChunk;
+	_libmd_SHA384_Final;
+	_libmd_SHA384_Init;
+	_libmd_SHA384_Update;
+	_libmd_SHA512_224_Data;
+	_libmd_SHA512_224_End;
+	_libmd_SHA512_224_Fd;
+	_libmd_SHA512_224_FdChunk;
+	_libmd_SHA512_224_File;
+	_libmd_SHA512_224_FileChunk;
+	_libmd_SHA512_224_Final;
+	_libmd_SHA512_224_Init;
+	_libmd_SHA512_224_Update;
+	_libmd_SHA512_256_Data;
+	_libmd_SHA512_256_End;
+	_libmd_SHA512_256_Fd;
+	_libmd_SHA512_256_FdChunk;
+	_libmd_SHA512_256_File;
+	_libmd_SHA512_256_FileChunk;
+	_libmd_SHA512_256_Final;
+	_libmd_SHA512_256_Init;
+	_libmd_SHA512_256_Update;
+	_libmd_SHA512_Data;
+	_libmd_SHA512_End;
+	_libmd_SHA512_Fd;
+	_libmd_SHA512_FdChunk;
+	_libmd_SHA512_File;
+	_libmd_SHA512_FileChunk;
+	_libmd_SHA512_Final;
+	_libmd_SHA512_Init;
+	_libmd_SHA512_Transform;
+	_libmd_SHA512_Update;
+	_libmd_SHA_Data;
+	_libmd_SHA_End;
+	_libmd_SHA_Fd;
+	_libmd_SHA_FdChunk;
+	_libmd_SHA_File;
+	_libmd_SHA_FileChunk;
+	_libmd_SHA_Final;
+	_libmd_SHA_Init;
+	_libmd_SHA_Transform;
+	_libmd_SHA_Update;
+	_libmd_SHA_version;
+	_libmd_SKEIN1024_Data;
+	_libmd_SKEIN1024_End;
+	_libmd_SKEIN1024_Fd;
+	_libmd_SKEIN1024_FdChunk;
+	_libmd_SKEIN1024_File;
+	_libmd_SKEIN1024_FileChunk;
+	_libmd_SKEIN1024_Final;
+	_libmd_SKEIN1024_Init;
+	_libmd_SKEIN1024_Update;
+	_libmd_SKEIN256_Data;
+	_libmd_SKEIN256_End;
+	_libmd_SKEIN256_Fd;
+	_libmd_SKEIN256_FdChunk;
+	_libmd_SKEIN256_File;
+	_libmd_SKEIN256_FileChunk;
+	_libmd_SKEIN256_Final;
+	_libmd_SKEIN256_Init;
+	_libmd_SKEIN256_Update;
+	_libmd_SKEIN512_Data;
+	_libmd_SKEIN512_End;
+	_libmd_SKEIN512_Fd;
+	_libmd_SKEIN512_FdChunk;
+	_libmd_SKEIN512_File;
+	_libmd_SKEIN512_FileChunk;
+	_libmd_SKEIN512_Final;
+	_libmd_SKEIN512_Init;
+	_libmd_SKEIN512_Update;
+};