about summary refs log tree commit diff
path: root/dlfcn/dlfcn.h
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 /dlfcn/dlfcn.h
parent93804a1ee084d4bdc620b2b9f91615c7da0fabe1 (diff)
downloadglibc-d056c212130280c0a54d9a4f72170ec621b70ce5.tar.gz
glibc-d056c212130280c0a54d9a4f72170ec621b70ce5.tar.xz
glibc-d056c212130280c0a54d9a4f72170ec621b70ce5.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>
Diffstat (limited to 'dlfcn/dlfcn.h')
-rw-r--r--dlfcn/dlfcn.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/dlfcn/dlfcn.h b/dlfcn/dlfcn.h
index b5cd5c5238..a3af6051d4 100644
--- a/dlfcn/dlfcn.h
+++ b/dlfcn/dlfcn.h
@@ -164,7 +164,12 @@ enum
        segment, or if the calling thread has not allocated a block for it.  */
     RTLD_DI_TLS_DATA = 10,
 
-    RTLD_DI_MAX = 10
+    /* Treat ARG as const ElfW(Phdr) **, and store the address of the
+       program header array at that location.  The dlinfo call returns
+       the number of program headers in the array.  */
+    RTLD_DI_PHDR = 11,
+
+    RTLD_DI_MAX = 11
   };