mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
[BZ #9733]
* elf/dl-load.c (_dl_map_object_from_fd): Only call audit hooks if we are not loading a new audit library. * elf/dl-reloc (_dl_relocate_object): Third parameter is now a bitmask. Only use profiling trampoline for auditing if we are not relocating an audit library. * elf/dl-open.c (dl_open_worker): Adjust _dl_relocate_object call. * elf/rtld.c: Likewise. * sysdeps/generic/ldsodefs.h: Adjust _dl_relocate_object prototype.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/* Load a shared object at runtime, relocate it, and run its initializer.
|
||||
Copyright (C) 1996-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2007, 2009 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -207,7 +207,6 @@ dl_open_worker (void *a)
|
||||
const char *file = args->file;
|
||||
int mode = args->mode;
|
||||
struct link_map *new;
|
||||
int lazy;
|
||||
unsigned int i;
|
||||
bool any_tls = false;
|
||||
struct link_map *call_map = NULL;
|
||||
@ -366,7 +365,9 @@ dl_open_worker (void *a)
|
||||
_dl_debug_state ();
|
||||
|
||||
/* Only do lazy relocation if `LD_BIND_NOW' is not set. */
|
||||
lazy = (mode & RTLD_BINDING_MASK) == RTLD_LAZY && GLRO(dl_lazy);
|
||||
int reloc_mode = mode & __RTLD_AUDIT;
|
||||
if (GLRO(dl_lazy))
|
||||
reloc_mode |= mode & RTLD_LAZY;
|
||||
|
||||
/* Relocate the objects loaded. We do this in reverse order so that copy
|
||||
relocs of earlier objects overwrite the data written by later objects. */
|
||||
@ -388,7 +389,7 @@ dl_open_worker (void *a)
|
||||
start the profiling. */
|
||||
struct link_map *old_profile_map = GL(dl_profile_map);
|
||||
|
||||
_dl_relocate_object (l, l->l_scope, 1, 1);
|
||||
_dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
|
||||
|
||||
if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
|
||||
{
|
||||
@ -401,7 +402,7 @@ dl_open_worker (void *a)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
_dl_relocate_object (l, l->l_scope, lazy, 0);
|
||||
_dl_relocate_object (l, l->l_scope, reloc_mode, 0);
|
||||
}
|
||||
|
||||
if (l == new)
|
||||
|
Reference in New Issue
Block a user