RFE: dl_iterate_phdr, r_debug.r_brk usability for introspection
Rich Felker
dalias@libc.org
Wed Sep 23 19:08:00 GMT 2015
On Sun, Sep 13, 2015 at 09:45:22AM -0700, John Reiser wrote:
> Counting and reporting the number of calls to dlopen and dlclose
> would enhance the usability of dl_iterate_phdr. A related change
> to r_debug.r_brk would make life easier for live introspection.
>
> For dl_iterate_phdr: count the number of calls to dlopen and dlclose.
> Report the counts to the callback function as new members of
> struct dl_phdr_info. Also tell the number of iterations remaining:
> unsigned dlpi_n_dlopen; /* # calls in this process */
> unsigned dlpi_n_dlclose; /* # calls in this process */
> unsigned dlpi_n_more; /* # remaining link_map along .r_map */
I just remembered: there's already an equivalent API from one or more
of the BSDs (I'd have to look back to see which) that was adopted in
musl. See:
http://git.musl-libc.org/cgit/musl/tree/include/link.h#n27
Rather than inventing something new and gratuitously incompatible it
would be nice if glibc could adopt the same member names (and layout).
We also have the TLS module id (for use with __tls_get_addr) and image
pointer available there.
Rich
More information about the Libc-alpha
mailing list