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 disabled.
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(). Thanks, Andrew.