This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFE: dl_iterate_phdr, r_debug.r_brk usability for introspection
- From: John Reiser <jreiser at bitwagon dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 13 Sep 2015 13:07:31 -0700
- Subject: Re: RFE: dl_iterate_phdr, r_debug.r_brk usability for introspection
- Authentication-results: sourceware.org; auth=none
- References: <55F5A822 dot 1050609 at bitwagon dot com> <87pp1mi5w2 dot fsf at igel dot home>
Andreas Schwab wrote:
John Reiser <jreiser@bitwagon.com> writes:
In struct r_debug, change from
ElfW(Addr) r_brk;
to
int (*r_brk)(struct r_debug *, unsigned long);
and make .r_brk be a read+write member that is honored by ld-linux.
Instead of ld_linux always calling the same internal function
(with .r_brk being its address), have ld-linux call:
(void) (*r_debug.r_brk)(&r_debug, 0ul);
What is the meaning of the second parameter?
The second parameter is not yet completely designed.
Probably it is some combination of an enum and flag bits.
Zero signifies the current only use of .r_brk: notify
on change of dynamic loading state. Possible uses for other
values might be to mark other classes of notification:
mutual exclusion conditions, thread state, FILE conditions, etc.
The general direction is to facilitate introspection, and for
the app and glibc to have a conversation _about_ what is happening,
while it is happening.