mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-12 14:21:18 +08:00
* malloc/arena.c (ptmalloc_init): Don't use brk if dlopened
from statically linked program and avoid calling _dl_addr in that case.
This commit is contained in:
parent
be221e8df9
commit
1670c7cf0d
@ -1,3 +1,9 @@
|
||||
2004-10-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* malloc/arena.c (ptmalloc_init): Don't use brk if dlopened
|
||||
from statically linked program and avoid calling _dl_addr in that
|
||||
case.
|
||||
|
||||
2004-10-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* sysdeps/generic/strcpy_chk.c (__strcpy_chk): Speed up by checking
|
||||
|
@ -429,10 +429,16 @@ ptmalloc_init (void)
|
||||
main_arena.next = &main_arena;
|
||||
|
||||
#if defined _LIBC && defined SHARED
|
||||
/* In case this libc copy is in a non-default namespace, never use brk. */
|
||||
/* In case this libc copy is in a non-default namespace, never use brk.
|
||||
Likewise if dlopened from statically linked program. */
|
||||
Dl_info di;
|
||||
struct link_map *l;
|
||||
if (_dl_addr (ptmalloc_init, &di, &l, NULL) != 0 && l->l_ns != LM_ID_BASE)
|
||||
extern struct dl_open_hook *_dl_open_hook;
|
||||
libc_hidden_proto (_dl_open_hook);
|
||||
|
||||
if (_dl_open_hook != NULL
|
||||
|| (_dl_addr (ptmalloc_init, &di, &l, NULL) != 0
|
||||
&& l->l_ns != LM_ID_BASE))
|
||||
__morecore = __failing_morecore;
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user