From ee1ada1bdb8074de6e1bdc956ab19aef7b6a7872 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 3 Nov 2022 09:39:31 +0100 Subject: elf: Rework exception handling in the dynamic loader [BZ #25486] 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. Reviewed-by: Siddhesh Poyarekar --- sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data | 5 ----- sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data | 5 ----- sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data | 5 ----- 3 files changed, 15 deletions(-) (limited to 'sysdeps/unix/sysv/linux/powerpc') diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data index c0af84eef7..6c1efff68f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data @@ -4,8 +4,3 @@ libc.so: free libc.so: malloc libc.so: realloc libm.so: matherr -# The TLS-enabled version of these functions is interposed from libc.so. -ld.so: _dl_signal_error -ld.so: _dl_catch_error -ld.so: _dl_signal_exception -ld.so: _dl_catch_exception diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data index 581e54b95c..eca59e1ed6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data @@ -35,8 +35,3 @@ libc.so: realloc libm.so: copysignl ? libm.so: fabsl libm.so: matherr -# The TLS-enabled version of these functions is interposed from libc.so. -ld.so: _dl_signal_error -ld.so: _dl_catch_error -ld.so: _dl_signal_exception -ld.so: _dl_catch_exception diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data index d69b7ae646..240d998f57 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data @@ -3,8 +3,3 @@ libc.so: free libc.so: malloc libc.so: realloc libm.so: matherr -# The TLS-enabled version of these functions is interposed from libc.so. -ld.so: _dl_signal_error -ld.so: _dl_catch_error -ld.so: _dl_signal_exception -ld.so: _dl_catch_exception -- cgit 1.4.1