aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-04-29 17:00:53 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-04-29 17:00:53 +0200
commitd056c212130280c0a54d9a4f72170ec621b70ce5 (patch)
treef7d368b4f45bcb3eba90b5e89e19ba36b1f68fe1 /manual
parent93804a1ee084d4bdc620b2b9f91615c7da0fabe1 (diff)
downloadglibc-d056c212130280c0a54d9a4f72170ec621b70ce5.zip
glibc-d056c212130280c0a54d9a4f72170ec621b70ce5.tar.gz
glibc-d056c212130280c0a54d9a4f72170ec621b70ce5.tar.bz2
dlfcn: Implement the RTLD_DI_PHDR request type for dlinfo
The information is theoretically available via dl_iterate_phdr as well, but that approach is very slow if there are many shared objects. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@rehdat.com>
Diffstat (limited to 'manual')
-rw-r--r--manual/dynlink.texi15
1 files changed, 12 insertions, 3 deletions
diff --git a/manual/dynlink.texi b/manual/dynlink.texi
index bc3b779..6a4a50d 100644
--- a/manual/dynlink.texi
+++ b/manual/dynlink.texi
@@ -30,9 +30,9 @@ location @var{arg}, based on @var{request}. The @var{handle} argument
must be a pointer returned by @code{dlopen} or @code{dlmopen}; it must
not have been closed by @code{dlclose}.
-On success, @code{dlinfo} returns 0. If there is an error, the function
-returns @math{-1}, and @code{dlerror} can be used to obtain a
-corresponding error message.
+On success, @code{dlinfo} returns 0 for most request types; exceptions
+are noted below. If there is an error, the function returns @math{-1},
+and @code{dlerror} can be used to obtain a corresponding error message.
The following operations are defined for use with @var{request}:
@@ -84,6 +84,15 @@ This request writes the TLS module ID for the shared object @var{handle}
to @code{*@var{arg}}. The argument @var{arg} must be the address of an
object of type @code{size_t}. The module ID is zero if the object
does not have an associated TLS block.
+
+@item RTLD_DI_PHDR
+This request writes the address of the program header array to
+@code{*@var{arg}}. The argument @var{arg} must be the address of an
+object of type @code{const ElfW(Phdr) *} (that is,
+@code{const Elf32_Phdr *} or @code{const Elf64_Phdr *}, as appropriate
+for the current architecture). For this request, the value returned by
+@code{dlinfo} is the number of program headers in the program header
+array.
@end vtable
The @code{dlinfo} function is a GNU extension.