git: 13e0ef823047 - stable/13 - rtld_lock.h: add some comments about versioning of struct RtldLockInfo

Konstantin Belousov kib at FreeBSD.org
Fri Apr 23 11:15:07 UTC 2021


The branch stable/13 has been updated by kib:

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

commit 13e0ef823047491f8c246dd721ec22778c4d5384
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-04-11 08:12:48 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-04-23 11:14:08 +0000

    rtld_lock.h: add some comments about versioning of struct RtldLockInfo
    
    (cherry picked from commit 9b33518ada2ebda727ca3c7979cdcdb30716f737)
---
 libexec/rtld-elf/rtld_lock.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h
index fdbdc9917075..c88b558b72b8 100644
--- a/libexec/rtld-elf/rtld_lock.h
+++ b/libexec/rtld-elf/rtld_lock.h
@@ -35,9 +35,20 @@
 
 #define	MAX_RTLD_LOCKS	8
 
+/*
+ * This structure is part of the ABI between rtld and threading
+ * libraries, like libthr and even libc_r.  Its layout is fixed and
+ * can be changed only by appending new fields at the end, with the
+ * bump of RTLI_VERSION.
+ */
 struct RtldLockInfo
 {
+	/*
+	 * Valid if the object calling _rtld_thread_init() exported
+	 * symbol _pli_rtli_version.  Otherwise assume RTLI_VERSION_ONE.
+	 */
 	unsigned int rtli_version;
+
 	void *(*lock_create)(void);
 	void  (*lock_destroy)(void *);
 	void  (*rlock_acquire)(void *);
@@ -46,6 +57,8 @@ struct RtldLockInfo
 	int   (*thread_set_flag)(int);
 	int   (*thread_clr_flag)(int);
 	void  (*at_fork)(void);
+
+	/* Version 2 fields */
 	char *(*dlerror_loc)(void);
 	int  *(*dlerror_seen)(void);
 	int   dlerror_loc_sz;


More information about the dev-commits-src-all mailing list