about summary refs log tree commit diff
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-05-11 19:17:47 +0200
commit28ea43f8d64f0dd1f2de75525157730e1532e600 (patch)
tree3cf415407f45b22a96670039e7e787b3b40cec38 /manual
parent78f82ab4ef839b52df022234aff63e2d4d7f264f (diff)
downloadglibc-28ea43f8d64f0dd1f2de75525157730e1532e600.tar.gz
glibc-28ea43f8d64f0dd1f2de75525157730e1532e600.tar.xz
glibc-28ea43f8d64f0dd1f2de75525157730e1532e600.zip
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>
(cherry picked from commit d056c212130280c0a54d9a4f72170ec621b70ce5)
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 bc3b779b69..6a4a50d3f0 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.