dlopen: skip debugger notification for DSO loaded from sprof (bug 30258)
Checks
Commit Message
Avoid inconsistent state in the debugger interface.
---
elf/dl-load.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
* Andreas Schwab via Libc-alpha:
> Avoid inconsistent state in the debugger interface.
> ---
> elf/dl-load.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/elf/dl-load.c b/elf/dl-load.c
> index 9a0e40c0e9..39c63ff1b3 100644
> --- a/elf/dl-load.c
> +++ b/elf/dl-load.c
> @@ -1483,6 +1483,10 @@ cannot enable executable stack as shared object requires");
> /* Now that the object is fully initialized add it to the object list. */
> _dl_add_to_namespace_list (l, nsid);
>
> + /* Skip auditing and debugger notification when called from 'sprof'. */
> + if (mode & __RTLD_SPROF)
> + return l;
> +
> /* Signal that we are going to add new objects. */
> struct r_debug *r = _dl_debug_update (nsid);
> if (r->r_state == RT_CONSISTENT)
Can we add a test for this? Thanks.
@@ -1483,6 +1483,10 @@ cannot enable executable stack as shared object requires");
/* Now that the object is fully initialized add it to the object list. */
_dl_add_to_namespace_list (l, nsid);
+ /* Skip auditing and debugger notification when called from 'sprof'. */
+ if (mode & __RTLD_SPROF)
+ return l;
+
/* Signal that we are going to add new objects. */
struct r_debug *r = _dl_debug_update (nsid);
if (r->r_state == RT_CONSISTENT)