enabling caching for dl_iterate_phdr()
David Mosberger
davidm@napali.hpl.hp.com
Tue Dec 16 19:55:00 GMT 2003
Would it be possible to add two atomic counters, dl_load_additions and
dl_load_removals, which would get incremented whenever something is a
phdr is added to/removed from the list that is traversed by
dl_iterate_phdr()?
The motivation for this is that this would let me solve a
long-standing problem with libunwind where I'd like to cache
unwind-info, but cannot do so safely because there is no way for
libunwind to detect efficiently when a shared object may have gotten
unloaded. Having both the "additions" and "removals" counters would
make it possible to cache both negative and positive information,
though I'd be quite happy if there was at least a "removals" counter.
Any opinions? I guess the alternative that was mentioned in the past
was to use callbacks, but that seems very dangerous in regards to
deadlock etc.
--david
More information about the Libc-hacker
mailing list