On Wed, Nov 03, 2021 at 05:28:02PM +0100, Florian Weimer wrote:
> This function is similar to __gnu_Unwind_Find_exidx as used on arm.
> It can be used to speed up the libgcc unwinder.

I'm little bit worried that this trades the speed of exceptions for
speed of dlopen/dlclose and extra memory use in each process.
I admit I haven't been paying close attention to how many shared libraries
apps typically link against and how many dlopen/dlclose calls they do
in the last decade and half, but I'd think more applications don't use
exceptions compared to apps that do use them, and of many of those that do
use them don't use them for really exceptional cases, so speeding those
is a good thing.
So, I'd wonder, could this overhead be added lazily, when _dl_find_eh_frame
is called for the first time just take the rtld lock, prepare anything you
populate right now already from the process start up and every
dlopen/dlclose before the first _dl_find_eh_frame call and only since then
keep it updated on dlopen/dlclose?
Thus, for the expected majority of apps that aren't using exceptions at all
nothing would change for dlopen/dlclose overhead, while all but the first
_dl_find_eh_frame would be faster and with no locking?

        Jakub

Reply via email to