public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Fangrui Song <maskray@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/google/grte/v5-2.27/master] Forward-port addition of _google_dl_debug_state_hook
Date: Sat, 28 Aug 2021 00:39:37 +0000 (GMT)	[thread overview]
Message-ID: <20210828003937.442F73858038@sourceware.org> (raw)

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)


                 reply	other threads:[~2021-08-28  0:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210828003937.442F73858038@sourceware.org \
    --to=maskray@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).