aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-10-15 06:24:26 +0000
committerUlrich Drepper <drepper@redhat.com>2003-10-15 06:24:26 +0000
commita21a20a33f5b49cfc06ed72f3164099ce226a0b9 (patch)
treeeb1717e035a4f8f86694d722a7f8d568a95c02c5 /elf
parent1769a73f0bd6e11590ed88eea4391284585216d7 (diff)
downloadglibc-a21a20a33f5b49cfc06ed72f3164099ce226a0b9.zip
glibc-a21a20a33f5b49cfc06ed72f3164099ce226a0b9.tar.gz
glibc-a21a20a33f5b49cfc06ed72f3164099ce226a0b9.tar.bz2
Update.
2003-10-15 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (print_statistics): Print also number of relative relocations.
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 4f22a62..7c4d961 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2120,10 +2120,30 @@ print_statistics (void)
buf, pbuf);
}
#endif
+
+ unsigned long int num_relative_relocations = 0;
+ struct r_scope_elem *scope = &GL(dl_loaded)->l_searchlist;
+ unsigned int i;
+
+ for (i = 0; i < scope->r_nlist; i++)
+ {
+ struct link_map *l = scope->r_list [i];
+
+ if (!l->l_addr)
+ continue;
+
+ if (l->l_info[VERSYMIDX (DT_RELCOUNT)])
+ num_relative_relocations += l->l_info[VERSYMIDX (DT_RELCOUNT)]->d_un.d_val;
+ if (l->l_info[VERSYMIDX (DT_RELACOUNT)])
+ num_relative_relocations += l->l_info[VERSYMIDX (DT_RELACOUNT)]->d_un.d_val;
+ }
+
INTUSE(_dl_debug_printf) (" number of relocations: %lu\n",
GL(dl_num_relocations));
INTUSE(_dl_debug_printf) (" number of relocations from cache: %lu\n",
GL(dl_num_cache_relocations));
+ INTUSE(_dl_debug_printf) (" number of relative relocations: %lu\n",
+ num_relative_relocations);
#ifndef HP_TIMING_NONAVAIL
/* Time spend while loading the object and the dependencies. */