aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-error.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-11-03 09:39:31 +0100
committerFlorian Weimer <fweimer@redhat.com>2022-11-03 09:39:31 +0100
commitee1ada1bdb8074de6e1bdc956ab19aef7b6a7872 (patch)
tree4e70dfcb1c076da10542c08d7e0b3900a0a34adc /elf/dl-error.c
parentf4ce325dfc50e13cf8240424fa0561fca78e72e7 (diff)
downloadglibc-ee1ada1bdb8074de6e1bdc956ab19aef7b6a7872.tar
glibc-ee1ada1bdb8074de6e1bdc956ab19aef7b6a7872.tar.gz
glibc-ee1ada1bdb8074de6e1bdc956ab19aef7b6a7872.tar.bz2
glibc-ee1ada1bdb8074de6e1bdc956ab19aef7b6a7872.zip
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 <siddhesh@sourceware.org>
Diffstat (limited to 'elf/dl-error.c')
-rw-r--r--elf/dl-error.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/elf/dl-error.c b/elf/dl-error.c
deleted file mode 100644
index 0b7332a84f..0000000000
--- a/elf/dl-error.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Error handling for runtime dynamic linker, full version.
- Copyright (C) 1995-2022 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-/* This implementation lives in libc.so because it uses thread-local
- data, which is not available in ld.so. It interposes the version
- in dl-error-minimal.c after ld.so bootstrap.
-
- The signal/catch mechanism is used by the audit framework, which
- means that even in ld.so, not all errors are fatal. */
-
-#define DL_ERROR_BOOTSTRAP 0
-#include "dl-error-skeleton.c"