aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-fini.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-fini.c')
-rw-r--r--elf/dl-fini.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index 5af43d3f5b..9dcd87ad11 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -1,5 +1,5 @@
/* Call the termination functions of loaded shared objects.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1998 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
@@ -29,7 +29,15 @@ _dl_fini (void)
{
if (l->l_info[DT_FINI] &&
!(l->l_name[0] == '\0' && l->l_type == lt_executable))
- (*(void (*) (void)) (l->l_addr + l->l_info[DT_FINI]->d_un.d_ptr)) ();
+ {
+ /* When debugging print a message first. */
+ if (_dl_debug_impcalls)
+ _dl_debug_message ("\n\tcalling fini: ",
+ l->l_name[0] ? l->l_name : _dl_argv[0],
+ "\n", NULL);
+
+ (*(void (*) (void)) (l->l_addr + l->l_info[DT_FINI]->d_un.d_ptr)) ();
+ }
/* Make sure nothing happens if we are called twice. */
l->l_init_called = 0;
}