From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7814) id 442F73858038; Sat, 28 Aug 2021 00:39:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 442F73858038 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Fangrui Song To: glibc-cvs@sourceware.org Subject: [glibc/google/grte/v5-2.27/master] Forward-port addition of _google_dl_debug_state_hook X-Act-Checkin: glibc X-Git-Author: Stan Shebs X-Git-Refname: refs/heads/google/grte/v5-2.27/master X-Git-Oldrev: d41bed3ce0c9138608269631ba65ae782108669a X-Git-Newrev: fc36100b272323e826a41617746f6fe54afa4484 Message-Id: <20210828003937.442F73858038@sourceware.org> Date: Sat, 28 Aug 2021 00:39:37 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2021 00:39:37 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fc36100b272323e826a41617746f6fe54afa4484 commit fc36100b272323e826a41617746f6fe54afa4484 Author: Stan Shebs 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)