fde-glibc.c bug
Ulrich Drepper
drepper@redhat.com
Tue Jul 3 11:40:00 GMT 2001
Richard Henderson <rth@redhat.com> writes:
> How about a for_each_dso type function that took a callback, takes
> care of the locking, passes the link_map and mapping bounds? The
> callback returns 0 to keep searching, non-zero is passed back to
> the caller.
That's more reasonable but passing the link_map is still too
dangerous. The callbacks mustn't change anything.
Therefore it is necessary in such a situation to define a new data
structure which contains the needed information and pass a pointer to
this structure to the callback. The data structure is an automatic
variable in the iterator and therefore changing it has no effect.
And yes, such a solution is the only way to ensure proper locking
(means, getting the load/unload mutex of ld.so).
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
More information about the Libc-alpha
mailing list