public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Forward-port addition of _google_dl_debug_state_hook
@ 2021-08-27 23:23 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2021-08-27 23:23 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fc36100b272323e826a41617746f6fe54afa4484

commit fc36100b272323e826a41617746f6fe54afa4484
Author: Stan Shebs <stanshebs@google.com>
Date:   Tue Mar 13 11:53:48 2018 -0700

    Forward-port addition of _google_dl_debug_state_hook

Diff:
---
 elf/Versions   | 2 ++
 elf/dl-debug.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/elf/Versions b/elf/Versions
index 3b09901f6c..80cf1c47aa 100644
--- a/elf/Versions
+++ b/elf/Versions
@@ -78,5 +78,7 @@ ld {
 
     # Set value of a tunable.
     __tunable_get_val;
+
+    _google_dl_debug_state_hook;
   }
 }
diff --git a/elf/dl-debug.c b/elf/dl-debug.c
index 14d1125fe6..390ef994dd 100644
--- a/elf/dl-debug.c
+++ b/elf/dl-debug.c
@@ -64,6 +64,8 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
 }
 
 
+void (*_google_dl_debug_state_hook)(const struct r_debug *);
+
 /* 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
@@ -71,5 +73,7 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
 void
 _dl_debug_state (void)
 {
+  if (_google_dl_debug_state_hook)
+    _google_dl_debug_state_hook(&_r_debug);
 }
 rtld_hidden_def (_dl_debug_state)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-27 23:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 23:23 [glibc/maskray/grte] Forward-port addition of _google_dl_debug_state_hook Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).