summaryrefslogtreecommitdiff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2012-07-26 11:03:35 +0100
committerGary Benson <gbenson@redhat.com>2012-07-27 14:03:20 +0100
commit815e6fa3e010628f77838abec18692cbfeb60809 (patch)
tree68a6c353d769cf5d2a9b3620251c757b9bf6e80b /elf/dl-open.c
parent9f98c16cfe10fd70fedd647b328adac1a9b38f78 (diff)
Add SystemTap static probes to the runtime linker. [BZ #14298]
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index e2780a491b..00781afcf7 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -32,6 +32,7 @@
#include <caller.h>
#include <sysdep-cancel.h>
#include <tls.h>
+#include <stap-probe.h>
#include <dl-dst.h>
@@ -291,6 +292,7 @@ dl_open_worker (void *a)
struct r_debug *r = _dl_debug_initialize (0, args->nsid);
r->r_state = RT_CONSISTENT;
_dl_debug_state ();
+ LIBC_PROBE (map_complete, 3, args->nsid, r, new);
/* Print scope information. */
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
@@ -376,10 +378,19 @@ dl_open_worker (void *a)
}
}
+ int relocation_in_progress = 0;
+
for (size_t i = nmaps; i-- > 0; )
{
l = maps[i];
+ if (! relocation_in_progress)
+ {
+ /* Notify the debugger that relocations are about to happen. */
+ LIBC_PROBE (reloc_start, 2, args->nsid, r);
+ relocation_in_progress = 1;
+ }
+
#ifdef SHARED
if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
{
@@ -544,6 +555,10 @@ cannot load any more object with static TLS"));
}
}
+ /* Notify the debugger all new objects have been relocated. */
+ if (relocation_in_progress)
+ LIBC_PROBE (reloc_complete, 3, args->nsid, r, new);
+
/* Run the initializer functions of new objects. */
_dl_init (new, args->argc, args->argv, args->env);