[PATCH v5] elf: Rework exception handling in the dynamic loader [BZ #25486]

Florian Weimer fweimer@redhat.com
Thu Oct 27 13:31:29 GMT 2022


* Florian Weimer via Libc-alpha:

> The old exception handling implementation used function interposition
> to replace the dynamic loader implementation (no TLS support) with the
> libc implementation (TLS support).  This results in problems if the
> link order between the dynamic loader and libc is reversed (bug 25486).
>
> The new implementation moves the entire implementation of the
> exception handling functions back into the dynamic loader, using
> THREAD_GETMEM and THREAD_SETMEM for thread-local data support.
> These depends on Hurd support for these macros, added in commit
> b65a82e4e757c1e6cb7073916 ("hurd: Add THREAD_GET/SETMEM/_NC").
>
> One small obstacle is that the exception handling facilities are used
> before the TCB has been set up, so a check is needed if the TCB is
> available.  If not, a regular global variable is used to store the
> exception handling information.
>
> Also rename dl-error.c to dl-catch.c, to avoid confusion with the
> dlerror function.
>
> ---
> v5: Updated comments as suggested by Siddhesh, rebase to current tree.

Forgot to tweak this for new architectures.  Needs a v6.

Florian



More information about the Libc-alpha mailing list