This is the mail archive of the
mailing list for the GCC project.
__register_frame_info and unwinding shared libraries
- From: Andrew Haley <aph at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 15 Feb 2005 17:27:15 +0000
- Subject: __register_frame_info and unwinding shared libraries
This is about DWARF 2 unwinding through shared libraries.
As far as I can see, on current x86 GNU/Linux targets we don't call
__register_frame_info() or __register_frame_info_bases() from the
library startup code in crtbegin. There is code to do it, but it's
When _Unwind_Find_FDE() is called during unwinding, it first calls
_Unwind_Find_registered_FDE(), which promptly returns because nothing
has ever been registered. Then, _Unwind_Find_FDE() calls
dl_iterate_phdr (_Unwind_IteratePhdrCallback, ...) to iterate over
every shared library looking for a PC address.
This is a linear search, so if you have many shared libraries open
this can be pretty slow.
So, now for my question: why do we not call __register_frame_info() or
__register_frame_info_bases() ? We'd avoid a great many trips through
dl_iterate_phdr () and _Unwind_IteratePhdrCallback().