Prevent inlining of _dl_debug_state (RHEL-105965)
Resolves: RHEL-105965
This commit is contained in:
parent
6a840ebd26
commit
ad8f8253fd
80
glibc-RHEL-105965.patch
Normal file
80
glibc-RHEL-105965.patch
Normal file
@ -0,0 +1,80 @@
|
||||
commit 620f0730f311635cd0e175a3ae4d0fc700c76366
|
||||
Author: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Mon Jul 28 14:16:52 2025 +0200
|
||||
|
||||
elf: Compile _dl_debug_state separately (bug 33224)
|
||||
|
||||
This ensures that the compiler will not inline it, so that
|
||||
debuggers which do not use the Systemtap probes can reliably
|
||||
set a breakpoint on it.
|
||||
|
||||
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
|
||||
Tested-by: Andreas K. Huettel <dilfridge@gentoo.org>
|
||||
|
||||
diff --git a/elf/Makefile b/elf/Makefile
|
||||
index b181150b36773d24..b37636c0f865f4e6 100644
|
||||
--- a/elf/Makefile
|
||||
+++ b/elf/Makefile
|
||||
@@ -56,6 +56,7 @@ dl-routines = \
|
||||
dl-close \
|
||||
dl-debug \
|
||||
dl-debug-symbols \
|
||||
+ dl-debug_state \
|
||||
dl-deps \
|
||||
dl-exception \
|
||||
dl-execstack \
|
||||
diff --git a/elf/dl-debug.c b/elf/dl-debug.c
|
||||
index 4388a04cdf828898..8c1472a84ebfefe7 100644
|
||||
--- a/elf/dl-debug.c
|
||||
+++ b/elf/dl-debug.c
|
||||
@@ -167,14 +167,3 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
|
||||
|
||||
return &r->base;
|
||||
}
|
||||
-
|
||||
-
|
||||
-/* This function exists solely to have a breakpoint set on it by the
|
||||
- debugger. The debugger is supposed to find this function's address by
|
||||
- examining the r_brk member of struct r_debug, but GDB 4.15 in fact looks
|
||||
- for this particular symbol name in the PT_INTERP file. */
|
||||
-void
|
||||
-_dl_debug_state (void)
|
||||
-{
|
||||
-}
|
||||
-rtld_hidden_def (_dl_debug_state)
|
||||
diff --git a/elf/dl-debug_state.c b/elf/dl-debug_state.c
|
||||
new file mode 100644
|
||||
index 0000000000000000..40c134a49e2455f3
|
||||
--- /dev/null
|
||||
+++ b/elf/dl-debug_state.c
|
||||
@@ -0,0 +1,30 @@
|
||||
+/* Debugger hook called after dynamic linker updates.
|
||||
+ Copyright (C) 1996-2025 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/>. */
|
||||
+
|
||||
+#include <ldsodefs.h>
|
||||
+
|
||||
+/* This function exists solely to have a breakpoint set on it by the
|
||||
+ debugger. The debugger is supposed to find this function's address by
|
||||
+ examining the r_brk member of struct r_debug, but GDB 4.15 in fact looks
|
||||
+ for this particular symbol name in the PT_INTERP file. Therefore,
|
||||
+ this function must not be inlined. */
|
||||
+void
|
||||
+_dl_debug_state (void)
|
||||
+{
|
||||
+}
|
||||
+rtld_hidden_def (_dl_debug_state)
|
||||
@ -157,7 +157,7 @@ end \
|
||||
Summary: The GNU libc libraries
|
||||
Name: glibc
|
||||
Version: %{glibcversion}
|
||||
Release: 225%{?dist}
|
||||
Release: 226%{?dist}
|
||||
|
||||
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
|
||||
# libraries.
|
||||
@ -1334,6 +1334,7 @@ Patch1018: glibc-RHEL-105957.patch
|
||||
Patch1019: glibc-RHEL-50086-1.patch
|
||||
Patch1020: glibc-RHEL-50086-2.patch
|
||||
Patch1021: glibc-RHEL-107564.patch
|
||||
Patch1022: glibc-RHEL-105965.patch
|
||||
|
||||
##############################################################################
|
||||
# Continued list of core "glibc" package information:
|
||||
@ -3421,6 +3422,9 @@ update_gconv_modules_cache ()
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Aug 07 2025 Florian Weimer <fweimer@redhat.com> - 2.34-226
|
||||
- Prevent inlining of _dl_debug_state (RHEL-105965)
|
||||
|
||||
* Tue Aug 05 2025 Florian Weimer <fweimer@redhat.com> - 2.34-225
|
||||
- Add definition of _dl_find_object to libc.a (RHEL-107564)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user