From: Stan Shebs Date: Tue, 13 Mar 2018 18:53:48 +0000 (-0700) Subject: Forward-port addition of _google_dl_debug_state_hook X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc36100b272323e826a41617746f6fe54afa4484;p=thirdparty%2Fglibc.git Forward-port addition of _google_dl_debug_state_hook --- diff --git a/elf/Versions b/elf/Versions index 3b09901f6c3..80cf1c47aae 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 14d1125fe6e..390ef994dd1 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)