Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Apr 2021 14:35:22 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4d7f08c84bcf - main - rtld: unstaticise lockinfo and obj_from_addr()
Message-ID:  <202104101435.13AEZMVV095218@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

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

commit 4d7f08c84bcfcd75ba23b06e07a8e5dba1d4a44f
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-04-10 12:30:59 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-04-10 14:33:33 +0000

    rtld: unstaticise lockinfo and obj_from_addr()
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D29633
---
 libexec/rtld-elf/rtld.c      | 3 +--
 libexec/rtld-elf/rtld.h      | 1 +
 libexec/rtld-elf/rtld_lock.c | 2 +-
 libexec/rtld-elf/rtld_lock.h | 2 ++
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 29ab4e93d4da..1ff9ecefa2c1 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -124,7 +124,6 @@ static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int);
 static void map_stacks_exec(RtldLockState *);
 static int obj_disable_relro(Obj_Entry *);
 static int obj_enforce_relro(Obj_Entry *);
-static Obj_Entry *obj_from_addr(const void *);
 static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *);
 static void objlist_call_init(Objlist *, RtldLockState *);
 static void objlist_clear(Objlist *);
@@ -2688,7 +2687,7 @@ errp:
     return (NULL);
 }
 
-static Obj_Entry *
+Obj_Entry *
 obj_from_addr(const void *addr)
 {
     Obj_Entry *obj;
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
index 6a2f62fc6189..060b83b2cdad 100644
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -389,6 +389,7 @@ Obj_Entry *globallist_curr(const Obj_Entry *obj);
 Obj_Entry *globallist_next(const Obj_Entry *obj);
 void obj_free(Obj_Entry *);
 Obj_Entry *obj_new(void);
+Obj_Entry *obj_from_addr(const void *);
 void _rtld_bind_start(void);
 void *rtld_resolve_ifunc(const Obj_Entry *obj, const Elf_Sym *def);
 void symlook_init(SymLook *, const char *);
diff --git a/libexec/rtld-elf/rtld_lock.c b/libexec/rtld-elf/rtld_lock.c
index c453584b96e2..d94bd1a283e9 100644
--- a/libexec/rtld-elf/rtld_lock.c
+++ b/libexec/rtld-elf/rtld_lock.c
@@ -192,7 +192,7 @@ def_thread_clr_flag(int mask)
 /*
  * Public interface exposed to the rest of the dynamic linker.
  */
-static struct RtldLockInfo lockinfo;
+struct RtldLockInfo lockinfo;
 static struct RtldLockInfo deflockinfo;
 
 static __inline int
diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h
index 9aa769b1f7e6..ecc733a06e44 100644
--- a/libexec/rtld-elf/rtld_lock.h
+++ b/libexec/rtld-elf/rtld_lock.h
@@ -63,6 +63,8 @@ extern rtld_lock_t	rtld_bind_lock;
 extern rtld_lock_t	rtld_libc_lock;
 extern rtld_lock_t	rtld_phdr_lock;
 
+extern struct RtldLockInfo lockinfo;
+
 #define	RTLD_LOCK_UNLOCKED	0
 #define	RTLD_LOCK_RLOCKED	1
 #define	RTLD_LOCK_WLOCKED	2



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104101435.13AEZMVV095218>