This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.27.9000-427-g7f7b5d8
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 29 May 2018 13:34:50 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.27.9000-427-g7f7b5d8
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 7f7b5d8ded77db90c1fbfeaaeb3d58b6db84da47 (commit)
from e48903000b248f6cdc78238b006b86b63fcdbf8c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7f7b5d8ded77db90c1fbfeaaeb3d58b6db84da47
commit 7f7b5d8ded77db90c1fbfeaaeb3d58b6db84da47
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue May 29 06:33:42 2018 -0700
static-PIE: Update DT_DEBUG for debugger [BZ #23206]
This is needed to support debugging dlopened shared libraries in static
PIE.
[BZ #23206]
* elf/dl-reloc-static-pie.c (_dl_relocate_static_pie): Initialize
_r_debug and update DT_DEBUG for debugger.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
diff --git a/ChangeLog b/ChangeLog
index b9684f4..efd0bec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #23206]
+ * elf/dl-reloc-static-pie.c (_dl_relocate_static_pie): Initialize
+ _r_debug and update DT_DEBUG for debugger.
+
2018-05-29 Florian Weimer <fweimer@redhat.com>
* stdlib/Makefile (tst-strtod1i.out): Depend on generated locales.
diff --git a/elf/dl-reloc-static-pie.c b/elf/dl-reloc-static-pie.c
index bd2d516..ab1ce0e 100644
--- a/elf/dl-reloc-static-pie.c
+++ b/elf/dl-reloc-static-pie.c
@@ -48,5 +48,21 @@ _dl_relocate_static_pie (void)
data access using the global offset table. */
ELF_DYNAMIC_RELOCATE (main_map, 0, 0, 0);
main_map->l_relocated = 1;
+
+ /* Initialize _r_debug. */
+ struct r_debug *r = _dl_debug_initialize (0, LM_ID_BASE);
+ r->r_state = RT_CONSISTENT;
+
+ /* Set up debugging before the debugger is notified for the first
+ time. */
+# ifdef ELF_MACHINE_DEBUG_SETUP
+ /* Some machines (e.g. MIPS) don't use DT_DEBUG in this way. */
+ ELF_MACHINE_DEBUG_SETUP (main_map, r);
+# else
+ if (main_map->l_info[DT_DEBUG] != NULL)
+ /* There is a DT_DEBUG entry in the dynamic section. Fill it in
+ with the run-time address of the r_debug structure */
+ main_map->l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
+# endif
}
#endif
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
elf/dl-reloc-static-pie.c | 16 ++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources