Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
glibc
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security
Insights
Files
9b42a0b
argp
assert
benchtests
bits
catgets
conf
conform
crypt
csu
ctype
debug
dirent
dlfcn
Makefile
Versions
bug-atexit1-lib.c
bug-atexit1.c
bug-atexit2-lib.c
bug-atexit2.c
bug-atexit3-lib.cc
bug-atexit3.c
bug-dl-leaf-lib-cb.c
bug-dl-leaf-lib.c
bug-dl-leaf.c
bug-dlopen1.c
bug-dlsym1-lib1.c
bug-dlsym1-lib2.c
bug-dlsym1.c
default.c
defaultmod1.c
defaultmod2.c
dladdr.c
dladdr1.c
dlclose.c
dlerror.c
dlfcn.c
dlfcn.h
dlinfo.c
dlmopen.c
dlopen.c
dlopenold.c
dlsym.c
dlvsym.c
errmsg1.c
errmsg1mod.c
failtest.c
failtestmod.c
glreflib1.c
glreflib2.c
glreflib3.c
glrefmain.c
modatexit.c
modcxaatexit.c
modstatic.c
modstatic2.c
modstatic3.c
modstatic5.c
sdladdr.c
sdladdr1.c
sdlclose.c
sdlerror.c
sdlinfo.c
sdlmopen.c
sdlopen.c
sdlsym.c
sdlvsym.c
tst-dladdr.c
tst-dlinfo.c
tstatexit.c
tstcxaatexit.c
tststatic.c
tststatic2.c
tststatic3.c
tststatic4.c
tststatic5.c
elf
gmon
gnulib
grp
gshadow
hesiod
hurd
iconv
iconvdata
include
inet
intl
io
libidn
libio
locale
localedata
login
mach
malloc
manual
math
misc
nis
nptl
nptl_db
nscd
nss
po
posix
pwd
resolv
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib
streams
string
sunrpc
sysdeps
sysvipc
termios
time
timezone
wcsmbs
wctype
.gitattributes
.gitignore
BUGS
CONFORMANCE
COPYING
COPYING.LIB
ChangeLog
ChangeLog.1
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.16
ChangeLog.17
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
ChangeLog.old-ports
ChangeLog.old-ports-aarch64
ChangeLog.old-ports-aix
ChangeLog.old-ports-alpha
ChangeLog.old-ports-am33
ChangeLog.old-ports-arm
ChangeLog.old-ports-cris
ChangeLog.old-ports-hppa
ChangeLog.old-ports-ia64
ChangeLog.old-ports-linux-generic
ChangeLog.old-ports-m68k
ChangeLog.old-ports-microblaze
ChangeLog.old-ports-mips
ChangeLog.old-ports-powerpc
ChangeLog.old-ports-tile
INSTALL
LICENSES
Makeconfig
Makefile
Makefile.in
Makerules
NAMESPACE
NEWS
PROJECTS
README
Rules
WUR-REPORT
abi-tags
aclocal.m4
config.h.in
config.make.in
configure
configure.ac
cppflags-iterator.mk
extra-lib.mk
extra-modules.mk
libc-abis
o-iterator.mk
shlib-versions
test-skeleton.c
version.h
Breadcrumbs
glibc
/
dlfcn
/
dlinfo.c
Blame
Blame
Latest commit
History
History
126 lines (104 loc) · 3.06 KB
Breadcrumbs
glibc
/
dlfcn
/
dlinfo.c
Top
File metadata and controls
Code
Blame
126 lines (104 loc) · 3.06 KB
Raw
/* dlinfo -- Get information from the dynamic linker. Copyright (C) 2003-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <dlfcn.h> #include <link.h> #include <ldsodefs.h> #include <libintl.h> #if !defined SHARED && IS_IN (libdl) int dlinfo (void *handle, int request, void *arg) { return __dlinfo (handle, request, arg, RETURN_ADDRESS (0)); } #else # include <dl-tls.h> struct dlinfo_args { ElfW(Addr) caller; void *handle; int request; void *arg; }; static void dlinfo_doit (void *argsblock) { struct dlinfo_args *const args = argsblock; struct link_map *l = args->handle; # if 0 if (args->handle == RTLD_SELF) { Lmid_t nsid; /* Find the highest-addressed object that CALLER is not below. */ for (nsid = 0; nsid < DL_NNS; ++nsid) for (l = GL(dl_ns)[nsid]._ns_loaded; l != NULL; l = l->l_next) if (caller >= l->l_map_start && caller < l->l_map_end && (l->l_contiguous || _dl_addr_inside_object (l, caller))) break; if (l == NULL) GLRO(dl_signal_error) (0, NULL, NULL, N_("\ RTLD_SELF used in code not dynamically loaded")); } # endif switch (args->request) { case RTLD_DI_CONFIGADDR: default: GLRO(dl_signal_error) (0, NULL, NULL, N_("unsupported dlinfo request")); break; case RTLD_DI_LMID: *(Lmid_t *) args->arg = l->l_ns; break; case RTLD_DI_LINKMAP: *(struct link_map **) args->arg = l; break; case RTLD_DI_SERINFO: _dl_rtld_di_serinfo (l, args->arg, false); break; case RTLD_DI_SERINFOSIZE: _dl_rtld_di_serinfo (l, args->arg, true); break; case RTLD_DI_ORIGIN: strcpy (args->arg, l->l_origin); break; case RTLD_DI_TLS_MODID: *(size_t *) args->arg = 0; *(size_t *) args->arg = l->l_tls_modid; break; case RTLD_DI_TLS_DATA: { void *data = NULL; if (l->l_tls_modid != 0) data = GLRO(dl_tls_get_addr_soft) (l); *(void **) args->arg = data; break; } } } int __dlinfo (void *handle, int request, void *arg DL_CALLER_DECL) { # ifdef SHARED if (__glibc_unlikely (_dlfcn_hook != NULL)) return _dlfcn_hook->dlinfo (handle, request, arg, DL_CALLER); # endif struct dlinfo_args args = { (ElfW(Addr)) DL_CALLER, handle, request, arg }; return _dlerror_run (&dlinfo_doit, &args) ? -1 : 0; } # ifdef SHARED strong_alias (__dlinfo, dlinfo) # endif #endif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
You can’t perform that action at this time.