1
1
/* Handle loading and unloading shared objects for internal libc purposes.
2
Copyright (C) 1999-2002,2004-2006,2009,2010 Free Software Foundation, Inc.
2
Copyright (C) 1999-2002,2004-2006,2009,2010,2011
3
Free Software Foundation, Inc.
3
4
This file is part of the GNU C Library.
4
5
Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
44
45
const char *last_errstring = NULL;
47
(void) GLRO(dl_catch_error) (&objname, &last_errstring, &malloced,
48
int result = (GLRO(dl_catch_error) (&objname, &last_errstring, &malloced,
50
?: last_errstring != NULL);
50
int result = last_errstring != NULL;
51
52
if (result && malloced)
52
53
free ((char *) last_errstring);
84
87
struct do_dlopen_args *args = (struct do_dlopen_args *) ptr;
85
88
/* Open and relocate the shared object. */
86
args->map = GLRO(dl_open) (args->name, args->mode, NULL, __LM_ID_CALLER,
87
__libc_argc, __libc_argv, __environ);
89
args->map = GLRO(dl_open) (args->name, args->mode, args->caller_dlopen,
90
__LM_ID_CALLER, __libc_argc, __libc_argv,
305
if (USE___THREAD || GL(dl_tls_dtv_slotinfo_list) != NULL)
307
/* Free the memory allocated for the dtv slotinfo array. We can do
308
this only if all modules which used this memory are unloaded. */
310
/* Free the memory allocated for the dtv slotinfo array. We can do
311
this only if all modules which used this memory are unloaded. */
310
if (GL(dl_initial_dtv) == NULL)
311
/* There was no initial TLS setup, it was set up later when
312
it used the normal malloc. */
313
free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
313
if (GL(dl_initial_dtv) == NULL)
314
/* There was no initial TLS setup, it was set up later when
315
it used the normal malloc. */
316
free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
316
/* The first element of the list does not have to be deallocated.
317
It was allocated in the dynamic linker (i.e., with a different
318
malloc), and in the static library it's in .bss space. */
319
free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
319
/* The first element of the list does not have to be deallocated.
320
It was allocated in the dynamic linker (i.e., with a different
321
malloc), and in the static library it's in .bss space. */
322
free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
322
324
void *scope_free_list = GL(dl_scope_free_list);
323
325
GL(dl_scope_free_list) = NULL;